Skip to content

Instantly share code, notes, and snippets.

@PululuK
Last active June 17, 2021 15:04
Show Gist options
  • Save PululuK/396a9762b660be1bf1b1c98bd81a76c7 to your computer and use it in GitHub Desktop.
Save PululuK/396a9762b660be1bf1b1c98bd81a76c7 to your computer and use it in GitHub Desktop.
#!/bin/bash
sed -i -r 's/(^_TABLE_PREFIX_\w+)/DROP TABLE migration_database_name.\1 ; CREATE TABLE migration_database_name.\1 LIKE upgrade_database_name.\1; INSERT INTO migration_database_name.\1 SELECT * FROM upgrade_database_name.\1;/g' migration-file-csv.sql
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment