Skip to content
This repository was archived by the owner on Apr 3, 2019. It is now read-only.

Commit 0790b89

Browse files
philboothvbudhram
authored andcommitted
fix(scripts): add SET NAMES to reverse migration boilerplate (#296), r=@vbudhram
1 parent b6cb3e5 commit 0790b89

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

scripts/migration.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,12 @@ fi
3232

3333
printf "Generating migration boilerplate for patch level $NEW_LEVEL..."
3434

35-
echo "SET NAMES utf8mb4 COLLATE utf8mb4_bin;" > "$FWD_SCHEMA"
35+
echo "SET NAMES utf8mb4 COLLATE utf8mb4_bin;\n" > "$FWD_SCHEMA"
3636
echo "-- TODO: Implement your forward migration here\n" >> "$FWD_SCHEMA"
3737
echo "UPDATE dbMetadata SET value = '$NEW_LEVEL' WHERE name = 'schema-patch-level';\n" >> "$FWD_SCHEMA"
3838

3939
echo '-- -- TODO: Implement your *commented-out* reverse migration here\n' > "$REV_SCHEMA"
40+
echo "-- SET NAMES utf8mb4 COLLATE utf8mb4_bin;\n" >> "$REV_SCHEMA"
4041
echo "-- UPDATE dbMetadata SET value = '$PREV_LEVEL' WHERE name = 'schema-patch-level';\n" >> "$REV_SCHEMA"
4142

4243
sed -i '' "s/^module.exports.level = $PREV_LEVEL\$/module.exports.level = $NEW_LEVEL/" $PATCH_SRC

0 commit comments

Comments
 (0)