git-promise
Add commands to run as branches merge down stream.
promise new <promise> <extension>
promise new tables sql
promise add <promise> <command>
mysql "ALTER TABLE table ADD some_column int"promise add tables ALTER TABLE table ADD some_column int
promise pull <promise>
promise pull tablesmysql "source tables.sql"
promise resolve <promise>
promise resolve tables
Example
# Create promise for SQL promise new tables sql
Dev server 1
# Add a line to our promise promise add tables ALTER TABLE table ADD some_column int# Push changes git add -A && git commit && git push
Dev server 2
# Add a line to our promise promise add tables ALTER TABLE table ADD some_column_other_column VARCHAR# Push changes git add -A && git commit && git push
Test / Master server
# Pull changes git pullpromise pull tablescat tables.sql # ALTER TABLE table ADD some_column int # ALTER TABLE table ADD some_column_other_column VARCHAR(32) # Apply changes mysql "source tables.sql" # Resolve changes promise resolve tablescat tables.sql # Empty
Pull and resolve should always be used together, in one sitting.
promise pulldo_somethingpromise resolve
promise add
will overwrite the cache and should be done after promise pull
.