Download the PHP package mathsgod/mysql-schema-migrate without Composer
On this page you can find all versions of the php package mathsgod/mysql-schema-migrate. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download mathsgod/mysql-schema-migrate
More information about mathsgod/mysql-schema-migrate
Files in mathsgod/mysql-schema-migrate
Download mathsgod/mysql-schema-migrate
More information about mathsgod/mysql-schema-migrate
Files in mathsgod/mysql-schema-migrate
Vendor mathsgod
Package mysql-schema-migrate
Short Description Export MySQL database schema to JSON format
License MIT
Package mysql-schema-migrate
Short Description Export MySQL database schema to JSON format
License MIT
Please rate this library. Is it a good library?
Informations about the package mysql-schema-migrate
MySQL Schema Migrate
Export and import MySQL database schema to/from JSON format.
Features
- Export complete MySQL database schema to JSON format
- Import schema from JSON with intelligent diff detection
- Supports:
- Tables (with columns, primary keys, unique keys, foreign keys, indexes)
- Views
- Triggers
- Functions
- Procedures
- Events
- Smart schema diff: uses
ALTER TABLEfor existing tables instead of recreating - Dry-run mode to preview SQL without executing
- CLI tool with easy-to-use options
- Can be used as a PHP library
Requirements
- PHP >= 8.1
- PDO extension
- PDO MySQL extension
- JSON extension
Installation
Via Composer
Global Installation
Usage
Export Command
Export Options
| Option | Short | Description | Default |
|---|---|---|---|
--host |
-H |
MySQL host | localhost |
--port |
-P |
MySQL port | 3306 |
--database |
-d |
Database name | (required) |
--username |
-u |
MySQL username | (required) |
--password |
-p |
MySQL password | (empty) |
--charset |
-c |
Connection charset | utf8mb4 |
--output |
-o |
Output file path | stdout |
Import Command
Import Options
| Option | Short | Description | Default |
|---|---|---|---|
--host |
-H |
MySQL host | localhost |
--port |
-P |
MySQL port | 3306 |
--database |
-d |
Database name | (required) |
--username |
-u |
MySQL username | (required) |
--password |
-p |
MySQL password | (empty) |
--charset |
-c |
Connection charset | utf8mb4 |
--dry-run |
Only generate SQL without executing | false |
|
--output-file |
-o |
Output SQL to file (use with --dry-run) | |
--allow-drop |
Allow dropping columns, tables, and objects | false |
|
--keep-definer |
Keep original DEFINER | false |
|
--only |
Only process specific types (comma-separated) | all |
Import Behavior
- Tables: Uses
ALTER TABLEfor existing tables (ADD/MODIFY/DROP COLUMN, index changes) - Views: Uses
CREATE OR REPLACE VIEW - Functions/Procedures/Triggers/Events: Uses
DROP IF EXISTS+CREATE - DEFINER: Reset to
CURRENT_USERby default (use--keep-definerto preserve) - Foreign Keys: Handled separately to avoid dependency issues
As a Library
Output Format
The exported JSON contains the following structure:
License
MIT License. See LICENSE for more information.
Author
Raymond Chong ([email protected])
All versions of mysql-schema-migrate with dependencies
PHP Build Version
Package Version
Requires
php Version
>=8.1
ext-pdo Version *
ext-pdo_mysql Version *
ext-json Version *
symfony/console Version ^6.0|^7.0|^8.0
ext-pdo Version *
ext-pdo_mysql Version *
ext-json Version *
symfony/console Version ^6.0|^7.0|^8.0
The package mathsgod/mysql-schema-migrate contains the following files
Loading the files please wait ...