A database migrations engine for the Yii framework. It comes in the form of an extension which can be dropped into any existing Yii framework application.
It relies on the database abstraction layer of the Yii framework to talk to the database engine.
It’s largely inspired on the migrations functionality of the Ruby on Rails framework.
Resources ¶
Documentation ¶
Requirements ¶
- Yii 1.0 or above
Installation ¶
- Extract the release file under
protected/extensions
- Follow the instructions in the README.textile file to install the extension.
Change Log ¶
November 14, 2009 (version 1.1) ¶
- Fixed a bug where the migrations would fail with Yii version 1.0.10 and 1.1
- Introduced a new syntax to create tables which is a lot more concise
- Added the migrate create command
- Beautified the output from the migrate command
- Cleaned out the output of the list command
- Added support for passing on parameters in the execute method of a migration
- Added the redo command so that the last migration can be re-applied easily
- When running migrations, a constant called YII_MIGRATING is now defined
- The migration engine now show the directory in which the migrations are created
- Replaced the deprecated split function with the explode function to make sure it works fine with PHP 5.3
June 17, 2009 (version 1.0a1) ¶
- The migrations are now performed inside a database transaction
- Big code cleanup by adding all needed docstrings
- When renaming a column, the data type is retained
- You can now migrate up, down or to a specific version
- You can now list the status of all migrations
June 15, 2009 (version 0.1a1) ¶
- Initial announcement.
Exactly what I was looking for
Thank you for this great extension. This prevented me from learning java and defining thousands of misterious xml definition files to use "ant".
For using yii-dbmigration under 1.1.1 I had to change a singe line in the CDbMigrationEngine.php in line 118
from
// Check if a database connection was configured try { Yii::app()->db; } catch (Exception $e) { throw new CDbMigrationEngineException( 'Database configuration is missing in your configuration file.' ); }
to
// Check if a database connection was configured if (!isset(Yii::app()->db)) { throw new CDbMigrationEngineException( 'Database configuration is missing in your configuration file.' ); }
Hint
This extension seems to be a part of Yii 1.1.6 now!?
If you have any questions, please ask in the forum instead.
Signup or Login in order to comment.