2017 © Pedro Peláez
 

library puja-migration

Puja-Migration is a database migration php library, supports both file sql and php

image

jinnguyen/puja-migration

Puja-Migration is a database migration php library, supports both file sql and php

  • Saturday, January 21, 2017
  • by jinnguyen
  • Repository
  • 1 Watchers
  • 0 Stars
  • 8 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

puja-migration

Puja-Migration is a database migration php library, supports both file sql and php, (*1)

Install:, (*2)

composer require jinnguyen/puja-migration

Usage:, (*3)

include '/path/to/vendor/autoload.php';
use Puja\Migration\Migrate;

Example:, (*4)

// Configure DB
use Puja\Db\Adapter;

new \Puja\Db\Adapter(array(
    'write_adapter_name' => 'master',
    'adapters' => array(
        'default' => array(
            'host' => 'localhost',
            'username' => 'root',
            'password' => '123',
            'dbname' => 'fwcms',
            'charset' => 'utf8',
        ),
        'master' => array(
            'host' => 'localhost',
            'username' => 'root',
            'password' => '123',
            'dbname' => 'fwcms',
            'charset' => 'utf8',
        )
    )
));

// configure migration
new \Puja\Migration\Migrate(array(
    'table' => 'puja_migration', // db table name that store migration tracking information
    'dir' => __DIR__ . '/migrations/', // the folder store migration files
    'create_table' => true, // if true, the query "CREATE TABLE <table>" will run, should enable at the first time and disable from second time.
));

Note*, (*5)

1. THE ORDER OF MIGRATION FILES ARE VERY IMPORTANT, (*6)


So pls follow the file name conversation: - The name should begin by a numeric, e.g: 0-launched-project.sql, 1-update.sql, 2-data-fix.php,....
, (*7)

As above example,  0-launched-project.sql is  run first then 1-update.sql then 2-data-fix.php

<, (*8)

p>2. The php files are not show log message as default, if you want to show the log message you can use $this->addStament('Message'); // check in demo/3.php, (*9)

The Versions

21/01 2017

dev-master

9999999-dev

Puja-Migration is a database migration php library, supports both file sql and php

  Sources   Download

Apache License 2.0

The Requires

 

by Jin Nguyen

migration database migration puja php migration

21/01 2017

v1.1.0

1.1.0.0

Puja-Migration is a database migration php library, supports both file sql and php

  Sources   Download

Apache License 2.0

The Requires

 

by Jin Nguyen

migration database migration puja php migration