Development

Changeset 5482

You must first sign up to be able to contribute.

Changeset 5482

Show
Ignore:
Timestamp:
10/12/07 13:50:04 (6 years ago)
Author:
l2k
Message:

sfPropelMigrationsLightPlugin: some more readme content

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • plugins/sfPropelMigrationsLightPlugin/trunk/README

    r5481 r5482  
    11= sfPropelMigrationsLightPlugin = 
    22 
    3 Easily change the database structure without loosing any data.  
     3Easily change the database structure without loosing any data. 
    44 
    55== What it is == 
     
    77Migrations are a cool thing that I first saw in [http://www.rubyonrails.org/ RoR]. They allow you to change the database structure between application revisions without losing data, in essence "a system that automates the process of keeping the schema just as flexible as the code basis as soon as your application enters maintanance or production". Have a look at their [http://media.rubyonrails.org/video/migrations.mov screencast] to see what it is all about. 
    88 
    9 This plugins is called "light", because it doesn't do any RDBMS-abstraction. So you'll have to manually write SQL code. It currently works quite alright for me, though. 
     9This plugins is called "light", because it doesn't do any RDBMS-abstraction. So you'll have to manually write SQL code. It currently works quite alright for me, though. And you don't have to write all the SQL code manually of course. Actually you'll just make a {{{diff}}} of the {{{schema.sql}}} file created by propel and copy'n'paste the right parts of it in a new migration file. 
    1010I think something more general is planned for [http://propel.phpdb.org/trac/wiki/Development/Roadmap Propel 2.0]. 
    1111 
     
    2828Then put code into the {{{up()}}} and {{{down()}}} methods. 
    2929The {{{up()}}} code should bring the DB structure to the new version. The {{{down()}}} method should revert what was done in {{{up()}}}. 
    30 To do that you can use the parent class' (sfMigration) methods, e.g. {{{executeSQL()}}}. 
     30To do that you can use the parent class' (sfMigration) methods, e.g. {{{executeSQL()}}}. Have a look at the [source:plugins/sfPropelMigrationsLightPlugin/trunk/lib/sfMigration.class.php source code] to see what else there is. 
    3131 
    3232This might look like that in a simple case: