Mercurial > gemma
changeset 5133:38491057807b queued-stage-done
Move schema versions beyond what is in default branch
author | Tom Gottfried <tom@intevation.de> |
---|---|
date | Fri, 27 Mar 2020 15:31:03 +0100 |
parents | 52e3980e3462 |
children | 590ccab9ab70 |
files | schema/updates/1432/01.add_state.sql schema/updates/1433/01.add_state.sql schema/updates/1433/01.allow_job_delete_sys_admin.sql schema/updates/1434/01.add_import_state_idx.sql schema/updates/1434/01.allow_job_delete_sys_admin.sql schema/updates/1435/01.add_import_state_idx.sql schema/version.sql |
diffstat | 7 files changed, 24 insertions(+), 24 deletions(-) [+] |
line wrap: on
line diff
--- a/schema/updates/1432/01.add_state.sql Fri Mar 27 13:09:02 2020 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,19 +0,0 @@ --- DROP and re-CREATE type because adding a value isn't possible in transaction --- https://www.postgresql.org/docs/11/sql-altertype.html#id-1.9.3.42.7 - -ALTER TABLE import.imports - ALTER COLUMN state DROP DEFAULT, - ALTER COLUMN state TYPE varchar; - -DROP TYPE import_state; - -CREATE TYPE import_state AS ENUM ( - 'queued', - 'running', - 'failed', 'unchanged', 'pending', - 'accepted', 'declined', 'reviewed' -); - -ALTER TABLE import.imports - ALTER COLUMN state TYPE import_state USING CAST(state AS import_state), - ALTER COLUMN state SET DEFAULT 'queued';
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/schema/updates/1433/01.add_state.sql Fri Mar 27 15:31:03 2020 +0100 @@ -0,0 +1,19 @@ +-- DROP and re-CREATE type because adding a value isn't possible in transaction +-- https://www.postgresql.org/docs/11/sql-altertype.html#id-1.9.3.42.7 + +ALTER TABLE import.imports + ALTER COLUMN state DROP DEFAULT, + ALTER COLUMN state TYPE varchar; + +DROP TYPE import_state; + +CREATE TYPE import_state AS ENUM ( + 'queued', + 'running', + 'failed', 'unchanged', 'pending', + 'accepted', 'declined', 'reviewed' +); + +ALTER TABLE import.imports + ALTER COLUMN state TYPE import_state USING CAST(state AS import_state), + ALTER COLUMN state SET DEFAULT 'queued';
--- a/schema/updates/1433/01.allow_job_delete_sys_admin.sql Fri Mar 27 13:09:02 2020 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -GRANT DELETE ON import.imports, import.import_logs TO sys_admin;
--- a/schema/updates/1434/01.add_import_state_idx.sql Fri Mar 27 13:09:02 2020 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,3 +0,0 @@ -DROP INDEX import.enqueued_idx; -CREATE INDEX enqueued_idx ON import.imports(enqueued); -CREATE INDEX state_idx ON import.imports(state);
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/schema/updates/1434/01.allow_job_delete_sys_admin.sql Fri Mar 27 15:31:03 2020 +0100 @@ -0,0 +1,1 @@ +GRANT DELETE ON import.imports, import.import_logs TO sys_admin;