2022-05-14 15:46:05 +02:00
|
|
|
ALTER TABLE gamenight RENAME TO _gamenight_old;
|
|
|
|
|
|
|
|
CREATE TABLE gamenight (
|
2022-05-27 20:53:12 +02:00
|
|
|
id UUID NOT NULL PRIMARY KEY,
|
|
|
|
name VARCHAR NOT NULL,
|
|
|
|
datetime VARCHAR NOT NULL,
|
|
|
|
owner_id UUID NOT NULL,
|
|
|
|
CONSTRAINT FK_OwnerId FOREIGN KEY (owner_id) REFERENCES users(id) ON DELETE CASCADE
|
2022-05-14 15:46:05 +02:00
|
|
|
);
|
|
|
|
|
2022-05-27 20:53:12 +02:00
|
|
|
SET session_replication_role = 'replica';
|
2022-05-14 15:46:05 +02:00
|
|
|
|
2022-05-27 20:53:12 +02:00
|
|
|
INSERT INTO gamenight (id, name, datetime, owner_id)
|
|
|
|
select id, name, datetime, '00000000-0000-0000-0000-000000000000'
|
2022-05-14 15:46:05 +02:00
|
|
|
FROM _gamenight_old;
|
|
|
|
|
|
|
|
drop table _gamenight_old;
|
|
|
|
|
2022-05-27 20:53:12 +02:00
|
|
|
SET session_replication_role = 'origin';
|