waveterm/db/migrations/000012_historylinenum.up.sql
2023-03-17 21:36:49 -07:00

7 lines
176 B
SQL

ALTER TABLE history ADD COLUMN linenum int NOT NULL DEFAULT 0;
UPDATE history
SET linenum = COALESCE((SELECT line.linenum FROM line WHERE line.lineid = history.lineid), 0)
;