Files
upstream-ourboard/backend/migrations/002_add_first_serial.js
upstream-mirror d57328655f
Some checks failed
build / test (18.x) (push) Failing after 10s
build / lint (18.x) (push) Failing after 0s
build / docker-image (push) Has been skipped
snapshot of https://github.com/raimohanska/ourboard.git (master, 2026-09-23; blobs > 131072B omitted)
2026-09-23 16:16:17 +05:00

8 lines
285 B
JavaScript

exports.up = (pgm) => {
pgm.sql(`
ALTER TABLE board_event ADD COLUMN IF NOT EXISTS first_serial int;
UPDATE board_event SET first_serial = COALESCE(CAST(events#>'{events, 0, serial}' as int), 0);
ALTER TABLE board_event ALTER COLUMN first_serial SET NOT NULL;
`)
}