Browse Source

Few fixes in scripts/add_migration.sh

master
Alex Mikhalev 4 years ago
parent
commit
aed95202ce
  1. 5
      scripts/add_migration.sh

5
scripts/add_migration.sh

@ -30,7 +30,7 @@ popd >/dev/null @@ -30,7 +30,7 @@ popd >/dev/null
# echo "${SQL_FILES[@]}"
# Remove anything after first numbers
MIGRATION_NUMBERS=("${SQL_FILES[@]%%*([!0-9])}")
MIGRATION_NUMBERS=("${SQL_FILES[@]%%-*.sql}")
# echo "MIGRATION_NUMBERS: "
# echo "${MIGRATION_NUMBERS[@]}"
@ -61,4 +61,5 @@ LINE_TO_INSERT=" migs.add(include_file_migration!($NEXT_MIGRATION, \"$NEXT_MI @@ -61,4 +61,5 @@ LINE_TO_INSERT=" migs.add(include_file_migration!($NEXT_MIGRATION, \"$NEXT_MI
MIGRATIONS_RS="$PROJECT_ROOT/src/db.rs"
echo "Inserting line in $MIGRATIONS_RS"
sed -i "/INSERT MIGRATION ABOVE/i $LINE_TO_INSERT" "$MIGRATIONS_RS"
sed -i "/INSERT MIGRATION ABOVE/i \
$LINE_TO_INSERT" "$MIGRATIONS_RS"

Loading…
Cancel
Save