waveterm/wavesrv/db/migrations/000010_removewindowid.up.sql

18 lines
505 B
MySQL
Raw Normal View History

2023-03-15 00:37:22 +01:00
ALTER TABLE remote_instance RENAME COLUMN windowid TO screenid;
ALTER TABLE line RENAME COLUMN windowid TO screenid;
UPDATE remote_instance
2023-03-18 02:19:59 +01:00
SET screenid = COALESCE((SELECT screen.screenid FROM screen WHERE screen.windowid = remote_instance.screenid), '')
2023-03-15 00:37:22 +01:00
WHERE screenid <> ''
;
UPDATE line
2023-03-18 02:19:59 +01:00
SET screenid = COALESCE((SELECT screen.screenid FROM screen WHERE screen.windowid = line.screenid), '')
2023-03-15 00:37:22 +01:00
WHERE screenid <> ''
;
ALTER TABLE history DROP COLUMN windowid;
ALTER TABLE screen DROP COLUMN windowid;