[symfony-users] Re: Best Practices for Schema Changes

2009-05-24 Thread James Cauwelier

I did some research and it turns out that the master solution in my
earlier response should work.  Just make sure that your application
doesn 't  use 'unnamed insert/update', always use the column names for
update/insert.

More information on the mysql performance blog:
http://www.mysqlperformanceblog.com/2008/03/27/using-mmm-to-alter-huge-tables/


On May 24, 1:37 am, Sherif sherifgmans...@gmail.com wrote:
 Lawrence,
 propel:data-dump and propel-build-all-load works great for a small
 database. Once your database reaches a certain size, this method is no
 longer feasible as you continue to get php out of memory errors.

 With a php.ini max memory set to 128mb, Ive found I usually reach this
 limit when the database dump gets to around 10meg in size (you are
 talking an average ~20,000 rows across your tables, where a table
 might contain an average of 5/6 columns).

 Once you hit these size limitations, using slinky66's method seems the
 best way to go for me... (medium sized db's)

 and I guess once that gets too big (large sized db's - 1m rows+) then
 James Cauwelier's method seems like the way to go...

 Would be interested to hear how other big sites handle this...

 Sherif

 On May 24, 6:18 am, Lawrence lkrub...@geocities.com wrote:

  On May 20, 9:50 am, slinky66 tcasto...@comcast.net wrote:

   I have not been able to find a best practice approach in the Symfony
   docs for dealing with
   schema changes as it relates to rebuilding the data model. Can someone
   give me some guidance with this scenario?

   Site is up and running and a few weeks later, a new column needs to be
   added to the database.

   Can some one describe the steps?

  If you work alone, you can do pretty much anything you want. We've a
  team of 5 programmers, scattered all over the world, so we need to be
  systematic. Our checklist:

  1.) create a migration. test and debug on your local box.

  2.) check it in.

  3.) run the migration on the live site.

  4.) (important!) do a symfony propel:data-dump  data/fixtures/
  frontend.yml

  5.) run symfony propel:build-all-load

  6.) when all works, make sure to check in the new fixture.

  7.) run ‘php symfony cc’ after making so many changes.
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



[symfony-users] Re: Best Practices for Schema Changes

2009-05-23 Thread Sherif

Lawrence,
propel:data-dump and propel-build-all-load works great for a small
database. Once your database reaches a certain size, this method is no
longer feasible as you continue to get php out of memory errors.

With a php.ini max memory set to 128mb, Ive found I usually reach this
limit when the database dump gets to around 10meg in size (you are
talking an average ~20,000 rows across your tables, where a table
might contain an average of 5/6 columns).

Once you hit these size limitations, using slinky66's method seems the
best way to go for me... (medium sized db's)

and I guess once that gets too big (large sized db's - 1m rows+) then
James Cauwelier's method seems like the way to go...

Would be interested to hear how other big sites handle this...

Sherif


On May 24, 6:18 am, Lawrence lkrub...@geocities.com wrote:
 On May 20, 9:50 am, slinky66 tcasto...@comcast.net wrote:

  I have not been able to find a best practice approach in the Symfony
  docs for dealing with
  schema changes as it relates to rebuilding the data model. Can someone
  give me some guidance with this scenario?

  Site is up and running and a few weeks later, a new column needs to be
  added to the database.

  Can some one describe the steps?

 If you work alone, you can do pretty much anything you want. We've a
 team of 5 programmers, scattered all over the world, so we need to be
 systematic. Our checklist:

 1.) create a migration. test and debug on your local box.

 2.) check it in.

 3.) run the migration on the live site.

 4.) (important!) do a symfony propel:data-dump  data/fixtures/
 frontend.yml

 5.) run symfony propel:build-all-load

 6.) when all works, make sure to check in the new fixture.

 7.) run ‘php symfony cc’ after making so many changes.
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



[symfony-users] Re: Best Practices for Schema Changes

