From 5abc125a52f664c95592c0e7bb378c95e00d9e61 Mon Sep 17 00:00:00 2001 From: sudoer777 <78781902+sudoer777@users.noreply.github.com> Date: Mon, 6 Dec 2021 10:39:24 -0700 Subject: [PATCH] Add migration script to add optional submitter_name column --- database/migrations/3.sql | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 database/migrations/3.sql diff --git a/database/migrations/3.sql b/database/migrations/3.sql new file mode 100644 index 0000000..117779a --- /dev/null +++ b/database/migrations/3.sql @@ -0,0 +1,15 @@ +/* ADD OPTIONAL SUBMITTER NAME COLUMN IN GAMES TABLE */ + +BEGIN; + +ALTER TABLE scores.games ALTER COLUMN submitter_id DROP NOT NULL; + +ALTER TABLE scores.games +ADD COLUMN submitter_name TEXT; + + +UPDATE metadata +SET value = '3' +WHERE property = 'latest_migration'; + +COMMIT; \ No newline at end of file