waveterm/wavesrv/db/migrations/000012_historylinenum.up.sql

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)
;