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

18 lines
477 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
SET screenid = (SELECT screen.screenid FROM screen WHERE screen.windowid = remote_instance.screenid)
WHERE screenid <> ''
;
UPDATE line
SET screenid = (SELECT screen.screenid FROM screen WHERE screen.windowid = line.screenid)
WHERE screenid <> ''
;
ALTER TABLE history DROP COLUMN windowid;
ALTER TABLE screen DROP COLUMN windowid;