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$;