diff --git a/etor/databaseMigrations/1.0.0.yml b/etor/databaseMigrations/1.0.0.yml index 62f5249d6..ee8561b6f 100644 --- a/etor/databaseMigrations/1.0.0.yml +++ b/etor/databaseMigrations/1.0.0.yml @@ -1,7 +1,7 @@ databaseChangeLog: - changeSet: id: 1 - author: jeff.crichlake + author: jeff.crichlake labels: create-type context: metadata comment: create status type @@ -9,15 +9,15 @@ databaseChangeLog: - sql: sql: CREATE TYPE message_status AS ENUM ('PENDING', 'DELIVERED', 'FAILED') - - changeSet: - id: 2 - author: jeff.crichlake - labels: azure - context: metadata - comment: transfer ownership of the message_status type in Azure environments - changes: - - sql: - sql: ALTER TYPE message_status OWNER TO azure_pg_admin +# - changeSet: +# id: 2 +# author: jeff.crichlake +# labels: azure +# context: metadata +# comment: transfer ownership of the message_status type in Azure environments +# changes: +# - sql: +# sql: ALTER TYPE message_status OWNER TO azure_pg_admin - changeSet: id: 3 @@ -27,26 +27,26 @@ databaseChangeLog: comment: create partner metadata table changes: - createTable: - tableName: metadata + tableName: metadata columns: - column: - name: received_message_id - type: varchar(40) + name: received_message_id + type: varchar(40) constraints: - primaryKey: true - nullable: false + primaryKey: true + nullable: false - column: - name: sent_message_id - type: varchar(40) + name: sent_message_id + type: varchar(40) - column: - name: sender - type: varchar(30) + name: sender + type: varchar(30) - column: - name: receiver - type: varchar(30) + name: receiver + type: varchar(30) - column: - name: hash_of_order - type: varchar(1000) + name: hash_of_order + type: varchar(1000) - column: name: time_received type: timestamptz @@ -60,42 +60,32 @@ databaseChangeLog: name: failure_reason type: varchar(1000) - - changeSet: - id: 4 - author: jeff.crichlake - labels: azure - context: metadata - comment: Allow Azure admin role to do anything to the metadata table - changes: - - sql: - sql: GRANT ALL ON metadata TO azure_pg_admin +# - changeSet: +# id: 4 +# author: jeff.crichlake +# labels: azure +# context: metadata +# comment: Allow Azure admin role to do anything to the metadata table +# changes: +# - sql: +# sql: GRANT ALL ON metadata TO azure_pg_admin - - changeSet: - id: 5 - author: jeff.crichlake - labels: azure - context: metadata - comment: Make Azure admin role the owner of the metadata table - changes: - - sql: - sql: ALTER TABLE metadata OWNER TO azure_pg_admin - - - changeSet: - id: 6 - author: jeff.crichlake - labels: azure - context: metadata - comment: Fix role issue - changes: - - sql: - sql: GRANT SELECT ON ALL TABLES IN SCHEMA public TO azure_pg_admin +# - changeSet: +# id: 5 +# author: jeff.crichlake +# labels: azure +# context: metadata +# comment: Make Azure admin role the owner of the metadata table +# changes: +# - sql: +# sql: ALTER TABLE metadata OWNER TO azure_pg_admin - - changeSet: - id: 7 - author: jeff.crichlake - labels: azure - context: metadata - comment: Fix role ownership - changes: - - sql: - sql: REASSIGN OWNED BY 'cdcti-github' TO 'azure_pg_admin' +# - changeSet: +# id: 6 +# author: jeff.crichlake +# labels: azure +# context: metadata +# comment: Fix role issue +# changes: +# - sql: +# sql: GRANT SELECT ON ALL TABLES IN SCHEMA public TO azure_pg_admin diff --git a/etor/databaseMigrations/azure.yml b/etor/databaseMigrations/azure.yml new file mode 100644 index 000000000..bc37413c9 --- /dev/null +++ b/etor/databaseMigrations/azure.yml @@ -0,0 +1,11 @@ +databaseChangeLog: + - changeSet: + id: 1 + author: halprin + labels: azure + context: azure + runAlways: true + comment: Fix ownership of anything created in every migration run + changes: + - sql: + sql: REASSIGN OWNED BY CURRENT_USER TO azure_pg_admin diff --git a/etor/databaseMigrations/root.yml b/etor/databaseMigrations/root.yml index 0ea225f45..683bf1cdd 100644 --- a/etor/databaseMigrations/root.yml +++ b/etor/databaseMigrations/root.yml @@ -1,3 +1,6 @@ databaseChangeLog: - include: file: etor/databaseMigrations/1.0.0.yml + - include: + file: etor/databaseMigrations/azure.yml + labels: azure