Last active
October 9, 2016 13:43
-
-
Save deinspanjer/385a804f7228e692bb3134e5ca69cabd to your computer and use it in GitHub Desktop.
Sqitch create schema templates for pg engine
This file contains hidden or 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
| -- Deploy [% project %]:[% change %] to [% engine %] | |
| [% FOREACH item IN requires -%] | |
| -- requires: [% item %] | |
| [% END -%] | |
| [% FOREACH item IN conflicts -%] | |
| -- conflicts: [% item %] | |
| [% END -%] | |
| BEGIN; | |
| CREATE SCHEMA [% IF name %][% name %][% ELSE %][% change %][% END %]; | |
| GRANT USAGE ON SCHEMA [% IF name %][% name %][% ELSE %][% change %][% END %] TO viewer; | |
| COMMIT; |
This file contains hidden or 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
| -- Revert [% project %]:[% change %] from [% engine %] | |
| BEGIN; | |
| DROP SCHEMA [% IF name %][% name %][% ELSE %][% change %][% END %]; | |
| COMMIT; |
This file contains hidden or 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
| -- Verify [% project %]:[% change %] on [% engine %] | |
| BEGIN; | |
| SELECT pg_catalog.has_schema_privilege('[% IF name %][% name %][% ELSE %][% change %][% END %]', 'usage'); | |
| ROLLBACK; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment