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
DELIMITER $$ | |
DROP PROCEDURE IF EXISTS add_email_address_column_to_customers_table $$ | |
-- Create the stored procedure to perform the migration | |
CREATE PROCEDURE add_email_address_column_to_customers_table() | |
BEGIN | |
-- Add the email_address column to the customers table, if it doesn't already exist |
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
task prefixNewMigrations { | |
fileTree(dir: 'dev/src/db/listhub').exclude({ isFilePrefixed(it.file) }).each { file -> | |
doLast { | |
def timestamp = new Date().format('yyyyMMddHHmmssSSS', TimeZone.getTimeZone('GMT')) | |
println "Renaming $file.name to ${timestamp}__$file.name" | |
file.renameTo("$file.parentFile.absolutePath$file.separator${timestamp}__$file.name") |
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
<project name="migrations"> | |
<target name="prefix-new-migrations"> | |
<foreach target="rename-file" param="the-file"> | |
<path> | |
<!-- The hardcoded directory containing the migrations --> | |
<fileset dir="./src/db/migrations" casesensitive="no" includes="*.sql"> | |
<!-- Exclude any migration files which have already been prefixed --> | |
<not> | |
<filename regex="\d+__.*" casesensitive="true"/> |
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
def compare_branches(source, destination) | |
begin | |
IO.popen 'git fetch' | |
gitdiff = `git diff --name-status #{source}..#{destination}` | |
rescue | |
raise "git unavailable" | |
end | |
if (!gitdiff.empty?) | |
raise "Branches do not match!\n" + gitdiff | |
end |