News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Rob Allen's Blog:
Akrabat_Db_Schema_Manager Zend Framework database migrations
March 29, 2010 @ 10:16:41

Rob Allen has a new post to his blog today that looks at database migrations in Zend Framework applications. He introduces a component of his own - Akrabat_Db_Schema_Manager - to handle the migrations.

It is intended that any time you want to make a change to your database schema (add columns, tables, indexes, etc), then you create a new migration file. [...] The migration file contains a class that extends Akrabat_Db_Schema_AbstractChange and must contain two methods: up() and down(). It follows that up() is called when implementing the changes in this migration and down() is called to put the database back where it was if the change is backed out.

He includes an example of a migration file, one that defines the "up" method to create a table and the "down" to remove it. The Akrabat_Db_Schema_Manager is what your script would interface with by calling the "updateTo" method and change your database's structure. It can even hook into Zend_Tool to make it command-line friendly.

0 comments voice your opinion now!
zendframework database migration akrabat schema


blog comments powered by Disqus

Similar Posts

Zend Developer Zone: Announcing Zend Framework's Bug Hunting Days For September

Kevin Schroeder's Blog: ZendCon 2010 Podcast - Introducing Zend Framework 2.0

Pádraic Brady's Blog: Complex Views with the Zend Framework - Part 6: Setting The Terminology

Fabien Potencier: The PHP Security Advisories Database

Chris Hartjes' Blog: The Story and Rebirth Of Zend_Service_Audioscrobbler, Part 1


Community Events

Don't see your event here?
Let us know!


example api interview opinion podcast conference version symfony2 install voicesoftheelephpant framework performance introduction series release library community php7 extension laravel

All content copyright, 2015 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework