Skip to content

zuker/phinx

 
 

Repository files navigation

Phinx: Simple PHP Database Migrations

Phinx makes it ridiculousy easy to manage the database migrations for your PHP app. In less than 5 minutes you can install Phinx and create your first database migration. Phinx is just about migrations without all the bloat of a database ORM system or framework.

Phinx lets you

  • Write database migrations using database agnostic PHP code.
  • Migrate up and down.
  • Migrate on deployment.
  • Get going in less than 5 minutes.
  • Stop worrying about the state of your database.
  • Take advantage of SCM features such as branching.

Compared with other tools, Phinx does not…

  • Write log files. The screen is better.
  • Try to do too much. Migrations only.
  • Have unreadable source code. We aim to be transparent.
  • Rely on a framework. Phinx is independent. Use it with any app.
  • Support anything other than MySQL. Feel free to fork and contribute if you desire.

Install & Run

The fastest way to install Phinx in your project is using Composer (http://getcomposer.org/).

  1. Install composer:

    curl -s https://getcomposer.org/installer | php
    
  2. Add Phinx as a dependency to your composer.json file:

    {
        "require": {
            "robmorgan/phinx": "*"
        }
    }
  3. Install Phinx:

    php composer.phar install
    
  4. Execute Phinx:

    php vendor/bin/phinx
    

Documentation

Check out http://docs.phinx.org for the comprehensive documentation.

Contributing

Start by forking Phinx on GitHub: https://github.com/robmorgan/phinx

Next setup your environment for development:

  • curl -s https://getcomposer.org/installer | php
  • php composer.phar install --dev

News & Updates

Follow Rob (@rjm) on Twitter to stay to date (http://twitter.com/_rjm_)

Misc

Version History

0.1.6 (Sunday, 9th December 2012)

  • Added foreign key support
  • Removed PEAR support
  • Support for auto_increment on custom id columns
  • Bugfix for column default value 0
  • Documentation improvements

0.1.5 (Sunday, 4th November 2012)

  • Added a test command
  • Added transactions for adapters that support it
  • Changing the Table API to use pending column methods
  • Fixed a bug when defining multiple indexes on a table

0.1.4 (Sunday, 21st October 2012)

  • Documentation Improvements

0.1.3 (Saturday, 20th October 2012)

  • Fixed broken composer support

0.1.2 (Saturday, 20th October 2012)

  • Added composer support
  • Now forces migrations to be in CamelCase format
  • Now specifies the database name when migrating
  • Creates the internal log table using its API instead of raw SQL

0.1.1 (Wednesday, 13th June 2012)

  • First point release. Ready for limited production use.

0.1.0 (Friday, 13th January 2012)

  • Initial public release.

License

(The MIT license)

Copyright (c) 2012 Rob Morgan

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

About

PHP Database Migrations for Everyone

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Languages

  • PHP 95.0%
  • Python 4.0%
  • Perl 1.0%