Skip to content

A command line PHP script to generate a phinx initial migration (only structure) from an existing MySQL database

License

Notifications You must be signed in to change notification settings

C0DE8/mysql-2-phinx-initializer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

MySQL2PhinxInitializer

A command line PHP script to generate a phinx initial migration from an existing MySQL database.

Usage

Usage: php mysql2phinx-initializer.php [options]
 -d | --database=<database>
 -u | --user=<user>
 -p | --pass=<password>
 -h | --host=<host> (optional)
 -t | --port=<port> (optional)
 -n | --name=<migration classname> (optional) [default: InitialMigration]
 -s | --skip=<tables to be skipped> (optional) [default: phinxlog; comma separated]
 -f | --format=<format of file prefix> (optional) [default: "YmdHis"; php date format; result in YYYYMMDDHHMMSS)
 -o | --output=<output file> (optional) [default: {format_prefix}_initial_migration.php]

Example:
$ php mysql2phinx-initializer.php -d="mydatabase" -u="username" -p="secure-password" -h"=1.2.3.4" -t="3307" -n="InitialMigration" -f="YmdHis" -o="initial_migration.php"

Will create an initial migration class in the file YYYYMMDDHHMMSS_initial_migration.php for all tables in the database passed. The classname is by default "InitialMigration". (configurable)

About

A command line PHP script to generate a phinx initial migration (only structure) from an existing MySQL database

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages