A tool to compare two MySQL database schemas and highlight differences. Useful for database migrations, version control, and ensuring consistency between environments.
- Compare table structures, indexes, and constraints
- Generate reports of schema differences
npm install
Copy the example environment file and fill in your MySQL connection details.
cp .env.example .env
Edit the .env
file to provide the necessary configuration.
npm run start
This will compare the schemas and generate SQL queries in the output
folder.
npm run apply
This will execute the generated queries on the target database.
Make sure your MySQL connection details are configured as required by the project.
Optional flags for npm run apply
:
--include-indexes
: Also execute queries that update indexes.
Example:
npm run apply -- --include-indexes
This will apply both schema and index changes to the target database.
Contributions are welcome! To contribute:
- Fork this repository.
- Create a new branch for your feature or bugfix.
- Make your changes and add tests if applicable.
- Submit a pull request with a clear description of your changes.
Please follow the existing code style and conventions.