Add production plan release checklist
This commit is contained in:
@@ -189,6 +189,21 @@ const initDB = async () => {
|
||||
);
|
||||
`);
|
||||
|
||||
// The release decision remains auditable when the plan changes status.
|
||||
await pool.query(`
|
||||
CREATE TABLE IF NOT EXISTS production_plan_reviews (
|
||||
id SERIAL PRIMARY KEY,
|
||||
production_plan_id INTEGER NOT NULL UNIQUE REFERENCES production_plans(id) ON DELETE CASCADE,
|
||||
decision VARCHAR(30) NOT NULL DEFAULT 'pending',
|
||||
checklist JSONB NOT NULL DEFAULT '{}'::jsonb,
|
||||
notes TEXT,
|
||||
reviewed_by TEXT,
|
||||
reviewed_at TIMESTAMPTZ,
|
||||
created_at TIMESTAMPTZ DEFAULT CURRENT_TIMESTAMP,
|
||||
updated_at TIMESTAMPTZ DEFAULT CURRENT_TIMESTAMP
|
||||
);
|
||||
`);
|
||||
|
||||
await pool.query(`
|
||||
ALTER TABLE production_orders
|
||||
ADD COLUMN IF NOT EXISTS production_plan_id INTEGER REFERENCES production_plans(id) ON DELETE SET NULL,
|
||||
|
||||
Reference in New Issue
Block a user