Skip to content

Commit

Permalink
Reset action to "after", make sure it runs after all both changesets
Browse files Browse the repository at this point in the history
  • Loading branch information
cjllanwarne committed Sep 20, 2023
1 parent 4fc99a6 commit d39400a
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 3 deletions.
5 changes: 5 additions & 0 deletions database/migration/src/main/resources/changelog.xml
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,11 @@
<!-- REMINDER!
Before appending here, did you remember to include the 'objectQuotingStrategy="QUOTE_ALL_OBJECTS"' line in your changeset/xyz.xml...?
-->
<!-- WARNING!
This changeset should always be last. It it always run (and should always run last) to set table ownership correctly:
-->
<include file="changesets/set_table_role.xml" relativeToChangelogFile="true" />


</databaseChangeLog>
<!--
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
This changeset will be applied whenever the 'sharedCromwellDbRole' property is set.
It runs every time to ensure the role is set correctly before any other changesets.
-->
<changeSet runAlways="true" author="sshah" id="init_role" dbms="postgresql">
<changeSet runAlways="true" author="sshah" id="set_table_role" dbms="postgresql">
<preConditions onFail="MARK_RAN">
<!-- check that 'sharedCromwellDbRole' role is set, and matches something in the pg_roles table -->
<sqlCheck expectedResult="1">
Expand All @@ -20,7 +20,7 @@
where '${sharedCromwellDbRole}' != '' and pg_roles.rolname = '${sharedCromwellDbRole}';
</sqlCheck>
</preConditions>
<sql>SET ROLE TO ${sharedCromwellDbRole};</sql>
<sql>REASSIGN OWNED BY CURRENT_USER TO ${sharedCromwellDbRole};</sql>
</changeSet>

</databaseChangeLog>
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.3.xsd">

<include file="metadata_changesets/init_role.xml" relativeToChangelogFile="true" />
<include file="metadata_changesets/move_sql_metadata_changelog.xml" relativeToChangelogFile="true" />
<include file="changesets/change_max_size_label_entry.xml" relativeToChangelogFile="true" />
<include file="metadata_changesets/delete_duplicate_custom_labels.xml" relativeToChangelogFile="true"/>
Expand All @@ -20,5 +19,10 @@
<include file="metadata_changesets/remove_non_summarizable_metadata_from_queue.xml" relativeToChangelogFile="true" />
<include file="metadata_changesets/update_metadata_archive_index.xml" relativeToChangelogFile="true" />
<include file="metadata_changesets/reset_archive_statuses_to_null.xml" relativeToChangelogFile="true" />
<!-- WARNING!
This changeset should always be last. It it always run (and should always run last) to set table ownership correctly:
-->
<include file="metadata_changesets/set_table_role.xml" relativeToChangelogFile="true" />

</databaseChangeLog>
<!-- See Dos and Don'ts in changelog.xml -->

0 comments on commit d39400a

Please sign in to comment.