2017 © Pedro Peláez
 

library migration

Migration generator for Phinx

image

mike-sorokin/migration

Migration generator for Phinx

  • Tuesday, September 20, 2016
  • by MikeSorokin
  • Repository
  • 0 Watchers
  • 0 Stars
  • 10 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 16 Forks
  • 0 Open issues
  • 11 Versions
  • 0 % Grown

The README.md

Migrations

Migrations Builder for Phinx., (*1)

Currently Phinx (a migration library) cannot generate migrations automatically. Phinx "only" generates a empty class with up and down functions. You still have to write the migration manually., (*2)

In reality, you should rarely need to write migrations manually, as the migrations library "should" generate migration classes automatically by comparing your schema mapping information (i.e. what your database should look like) with your actual current database structure., (*3)

Screenshot, (*4)

Generated migration, (*5)

Screenshot 2, (*6)

THIS IS A DEVELOPMENT PREVIEW - DO NOT USE IT IN PRODUCTION!, (*7)

Features

  • Framework independent
  • DBMS: MySQL
  • Database: character set, collation
  • Tables: create, update, remove, engine, comment, character set, collation
  • Columns: create, update, remove
  • Indexes: create, remove
  • Foreign keys (experimental): create, remove

Not supported

  • MySQL [double] is not supported by phinx https://github.com/robmorgan/phinx/issues/498
  • MySQL [year] is not supported by phinx. https://github.com/robmorgan/phinx/pull/704 | https://github.com/robmorgan/phinx/issues/551
  • MySQL [bit] is not supported by phinx. https://github.com/robmorgan/phinx/pull/778
  • MySQL enum values with special characters: https://github.com/robmorgan/phinx/issues/887
  • Migration of contraint names (currently only auto generated): https://github.com/robmorgan/phinx/issues/823
  • MySQL comments with special characters.

Installation

git clone https://github.com/odan/migrations.git
cd migrations
composer install --no-dev

Integration

composer require odan/migrations

Configuration

  • Default configuration file: migrations-config.php

Example:, (*8)

<?php

return array(
    'dsn' => 'mysql:host=127.0.0.1;dbname=test',
    'username' => 'root',
    'password' => '',
    'options' => array(
        PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8',
    ),
    'schema_file' => __DIR__ . '/schema.php',
    'migration_path' => __DIR__
);
Name Type Default Description
dsn string Data source name (mysql:host=127.0.0.1;dbname=test)
username string Database username
password string Database password
options array Database options
schema_file string schema.php Database schema file (schema.php or schema.json)
migration_path string Output directory for migration files

Usage

Generating migrations

cd bin
php migrations.php migration:generate

Load custom config file

php migrations.php migration:generate --config=myconfig.php

The Versions

20/09 2016

dev-master

9999999-dev http://github.com/MikeSorokin/migrations

Migration generator for Phinx

  Sources   Download

MIT

The Requires

 

The Development Requires

database migration phinx

20/09 2016

0.2.0

0.2.0.0 http://github.com/odan/migration

Migration generator for Phinx

  Sources   Download

MIT

The Requires

 

The Development Requires

database migration phinx

17/09 2016

0.1.5

0.1.5.0 http://github.com/MikeSorokin/migrations

Migration generator for Phinx

  Sources   Download

MIT

The Requires

 

The Development Requires

database migration phinx

16/09 2016

dev-basic_export

dev-basic_export http://github.com/odan/migration

Migration generator for Phinx

  Sources   Download

MIT

The Requires

 

The Development Requires

database migration phinx

16/09 2016

0.1.4

0.1.4.0 http://github.com/MikeSorokin/migrations

Migration generator for Phinx

  Sources   Download

MIT

The Requires

 

The Development Requires

database migration phinx

16/09 2016

0.1.3

0.1.3.0 http://github.com/MikeSorokin/migrations

Migration generator for Phinx

  Sources   Download

MIT

The Requires

 

The Development Requires

database migration phinx

14/09 2016

0.1.2

0.1.2.0 http://github.com/MikeSorokin/migrations

Migration generator for Phinx

  Sources   Download

MIT

The Requires

 

The Development Requires

database migration phinx

14/09 2016

0.1.1

0.1.1.0 http://github.com/MikeSorokin/migrations

Migration generator for Phinx

  Sources   Download

MIT

The Requires

 

The Development Requires

database migration phinx

17/07 2016

0.1.0

0.1.0.0 http://github.com/odan/migration

Migration generator for Phinx

  Sources   Download

MIT

The Requires

 

The Development Requires

database migration phinx

11/07 2016

0.0.2

0.0.2.0 http://github.com/odan/migration

Migration generator for Phinx

  Sources   Download

MIT

The Requires

 

The Development Requires

database migration phinx

09/07 2016

0.0.1

0.0.1.0 http://github.com/odan/migration

Migration generator

  Sources   Download

MIT

The Requires

 

The Development Requires

database migration phinx