https://github.com/DBDiff/DBDiff
- Create a .dbdiff file in project root directory with the connection settings for 2 servers. Add to "tablesToIgnore" a list of tables and views that should be ignored on comparisson.
.dbdiff
server1:
user: root
password:
port: 3306
host: localhost
server2:
user: AzureDiamond
password: hunter2
port: 3306
host: 192.168.1.1
template: templates/db-migrate.tmpl
type: schema
include: up
nocomments: false
tablesToIgnore:
- vw_view1
- vw_view2
- Create a db-migrate.tmpl in templates directory
-- UP
{{ $up }}
-- END UP
-- DOWN
{{ $down }}
-- END DOWN
- Execute the command below to generate the database diff file migration.sql
$ ./dbdiff server1.yourdatabase:server2.yourdatabase