[SQL] How to compare two SQL schema with sqlfairy
First of all, install sqlfairy on your machine if you haven’t done yet, then simply give in input to the program the path to the SQL schemas:
sqlt-diff -d -c schema_to_update.sql=MySQL updated_schema.sql=MySQL 2>/dev/null|grep -v "DROP TABLE"
- -d: prints debug info;
- -c: case insensitive;
- 2>/dev/null: don’t print warning and error messages so you can grep results data;
- grep -v “word”: don’t print lines that match the pattern specified between quotes