Files
mercadodevida/project/migrations/036_order_tracking_number.js
2026-08-21 09:27:55 +02:00

16 lines
478 B
JavaScript

/**
* Adds shipment tracking to orders. The tracking number is set when an order
* transitions to SHIPPED and is included in the customer notification.
* @param {import('node-pg-migrate').MigrationBuilder} pgm
*/
export const up = (pgm) => {
pgm.sql(`
ALTER TABLE orders_orders
ADD COLUMN IF NOT EXISTS tracking_number text NULL DEFAULT NULL
`);
};
export const down = (pgm) => {
pgm.sql(`ALTER TABLE orders_orders DROP COLUMN IF EXISTS tracking_number`);
};