2009-05-21 Thread James Cauwelier

With a small database this approach would work just fine.  From time
to time I have to change the schema on a database with tables as large
as 6 million rows.  Adding a row or an index is not someting that you
do on the live database.  It is just too risky and takes a long time.
Not so long ago I added a column which took me 1.5 days.

I am not a database expert, but maybe for larger databases replicating
the database, doing the changes on the replicated databases and then
switching the master would seem to be a better solution.  I don 't
know if it is possible to replicate between tables when the replicated
database has an extra column.  Maybe somebody can comment on that?


James

On May 20, 4:33 pm, slinky66 tcasto...@comcast.net wrote:
 Thank you for that. We do not use Doctrine however these steps worked
 for me just fine:

 1) Made changes to existing database schema directly on the database.
 In this case, I added a new column to an existing table

 2) symfony propel-build-schema xml

 3) symfony propel-build-model

 4) symfony cc

 These operations affected the base classes that need to take care of
 the new column that I added.

 On May 20, 10:20 am, Thibault Jouannic tee...@gmail.com wrote:





  Hi,

  If you use Doctrine, you can use migrations tools :

 http://www.symfony-project.org/doctrine/1_2/en/07-Migrations

  On 20 mai, 15:50, slinky66 tcasto...@comcast.net wrote:

   I have not been able to find a best practice approach in the Symfony
   docs for dealing with
   schema changes as it relates to rebuilding the data model. Can someone
   give me some guidance with this scenario?

   Site is up and running and a few weeks later, a new column needs to be
   added to the database.

   Can some one describe the steps?

   Thanks
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



[symfony-users] Re: Best Practices for Schema Changes

2009-05-21 Thread David Ashwood

If you're using MySQL then there's a handy tool you can use that's pretty
decent for the job (and it's free :))

http://dev.mysql.com/downloads/gui-tools/5.0.html

-Original Message-
From: symfony-users@googlegroups.com [mailto:symfony-us...@googlegroups.com]
On Behalf Of James Cauwelier
Sent: 21 May 2009 12:03
To: symfony users
Subject: [symfony-users] Re: Best Practices for Schema Changes


With a small database this approach would work just fine.  From time
to time I have to change the schema on a database with tables as large
as 6 million rows.  Adding a row or an index is not someting that you
do on the live database.  It is just too risky and takes a long time.
Not so long ago I added a column which took me 1.5 days.

I am not a database expert, but maybe for larger databases replicating
the database, doing the changes on the replicated databases and then
switching the master would seem to be a better solution.  I don 't
know if it is possible to replicate between tables when the replicated
database has an extra column.  Maybe somebody can comment on that?


James

On May 20, 4:33 pm, slinky66 tcasto...@comcast.net wrote:
 Thank you for that. We do not use Doctrine however these steps worked
 for me just fine:

 1) Made changes to existing database schema directly on the database.
 In this case, I added a new column to an existing table

 2) symfony propel-build-schema xml

 3) symfony propel-build-model

 4) symfony cc

 These operations affected the base classes that need to take care of
 the new column that I added.

 On May 20, 10:20 am, Thibault Jouannic tee...@gmail.com wrote:





  Hi,

  If you use Doctrine, you can use migrations tools :

 http://www.symfony-project.org/doctrine/1_2/en/07-Migrations

  On 20 mai, 15:50, slinky66 tcasto...@comcast.net wrote:

   I have not been able to find a best practice approach in the Symfony
   docs for dealing with
   schema changes as it relates to rebuilding the data model. Can someone
   give me some guidance with this scenario?

   Site is up and running and a few weeks later, a new column needs to be
   added to the database.

   Can some one describe the steps?

   Thanks


--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



[symfony-users] Re: Best Practices for Schema Changes

2009-05-21 Thread David Ashwood

