mirror of
https://gitlab.com/mbugroup/lti-api.git
synced 2026-05-23 14:55:42 +00:00
feat(BE-117): implement CRUD endpoints for project
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
CREATE TABLE IF NOT EXISTS project_chickins (
|
||||
id BIGSERIAL PRIMARY KEY,
|
||||
project_floc_kandang_id BIGINT NOT NULL,
|
||||
project_flock_kandang_id BIGINT NOT NULL,
|
||||
chick_in_date DATE NOT NULL,
|
||||
quantity NUMERIC(15, 3) NOT NULL,
|
||||
note TEXT,
|
||||
@@ -15,8 +15,8 @@ DO $$
|
||||
BEGIN
|
||||
IF EXISTS (SELECT 1 FROM pg_tables WHERE tablename = 'project_flock_kandangs') THEN
|
||||
ALTER TABLE project_chickins
|
||||
ADD CONSTRAINT fk_project_floc_kandang_id
|
||||
FOREIGN KEY (project_floc_kandang_id)
|
||||
ADD CONSTRAINT fk_project_flock_kandang_id
|
||||
FOREIGN KEY (project_flock_kandang_id)
|
||||
REFERENCES project_flock_kandangs(id)
|
||||
ON DELETE RESTRICT ON UPDATE CASCADE;
|
||||
END IF;
|
||||
@@ -31,6 +31,6 @@ BEGIN
|
||||
END $$;
|
||||
|
||||
-- INDEXES
|
||||
CREATE INDEX IF NOT EXISTS idx_project_chickins_project_floc_kandang_id ON project_chickins (project_floc_kandang_id);
|
||||
CREATE INDEX IF NOT EXISTS idx_project_chickins_project_flock_kandang_id ON project_chickins (project_flock_kandang_id);
|
||||
|
||||
CREATE INDEX IF NOT EXISTS idx_project_chickins_created_by ON project_chickins (created_by);
|
||||
Reference in New Issue
Block a user