Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Migrating your Database with Phinx

Migrating your Database with Phinx

Learn how to use the Phinx database migration tool with it's creator Rob Morgan. This presentation will cover the basic concepts of Phinx including adding it to a project, creating new migrations and then executing them. You will also be exposed to more advanced features of Phinx and everyday use cases.

Rob Morgan

May 13, 2015
Tweet

Other Decks in Programming

Transcript

  1. What is Phinx? “Phinx is a tool that allows you

    to migrate your database schema over time”
  2. Brief History • Released in 2012 under the MIT License

    • 32 Releases to Date • 350,000 Downloads and 70+ Contributors • Used in CakePHP 3.0.0 • Built on top of Symfony Components (and only 3)
  3. Rob Morgan • Writing PHP for almost 15 years •

    Twitter: @_rjm_ • Email: [email protected] • http://robmorgan.id.au
  4. Here’s why: • Database Migration is not a new thing

    • Convenient way to change your schema over time • Write migrations using PHP code • Migrate up and down • Support (and tests!) for MySQL, PostgreSQL, SQLite and Microsoft SQL Server • Read: http://en.wikipedia.org/wiki/Schema_migration
  5. Today’s Agenda • Adding Phinx to your project • Writing

    Migrations • Executing Migrations • The State of Your Database • Rolling Back
  6. Cheers! • Rob Morgan (@_rjm_) • https://phinx.org • http://robmorgan.id.au •

    Slides will be on: https://joind.in/14273 • https://github.com/robmorgan/phinx-screencast