Download the PHP package ignitekit/wp-migrations without Composer
On this page you can find all versions of the php package ignitekit/wp-migrations. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download ignitekit/wp-migrations
More information about ignitekit/wp-migrations
Files in ignitekit/wp-migrations
Package wp-migrations
Short Description Laravel inspired database migrations for WordPress
License MIT
Informations about the package wp-migrations
WP Migrations
Migrations for WordPress inspired by Laravel.
The package can be used in different plugins in the same time if you create your own BaseMigration
in each plugin.
Follow the steps before to properly setup the package.
Instructions
1.) Create base class called BaseMigration
2.) Create migrations table setup migration. eg SetupMigrations
3.) You can now create your own custom migrations. In this case create the fruits
table.
4.) Finally, register those migrations
Creating columns
You can create a lot of different column types with Table Migrations. Here's a list:
Command | Description |
---|---|
$table->bigInteger('votes'); | BIGINT equivalent for the database. |
$table->binary('data'); | BLOB equivalent for the database. |
$table->boolean('confirmed'); | BOOLEAN equivalent for the database. |
$table->char('name', 4); | CHAR equivalent with a length. |
$table->date('created_at'); | DATE equivalent for the database. |
$table->dateTime('created_at'); | DATETIME equivalent for the database. |
$table->decimal('amount', 5, 2); | DECIMAL equivalent with a precision and scale. |
$table->double('column', 15, 8); | DOUBLE equivalent with precision, 15 digits in total and 8 after the decimal point. |
$table->float('amount', 8, 2); | FLOAT equivalent for the database, 8 digits in total and 2 after the decimal point. |
$table->increments('id'); | Incrementing ID (primary key) using a "UNSIGNED INTEGER" equivalent. |
$table->bigIncrements('id'); | Incrementing ID (primary key) using a "UNSIGNED BIGINT" equivalent. |
$table->smallIncrements('id'); | Incrementing ID (primary key) using a "UNSIGNED SMALLINT" equivalent. |
$table->mediumIncrements('id'); | Incrementing ID (primary key) using a "UNSIGNED MEDIUMINT" equivalent. |
$table->integer('votes'); | INTEGER equivalent for the database. |
$table->longText('description'); | LONGTEXT equivalent for the database. |
$table->mediumInteger('numbers'); | MEDIUMINT equivalent for the database. |
$table->mediumText('description'); | MEDIUMTEXT equivalent for the database. |
$table->smallInteger('votes'); | SMALLINT equivalent for the database. |
$table->string('email'); | VARCHAR equivalent column. |
$table->string('name', 100); | VARCHAR equivalent with a length. |
$table->text('description'); | TEXT equivalent for the database. |
$table->time('sunrise'); | TIME equivalent for the database. |
$table->tinyInteger('numbers'); | TINYINT equivalent for the database. |
$table->timestamp('added_on'); | TIMESTAMP equivalent for the database. |
Contributions
If you are interested in contributing to the project. Feel free to submit your issue or pull request.