Align cutting families with Olist production data
Some checks failed
Build and Deploy / build-and-deploy (push) Failing after 1m17s
Some checks failed
Build and Deploy / build-and-deploy (push) Failing after 1m17s
This commit is contained in:
@@ -489,6 +489,22 @@ const initDB = async () => {
|
||||
);
|
||||
`);
|
||||
|
||||
await pool.query(`
|
||||
CREATE TABLE IF NOT EXISTS production_yield_supplier_recommendations (
|
||||
family_key VARCHAR(20) NOT NULL,
|
||||
supplier VARCHAR(255) NOT NULL,
|
||||
sample_count INTEGER NOT NULL DEFAULT 0,
|
||||
yield_sample_count INTEGER NOT NULL DEFAULT 0,
|
||||
roll_sample_count INTEGER NOT NULL DEFAULT 0,
|
||||
avg_yield_pieces_per_kg NUMERIC(14, 4),
|
||||
avg_kg_per_roll NUMERIC(14, 4),
|
||||
recommended_units_per_roll NUMERIC(14, 4),
|
||||
last_completed_date DATE,
|
||||
updated_at TIMESTAMPTZ NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
PRIMARY KEY (family_key, supplier)
|
||||
);
|
||||
`);
|
||||
|
||||
await pool.query(`
|
||||
ALTER TABLE production_orders
|
||||
ALTER COLUMN created_at TYPE TIMESTAMPTZ USING created_at AT TIME ZONE 'America/Sao_Paulo',
|
||||
|
||||
Reference in New Issue
Block a user