2017 © Pedro Peláez
 

library dbup

simple migration tool with PDO

image

brtriver/dbup

simple migration tool with PDO

  • Tuesday, March 31, 2015
  • by brtriver
  • Repository
  • 4 Watchers
  • 50 Stars
  • 514 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 17 Forks
  • 4 Open issues
  • 9 Versions
  • 0 % Grown

The README.md

Dbup, a simple PHP migration tool

Build Status, (*1)

Dbup is a simple migration tool for PHP., (*2)

  • You have only to download [dbup.phar][1].
  • Dbup has only up command. Dbup does not have down command.
  • Dbup use just a plain old sql, so you don't have to learn ORM nor DSL. You write sql file and just call up command.
  • Dbup use just PDO class to migrate.
  • Dbup doesn't need the table in a database to migrate.

Applied migration sql files are copied to .dbup/applied directory. If a same file exists both sql and .dbup/applied directory, up command ignores this sql file., (*3)

simple...simple..simple.., (*4)

Requirements

Dbup works with PHP 5.4.0 or later., (*5)

Install

Installing Dbup is as easy as it can get. Download the [dbup.phar][1] and run init, then .dbup and sql directory are created and set a sample properties.ini file and sqlfile., (*6)

php dbup.phar init

change the database config in .dbup/properties.ini., (*7)

[pdo]
dsn = "mysql:dbname=testdatabase;host=localhost"
user = "testuser"
password = "testpassword"

see also http://www.php.net/manual/en/pdo.construct.php, (*8)

You can also assign environment variables to your database configuration file. Dbup reads DBUP_ prefixed environment variables if the names are placed in .ini file with surrounded '%%'. For example, user parameter of the following ini will be replaced to a value of the environment variable DBUP_USERNAME if it is defined., (*9)

[pdo]
user = "%%DBUP_USERNAME%%"

Naming

You have to name a sql file like below:, (*10)

V[version_number]__[description].sql

V is prefix. the separator is __ (two underscores). Suffix is .sql, (*11)

Usage

List all commands., (*12)

php dbup.phar

You have to write a sql file to sql directory., (*13)

Show status., (*14)

php dbup.phar status

dbup migration status
================================================================================
          Applied At | migration sql file
--------------------------------------------------------------------------------
 2013-05-01 22:37:32 | V1__sample_select.sql
        appending... | V2__sample.sql
        appending... | V3__sample.sql
        appending... | V20__sample.sql
        appending... | V100__sample.sql

Up database after writing a new sql file., (*15)

php dbup.phar up

that's all., (*16)

License

Dbup is licensed under the MIT license., (*17)

The Versions

31/03 2015

dev-master

9999999-dev http://1ms.jp/

simple migration tool with PDO

  Sources   Download

MIT

The Requires

 

The Development Requires

database migration

20/12 2014

dev-swtich-to-box

dev-swtich-to-box http://1ms.jp/

simple migration tool with PDO

  Sources   Download

MIT

The Requires

 

database migration

08/05 2013

0.4.x-dev

0.4.9999999.9999999-dev http://1ms.jp/

simple migration tool with PDO

  Sources   Download

MIT

The Requires

 

database migration

08/05 2013

v0.4

0.4.0.0 http://1ms.jp/

simple migration tool with PDO

  Sources   Download

MIT

The Requires

 

database migration

03/05 2013

0.3.x-dev

0.3.9999999.9999999-dev http://1ms.jp/

simple migration tool with PDO

  Sources   Download

MIT

The Requires

 

database migration

03/05 2013

v0.3

0.3.0.0 http://1ms.jp/

simple migration tool with PDO

  Sources   Download

MIT

The Requires

 

database migration

01/05 2013

v0.2

0.2.0.0 http://1ms.jp/

simple migration tool with PDO

  Sources   Download

MIT

The Requires

 

database migration

01/05 2013

v0.1

0.1.0.0 http://1ms.jp/

simple migration tool with PDO

  Sources   Download

MIT

The Requires

 

database migration