-
Notifications
You must be signed in to change notification settings - Fork 360
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Only update metadata table ownership
- Loading branch information
1 parent
fd386cd
commit 836f084
Showing
4 changed files
with
37 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 0 additions & 26 deletions
26
database/migration/src/main/resources/changesets/set_table_role.xml
This file was deleted.
Oops, something went wrong.
1 change: 0 additions & 1 deletion
1
database/migration/src/main/resources/metadata_changesets/set_table_role.xml
This file was deleted.
Oops, something went wrong.
34 changes: 34 additions & 0 deletions
34
database/migration/src/main/resources/metadata_changesets/set_table_role.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<?xml version="1.0" encoding="UTF-8" standalone="no"?> | ||
<databaseChangeLog objectQuotingStrategy="QUOTE_ALL_OBJECTS" | ||
xmlns="http://www.liquibase.org/xml/ns/dbchangelog" | ||
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"> | ||
|
||
<!-- The 'sharedCromwellDbRole' can be set via JAVA_OPTS if desired (eg -DsharedCromwellDbRole=...). --> | ||
<property name="sharedCromwellDbRole" value=""/> | ||
|
||
<!-- | ||
This changeset will be applied whenever the 'sharedCromwellDbRole' property is set. | ||
It runs every time to ensure the role is set correctly after all other changesets. | ||
--> | ||
<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"> | ||
SELECT count(1) | ||
FROM pg_roles | ||
where '${sharedCromwellDbRole}' != '' and pg_roles.rolname = '${sharedCromwellDbRole}'; | ||
</sqlCheck> | ||
</preConditions> | ||
<sql> | ||
ALTER TABLE "CUSTOM_LABEL_ENTRY" OWNER TO '${sharedCromwellDbRole}'; | ||
ALTER TABLE "METADATA_ENTRY" OWNER TO '${sharedCromwellDbRole}'; | ||
ALTER TABLE "SUMMARY_QUEUE_ENTRY" OWNER TO '${sharedCromwellDbRole}'; | ||
ALTER TABLE "SUMMARY_STATUS_ENTRY" OWNER TO '${sharedCromwellDbRole}'; | ||
ALTER TABLE "WORKFLOW_METADATA_SUMMARY_ENTRY" OWNER TO '${sharedCromwellDbRole}'; | ||
ALTER TABLE "sqlmetadatadatabasechangelog" OWNER TO '${sharedCromwellDbRole}'; | ||
ALTER TABLE "sqlmetadatadatabasechangeloglock" OWNER TO '${sharedCromwellDbRole}'; | ||
</sql> | ||
</changeSet> | ||
|
||
</databaseChangeLog> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters