fix(BE): Change migration chickin and project flock population to refactored one

This commit is contained in:
aguhh18
2025-10-31 14:27:08 +07:00
parent 31bb28f7da
commit bf14ab7865
6 changed files with 129 additions and 5 deletions
@@ -2,7 +2,8 @@ CREATE TABLE IF NOT EXISTS laying_transfers (
id BIGSERIAL PRIMARY KEY,
from_project_flock_id BIGINT NOT NULL,
to_project_flock_id BIGINT NOT NULL,
total_quantity INTEGER,
transfer_date DATE NOT NULL,
total_qty INTEGER,
notes TEXT,
created_at TIMESTAMPTZ DEFAULT now(),
updated_at TIMESTAMPTZ DEFAULT now(),
@@ -36,7 +37,10 @@ BEGIN
END $$;
-- INDEXES
CREATE INDEX IF NOT EXISTS idx_laying_transfers_from_project_flock_id ON laying_transfers(from_project_flock_id);
CREATE INDEX IF NOT EXISTS idx_laying_transfers_to_project_flock_id ON laying_transfers(to_project_flock_id);
CREATE INDEX IF NOT EXISTS idx_laying_transfers_created_by ON laying_transfers(created_by);
CREATE INDEX IF NOT EXISTS idx_laying_transfers_deleted_at ON laying_transfers(deleted_at);
CREATE INDEX IF NOT EXISTS idx_laying_transfers_from_project_flock_id ON laying_transfers (from_project_flock_id);
CREATE INDEX IF NOT EXISTS idx_laying_transfers_to_project_flock_id ON laying_transfers (to_project_flock_id);
CREATE INDEX IF NOT EXISTS idx_laying_transfers_created_by ON laying_transfers (created_by);
CREATE INDEX IF NOT EXISTS idx_laying_transfers_deleted_at ON laying_transfers (deleted_at);