(It's the migration tool towards the bottom) :)

-Original Message-
From: symfony-users@googlegroups.com [mailto:symfony-us...@googlegroups.com]
On Behalf Of David Ashwood
Sent: 21 May 2009 12:12
To: symfony-users@googlegroups.com
Subject: [symfony-users] Re: Best Practices for Schema Changes


If you're using MySQL then there's a handy tool you can use that's pretty
decent for the job (and it's free :))

http://dev.mysql.com/downloads/gui-tools/5.0.html

-Original Message-
From: symfony-users@googlegroups.com [mailto:symfony-us...@googlegroups.com]
On Behalf Of James Cauwelier
Sent: 21 May 2009 12:03
To: symfony users
Subject: [symfony-users] Re: Best Practices for Schema Changes


With a small database this approach would work just fine.  From time
to time I have to change the schema on a database with tables as large
as 6 million rows.  Adding a row or an index is not someting that you
do on the live database.  It is just too risky and takes a long time.
Not so long ago I added a column which took me 1.5 days.

I am not a database expert, but maybe for larger databases replicating
the database, doing the changes on the replicated databases and then
switching the master would seem to be a better solution.  I don 't
know if it is possible to replicate between tables when the replicated
database has an extra column.  Maybe somebody can comment on that?


James

On May 20, 4:33 pm, slinky66 tcasto...@comcast.net wrote:
 Thank you for that. We do not use Doctrine however these steps worked
 for me just fine:

 1) Made changes to existing database schema directly on the database.
 In this case, I added a new column to an existing table

 2) symfony propel-build-schema xml

 3) symfony propel-build-model

 4) symfony cc

 These operations affected the base classes that need to take care of
 the new column that I added.

 On May 20, 10:20 am, Thibault Jouannic tee...@gmail.com wrote:





  Hi,

  If you use Doctrine, you can use migrations tools :

 http://www.symfony-project.org/doctrine/1_2/en/07-Migrations

  On 20 mai, 15:50, slinky66 tcasto...@comcast.net wrote:

   I have not been able to find a best practice approach in the Symfony
   docs for dealing with
   schema changes as it relates to rebuilding the data model. Can someone
   give me some guidance with this scenario?

   Site is up and running and a few weeks later, a new column needs to be
   added to the database.

   Can some one describe the steps?

   Thanks




--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



[symfony-users] Re: Best Practices for Schema Changes

2009-05-20 Thread Thibault Jouannic

Hi,

If you use Doctrine, you can use migrations tools :

http://www.symfony-project.org/doctrine/1_2/en/07-Migrations

On 20 mai, 15:50, slinky66 tcasto...@comcast.net wrote:
 I have not been able to find a best practice approach in the Symfony
 docs for dealing with
 schema changes as it relates to rebuilding the data model. Can someone
 give me some guidance with this scenario?

 Site is up and running and a few weeks later, a new column needs to be
 added to the database.

 Can some one describe the steps?

 Thanks
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



[symfony-users] Re: Best Practices for Schema Changes

2009-05-20 Thread slinky66

Thank you for that. We do not use Doctrine however these steps worked
for me just fine:

1) Made changes to existing database schema directly on the database.
In this case, I added a new column to an existing table

2) symfony propel-build-schema xml

3) symfony propel-build-model

4) symfony cc

These operations affected the base classes that need to take care of
the new column that I added.


On May 20, 10:20 am, Thibault Jouannic tee...@gmail.com wrote:
 Hi,

 If you use Doctrine, you can use migrations tools :

 http://www.symfony-project.org/doctrine/1_2/en/07-Migrations

 On 20 mai, 15:50, slinky66 tcasto...@comcast.net wrote:

  I have not been able to find a best practice approach in the Symfony
  docs for dealing with
  schema changes as it relates to rebuilding the data model. Can someone
  give me some guidance with this scenario?

  Site is up and running and a few weeks later, a new column needs to be
  added to the database.

  Can some one describe the steps?

  Thanks
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---