Is there a PHP equivalent of Rails migrations? [closed]
Asked Answered
P

5

20

Is there a PHP equivalent of Rails migrations?

Looking for a good solution for configuring schema changes locally and then automatically bumping them to the server without losing data.

Proliferation answered 24/7, 2010 at 9:37 Comment(3)
PHP isn't a web framework like Rails; it's a language like Ruby and thus doesn't include an ORM. So, you can't really ask for PHP features that match Rails features.Valdovinos
Actually @flexxy is correct. Comparing PHP to Rails is like comparing apples to oranges. The comparison should be PHP -> Ruby, Zend Framework -> Rails. For the record I use Doctrine migrations.Toor
Wow, I'm surprised at how rude your comment is. The fact is that PHP is not equivalent to Rails, it's equivalent to Ruby.Valdovinos
C
13

Ruckusing Migrations is a "Database Migrations" framework for PHP 5.2+.

The framework is modeled after ActiveRecord::Migrations from Ruby on Rails.

Concha answered 24/7, 2010 at 9:41 Comment(2)
Hi Sagi! just to throw two other solutions into the pool: github.com/apinstein/mp (has upRollback() and downRollback()) github.com/davejkiger/mysql-php-migrations Does someone know how they compare to ruckusing? Additionally what I would think usefeul for any "SQL-diff" based migrations-scenario are some sort of "keyframes" in the form of full structure dumps once in a while along the way, just to make sure mistakes during up() and down() dont add up when migrating in larger steps. If you have spotted those in the wild I'd be thankfull to know ;)Yusuk
thanks, looks good. I will try one of them and update.Concha
S
21

My project http://github.com/robmorgan/phinx is a small lightweight migration engine without any bloat or big framework dependency. It borrows the best parts from several tools including ActiveRecord::Migration.

Santanasantayana answered 20/10, 2012 at 6:34 Comment(1)
It has great documentation too: docs.phinx.org/en/latestBerwick
C
13

Ruckusing Migrations is a "Database Migrations" framework for PHP 5.2+.

The framework is modeled after ActiveRecord::Migrations from Ruby on Rails.

Concha answered 24/7, 2010 at 9:41 Comment(2)
Hi Sagi! just to throw two other solutions into the pool: github.com/apinstein/mp (has upRollback() and downRollback()) github.com/davejkiger/mysql-php-migrations Does someone know how they compare to ruckusing? Additionally what I would think usefeul for any "SQL-diff" based migrations-scenario are some sort of "keyframes" in the form of full structure dumps once in a while along the way, just to make sure mistakes during up() and down() dont add up when migrating in larger steps. If you have spotted those in the wild I'd be thankfull to know ;)Yusuk
thanks, looks good. I will try one of them and update.Concha
T
6

Doctrine, an ORM and DBAL, has got migrations.

Timi answered 24/7, 2010 at 9:40 Comment(1)
And it's going to be deprecated for being unmaintained: doctrine-project.org/jira/browse/DBAL-602Jape
C
3

http://github.com/nickinuse/php-migrations is built on RoRs approach

Camembert answered 30/8, 2011 at 21:59 Comment(0)
S
1

Just to throw my hat into the ring, Ladder is a simple, pure PHP migrations system.

Stoneblind answered 5/5, 2013 at 0:26 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.