Download the PHP package jinnguyen/puja-migration without Composer
On this page you can find all versions of the php package jinnguyen/puja-migration. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download jinnguyen/puja-migration
More information about jinnguyen/puja-migration
Files in jinnguyen/puja-migration
Package puja-migration
Short Description Puja-Migration is a database migration php library, supports both file sql and php
License Apache License 2.0
Informations about the package puja-migration
puja-migration
Puja-Migration is a database migration php library, supports both file sql and php
Install:
composer require jinnguyen/puja-migration
Usage:
include '/path/to/vendor/autoload.php'; use Puja\Migration\Migrate;
Example:
// 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*
1. THE ORDER OF MIGRATION FILES ARE VERY IMPORTANT
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,....
As above example, 0-launched-project.sql is run first then 1-update.sql then 2-data-fix.php
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
All versions of puja-migration with dependencies
jinnguyen/puja-stdlib Version *
jinnguyen/puja-db Version *