Hi, Is there something similar for migrating database schemas in Propel?
Cheers Craig On May 13, 5:17 am, dziobacz <[email protected]> wrote: > WoW !! Thx so much !! > > I have one more question - If I have for example 100. files (I don't > have but I am interested) migration class - can I choose file to > migration, for example: 090_something.class.php ? > > So the solution for other people is: > In \lib\migration\doctrine create new file - the name isn't important > but the name must begin number, for example: 001_, 002_, 003 ... > for example: 001_something.class.php, in this file write (the name of > class isn't important): > class Cheese extends Doctrine_Migration > { > public function up() > { > $this->addColumn('table_name', 'new_column_name', 'string', > array > ('length' => '255')); > } > > public function down() > { > > } > > } > > And then write: symfony doctrine:migrate - and we have new column :) > > On 12 Maj, 18:51, Jonathan Wage <[email protected]> wrote: > > > bootstrap.php is something you would have seen earlier in the documentation. > > The examples in the Doctrine documentation are for use outside of symfony. > > You can simply place your migration class in lib/migrations/doctrine and > > then run the command ./symfony doctrine:migrate > > > - Jon > > > On Tue, May 12, 2009 at 11:49 AM, dziobacz <[email protected]> wrote: > > > > my migrate.php file: > > > require_once('bootstrap.php'); > > > $migration = new Doctrine_Migration('001_something.class'); > > > $migration->migrate(); > > > > my 001_something.class.php file: > > > class Something extends Doctrine_Migration > > > { > > > public function up() > > > { > > > $this->addColumn('my_new_column', 'Kariera', 'string', > > > array > > > ('length' => '255')); > > > } > > > > public function down() > > > { > > > > } > > > } > > > > After wrote: > > > C:\Program Files\WebServ\httpd\sf_sandbox>php migrations/migrate.php > > > > Warning: require_once(bootstrap.php) [http://www.php.net/manual/pl/ > > > function.requ > > > ire-once]: failed to open stream: No such file or directory in C: > > > \Program Files\ > > > WebServ\httpd\sf_sandbox\migrations\migrate.php on line 2 > > > > Fatal error: require_once() [http://www.php.net/manual/pl/ > > > function.require]: Fai > > > led opening required 'bootstrap.php' (include_path='.;C:\Program Files > > > \WebServ\p > > > hp\pear') in C:\Program Files\WebServ\httpd\sf_sandbox\migrations > > > \migrate.php on > > > line 2 > > > > I searched where is bootstrap.php but I found only in C:\Program Files > > > \WebServ\httpd\sf_sandbox\test\bootstrap files: functional.php and > > > unit.php > > > -- > > Jonathan H. Wage (+1 415 992 5468) > > Open Source Software Developer & Evangelist > > sensiolabs.com | jwage.com | doctrine-project.org | symfony-project.org --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~----------~----~----~----~------~----~------~--~---
