Created
August 4, 2018 20:18
-
-
Save alexesDev/9f752d912a5c16d808b2a0c38080bb57 to your computer and use it in GitHub Desktop.
createteable sqitch template ~/ .sqitch/templates
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 table if not exists [% schema %].[% table %] ( | |
[% FOREACH col IN column -%] | |
[% col %] [% type.item( loop.index ) or 'text' %] not null[% loop.last ? '' : ',' %] | |
[% 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 [% column.join(', ') %] | |
from [% schema %].[% table %] | |
where false; | |
ROLLBACK; |
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 table [% schema %].[% table %]; | |
COMMIT; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment