When learning about sf doctrine migrations I found this page to be the
most informative:
http://www.doctrine-project.org/documentation/cookbook/1_0/en/symfony-and-doctrine-migrations

On May 13, 2:45 am, dziobacz <aaabbbcccda...@gmail.com> wrote:
> OK - I know :)))
> If we have files: 001_file1.class.php and 002_file2.class.php
> symfony doctrine:migrate 002 - migrate from 001 version
> (001_file1.class.php) to 002 version (002_file2.class.php)
> symfony doctrine:migrate 000 - migrate from 002 version -> 001 version
> -> 000 version (database at the beginning, not file)
> symfony doctrine:migrate 001 - migrate to 001 version
>
> WONDERFUL !! xD
>
> On 13 Maj, 08:27, dziobacz <aaabbbcccda...@gmail.com> wrote:
>
> > You have written: 'Each class essentially represents a version of your
> > database and the up() and down() methods allow you to walk backwards
> > and forwards between versions of your database.' - so I can return in
> > symfony to previous version database ? May I know how ? :)
>
> > On 12 Maj, 22:55, Jonathan Wage <jonw...@gmail.com> wrote:
>
> > > Not at the same level of Doctrine.
>
> > > - Jon
>
> > > On Tue, May 12, 2009 at 3:47 PM, Craig <cr...@pixelfusion.co.nz> wrote:
>
> > > > Hi,
>
> > > > Is there something similar for migrating database schemas in Propel?
>
> > > > Cheers
> > > > Craig
>
> > > > On May 13, 5:17 am, dziobacz <aaabbbcccda...@gmail.com> 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 <jonw...@gmail.com> 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 
> > > > > > <aaabbbcccda...@gmail.com>
> > > > 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
>
> > > --
> > > 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 symfony-users@googlegroups.com
To unsubscribe from this group, send email to 
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to