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);