Created
April 20, 2015 14:47
-
-
Save KenshoFujisaki/8d74e62a9f380a363f76 to your computer and use it in GitHub Desktop.
DBマイグレーション状況確認(マイグレーション済/未のファイル取得)
This file contains 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
# cd [RAILS_ROOT] | |
db_name="db_name" | |
db_user="db_user" | |
db_pass="db_pass" | |
diff -U10000 \ | |
<(ls db/migrate/ | sort | ruby -nle 'print $_.split("_").first') \ | |
<(mysql -u${db_user} -p${db_pass} -D${db_name} -e"select * from schema_migrations;") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment