Download the PHP package odan/phinx-migrations-generator without Composer
On this page you can find all versions of the php package odan/phinx-migrations-generator. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download odan/phinx-migrations-generator
More information about odan/phinx-migrations-generator
Files in odan/phinx-migrations-generator
Package phinx-migrations-generator
Short Description Migration generator for Phinx
License MIT
Homepage https://github.com/odan/phinx-migrations-generator
Informations about the package phinx-migrations-generator
Phinx migrations generator
Generates Phinx migrations by comparing your current database with your schema information.
Requirements
- PHP 8.1, 8.2
Features
- Framework independent
- DBMS: MySQL 5.7+, MySQL 8, MariaDB (partially supported)
- Initial schema
- Schema difference
- Database: character set, collation
- Tables: create, update, remove, engine, comment, character set, collation
- Columns: create, update, remove
- Indexes: create, remove
- Foreign keys: create, remove, constraint name
Install
Via Composer
Usage
Generating migrations
The first run generates an initial schema and a migration class.
The file schema.php
contains the previous database schema and is compared with the current schema.
Based on the difference, a Phinx migration class is generated.
When the generate
command is executed again, only the difference to the last schema is generated.
Parameters
Parameter | Values | Default | Description |
---|---|---|---|
--name | string | The class name. | |
--overwrite | bool | Overwrite schema.php file. | |
--path |
string | (from phinx) | Specify the path in which to generate this migration. |
--environment or -e | string | (from phinx) | The target environment. |
--configuration or -c | string | (from phinx) | The configuration file e.g. config/phinx.php |
Running migrations
The Phinx migrate command runs all the available migrations.
Configuration
The phinx-migrations-generator uses the configuration of phinx.
Migration configuration
Parameter | Values | Default | Description |
---|---|---|---|
foreign_keys | bool | false | Enable or disable foreign key migrations. |
default_migration_prefix | string | null | If specified, in the absence of the name parameter, the default migration name will be offered with this prefix and a random hash at the end. |
generate_migration_name | bool | false | If enabled, a random migration name will be generated. The user will not be prompted for a migration name anymore. The parameter default_migration_prefix must be specified. The --name parameter can overwrite this setting. |
mark_generated_migration | bool | true | Enable or disable marking the migration as applied after creation. |
migration_base_class | string | \Phinx\Migration\AbstractMigration |
Sets up base class of created migration. |
schema_file | string | %%PHINX_CONFIG_DIR%%/db/ migrations/schema.php |
Specifies the location for saving the schema file. |
Example configuration
Filename: phinx.php
(in your project root directory)
Testing
Contributing
Please see CODE_OF_CONDUCT for details.
License
The MIT License (MIT). Please see License File for more information.
All versions of phinx-migrations-generator with dependencies
ext-json Version *
ext-pdo Version *
riimu/kit-phpencoder Version ^2.4
robmorgan/phinx Version ^0.15.2 | ^0.16