Skip to content

Commit

Permalink
Merge pull request #6 from greensmith/development
Browse files Browse the repository at this point in the history
try FK in loop
  • Loading branch information
greensmith authored Sep 21, 2023
2 parents 39223be + 4dac9b3 commit 4b17ddb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ drop_db_tables() {
# loop through table names and truncate each table
for table in $tables; do
echo droping table $table
mysql -h $TARGET_DB_HOST -u $TARGET_DB_USER -p$TARGET_DB_PASSWORD $TARGET_DB_NAME -e "drop table $table"
mysql -h $TARGET_DB_HOST -u $TARGET_DB_USER -p$TARGET_DB_PASSWORD $TARGET_DB_NAME -e "SET FOREIGN_KEY_CHECKS = 0; DROP TABLE $table"
done
# enable foreign key checks
mysql -h $TARGET_DB_HOST -u $TARGET_DB_USER -p$TARGET_DB_PASSWORD $TARGET_DB_NAME -e "SET FOREIGN_KEY_CHECKS = 1;"
Expand Down

0 comments on commit 4b17ddb

Please sign in to comment.