mirror of
https://gitlab.com/mbugroup/lti-api.git
synced 2026-05-20 13:31:56 +00:00
feat(BE-116): add project chick in database schema
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
CREATE TABLE project_chick_ins (
|
||||
id BIGSERIAL PRIMARY KEY,
|
||||
project_floc_id BIGINT NOT NULL REFERENCES project_flocs (id),
|
||||
product_warehouse_id BIGINT NOT NULL REFERENCES product_warehouses (id),
|
||||
chick_in_date DATE NOT NULL,
|
||||
quantity NUMERIC(15, 3) NOT NULL CHECK (quantity > 0),
|
||||
note TEXT,
|
||||
created_by BIGINT NOT NULL REFERENCES users (id),
|
||||
created_at TIMESTAMPTZ DEFAULT now(),
|
||||
updated_at TIMESTAMPTZ DEFAULT now(),
|
||||
deleted_at TIMESTAMPTZ
|
||||
);
|
||||
|
||||
CREATE INDEX idx_project_chick_ins_project_floc_id ON project_chick_ins (project_floc_id);
|
||||
|
||||
CREATE INDEX idx_project_chick_ins_product_warehouse_id ON project_chick_ins (product_warehouse_id);
|
||||
|
||||
CREATE INDEX idx_project_chick_ins_created_by ON project_chick_ins (created_by);
|
||||
@@ -0,0 +1 @@
|
||||
DROP TABLE IF EXISTS project_chick_ins;
|
||||
Reference in New Issue
Block a user