From fa9dbe0edad5d06467182f87d7e979b7842b0215 Mon Sep 17 00:00:00 2001 From: Freya Murphy Date: Fri, 20 Dec 2024 00:51:30 -0500 Subject: [PATCH] add lang column to user --- src/db/migrations/0003.sql | 2 +- src/db/migrations/0004.sql | 16 ++++++++++++++++ src/db/rest/util/api_root.sql | 19 ------------------- 3 files changed, 17 insertions(+), 20 deletions(-) create mode 100644 src/db/migrations/0004.sql delete mode 100644 src/db/rest/util/api_root.sql diff --git a/src/db/migrations/0003.sql b/src/db/migrations/0003.sql index 285a8f5..b9734ee 100644 --- a/src/db/migrations/0003.sql +++ b/src/db/migrations/0003.sql @@ -6,6 +6,6 @@ ALTER SCHEMA admin RENAME TO xssbook; -- Migration End; -- Set Current Revision -UPDATE sys.database_info SET curr_revision = 3 WHERE name = current_database(); +UPDATE sys.database_info SET curr_revision = 4 WHERE name = current_database(); COMMIT TRANSACTION; diff --git a/src/db/migrations/0004.sql b/src/db/migrations/0004.sql new file mode 100644 index 0000000..addf0fc --- /dev/null +++ b/src/db/migrations/0004.sql @@ -0,0 +1,16 @@ +BEGIN TRANSACTION; +SET search_path = public; + +-- Migration Start +CREATE TYPE xssbook.lang_type AS ENUM ( + 'en_US' +); + +ALTER TABLE xssbook.user + ADD COLUMN lang xssbook.lang_type DEFAULT 'en_US' NOT NULL; +-- Migration End; + +-- Set Current Revision +UPDATE sys.database_info SET curr_revision = 5 WHERE name = current_database(); + +COMMIT TRANSACTION; diff --git a/src/db/rest/util/api_root.sql b/src/db/rest/util/api_root.sql deleted file mode 100644 index 7141a5f..0000000 --- a/src/db/rest/util/api_root.sql +++ /dev/null @@ -1,19 +0,0 @@ - -CREATE FUNCTION FUNCTION _api.root() -RETURNS JSON -LANGUAGE plpgsql; -AS $BODY$ -DECLARE -openapi JSON = $$ - { - "swagger": "2.0", - "info": { - "title": "XSSBook", - "description": "XSSBook Api Documentation" - } - } -$$; -BEGIN - RETURN openapi; -END -$BODY$;