Google Groups Home Help | Sign in
Propel difference
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  17 messages - Collapse all
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
Thierry  
View profile
 More options Nov 9 2007, 6:24 am
From: Thierry <thierryschellenb...@gmail.com>
Date: Fri, 09 Nov 2007 03:24:27 -0800
Local: Fri, Nov 9 2007 6:24 am
Subject: Propel difference
Is there any way to generate the sql needed to bring the structure of
the existing database up to the specification in the schema.yml?

How do you guys handle db scheme changes? Any best practices?


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Zsolt Takács  
View profile
 More options Nov 9 2007, 8:13 am
From: "Zsolt Takács" <zsolti...@gmail.com>
Date: Fri, 9 Nov 2007 14:13:00 +0100
Subject: Re: [symfony-users] Propel difference
use fixtures, then you can dump the db and create it again and load
test data automatically
of course you'll have to adjust the fixtures when you change
something, but its much easier then altering tables
On Nov 9, 2007 12:24 PM, Thierry <thierryschellenb...@gmail.com> wrote:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Thierry  
View profile
 More options Nov 9 2007, 12:48 pm
From: Thierry <thierryschellenb...@gmail.com>
Date: Fri, 09 Nov 2007 17:48:59 -0000
Local: Fri, Nov 9 2007 12:48 pm
Subject: Re: Propel difference
My site already has a production live, dumping the db is no longer
possible.
(I can do it in development, but not in production)

    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Thierry  
View profile
 More options Nov 9 2007, 12:51 pm
From: Thierry <thierryschellenb...@gmail.com>
Date: Fri, 09 Nov 2007 17:51:34 -0000
Local: Fri, Nov 9 2007 12:51 pm
Subject: Re: Propel difference
I think there are many programs out there to sync the structure of two
databases, but I simply don't know what to look for.
Any help would be appreciated.

    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jay Klehr  
View profile
 More options Nov 9 2007, 1:13 pm
From: Jay Klehr <vi...@consolecity.com>
Date: Fri, 09 Nov 2007 11:13:57 -0700
Local: Fri, Nov 9 2007 1:13 pm
Subject: Re: [symfony-users] Re: Propel difference
I've heard that Premium Soft's Navicat MySQL has a good utility for
syncing the structure of two databases.  Unfortunately I haven't used it
myself yet.  An ex-co-worker of mine swore by it.

http://www.navicat.com/

Jay


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jonotron  
View profile
 More options Nov 9 2007, 4:04 pm
From: Jonotron <jonot...@gmail.com>
Date: Fri, 09 Nov 2007 21:04:47 -0000
Local: Fri, Nov 9 2007 4:04 pm
Subject: Re: Propel difference

On Nov 9, 3:24 am, Thierry <thierryschellenb...@gmail.com> wrote:

> Is there any way to generate the sql needed to bring the structure of
> the existing database up to the specification in the schema.yml?

> How do you guys handle db scheme changes? Any best practices?

It's probably too for this now, but when I make changes to my schema,
I echo those changes in an SQL file that does the appropriate ALTERS
to my database.  This does require dual entry though, I.E. you make
changes to the schema AND to a SQL update file.

My method is to keep the SQL update files in /data/update path.  I
name my files after the version that it brings the database to.  E.g.
If my production application is at version 1.0.0 and I've got a bunch
of development changes and now I want to bring version 1.0.0 up to
date with my development version (which I have tagged say 1.0.1)... my
SQL update script is named /data/update/1.0.1-update.sql

This way I can also ensure that I upgrade in the proper sequence,
incase I tag a few versions of my development copy, but for some
reason I don't put these into production for a few tags.  E.g.  My
development version is at 1.0.1 and since then I've developed a 1.0.2
and a 1.0.3 and a 1.0.4 and now I want to upgrade my production from
1.0.1 to 1.0.4... my /data/update/ directory contains 1.0.1-
update.sql, 1.0.2-update.sql, and 1.0.4-update.sql... so I run 1.0.2-
update.sql (not 1.0.1 since I am already at that version) then 1.0.4-
update.sql (there is no 1.0.3-update.sql perhaps because that version
had no model changes, just logic changes).

Another benefit that I like of create update.sql scripts, is that
sometimes I might make a drastic change to the model (like combining
two tables, or splitting one table into two, for one reason or
another).  This is hard to change the structure AND the data using
some kind of automated tool.  It would require some SELECTs and
INSERTs and UPDATEs in addition to the ALTERs.  So as long as I have
been cataloging my changes in my update scripts and thinking about it
as I make changes to my model, I am fine and it is rather quite easy
to perform production upgrades.

J


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
drmikecrowe  
View profile
 More options Nov 9 2007, 5:09 pm
From: drmikecrowe <drmikecr...@gmail.com>
Date: Fri, 09 Nov 2007 22:09:45 -0000
Local: Fri, Nov 9 2007 5:09 pm
Subject: Re: Propel difference
www.mysqldiff.org

Fantastic too.

Or, I use these scripts:

To save the database:
mysqldump -u MYUSERNAME --password=MYPASSWORD MYDATABASE --skip-opt --
compact --create-options --complete-insert  > sql/MYDATABASE.sql
echo "SET FOREIGN_KEY_CHECKS = 0;" > sql/MYDATABASE.insert.sql
grep INSERT sql/MYDATABASE.sql >> sql/MYDATABASE.insert.sql
echo "SET FOREIGN_KEY_CHECKS = 1;" >> sql/MYDATABASE.insert.sql

To rebuild with the new schema:
rm config/generated*.xml
./symfony propel-13-build-all
./symfony propel-13-insert-sql

To reload the data:
mysql -u MYUSERNAME --password=MYPASSWORD MYDATABASE < sql/
MYDATABASE.insert.sql

This handles adding fields very well.  It does NOT handle renaming or
removing fields.  If you want to remove / rename fields, do that
operation on the database before doing the first save.  Otherwise,
your sql file will be filled with inserts pointing to non-existent
fields.

Mike

On Nov 9, 4:04 pm, Jonotron <jonot...@gmail.com> wrote:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Boris Duin  
View profile
 More options Nov 9 2007, 7:28 pm
From: "Boris Duin" <borisd...@gmail.com>
Date: Fri, 9 Nov 2007 20:28:04 -0400
Local: Fri, Nov 9 2007 7:28 pm
Subject: Re: [symfony-users] Re: Propel difference

Hi Thierry:

In the Symfony spanish list,  someone  recomends  liquibase (
www.liquibase.org) . This is a  Eclipse plugin.

Regards.

2007/11/9, drmikecrowe <drmikecr...@gmail.com>:

--
Boris Duin
Celular: 0416-8136373

    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Roberto Carvajal  
View profile
 More options Nov 10 2007, 2:08 am
From: Roberto Carvajal <roberto.carva...@gmail.com>
Date: Sat, 10 Nov 2007 04:08:58 -0300
Local: Sat, Nov 10 2007 2:08 am
Subject: Re: [symfony-users] Re: Propel difference
That's exactly what I do too, just dump the db with complete inserts and
skipping the table creation (you just need the data).

Is not a fancy solution, is not elegant either but it works pretty good
for me since a few years :).

Cheers,

r.

drmikecrowe escribió:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Kiril Angov  
View profile
 More options Nov 10 2007, 2:21 am
From: Kiril Angov <kupokom...@gmail.com>
Date: Sat, 10 Nov 2007 16:21:33 +0900
Local: Sat, Nov 10 2007 2:21 am
Subject: Re: [symfony-users] Propel difference
Is everybody not aware of
http://trac.symfony-project.com/wiki/sfPropelMigrationsLightPlugin ?
It will not solve your problem now but use mysql diff tool and then
create a migration that you an run in production. And from then on use
migrations everytime you make schema changes.

Kupo


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Thierry  
View profile
 More options Nov 10 2007, 4:32 am
From: Thierry <thierryschellenb...@gmail.com>
Date: Sat, 10 Nov 2007 09:32:29 -0000
Local: Sat, Nov 10 2007 4:32 am
Subject: Re: Propel difference
This all looks really good.
Great :)

Now to include it in my build script :)


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Thierry  
View profile
 More options Nov 10 2007, 9:57 am
From: Thierry <thierryschellenb...@gmail.com>
Date: Sat, 10 Nov 2007 06:57:13 -0800
Local: Sat, Nov 10 2007 9:57 am
Subject: Re: Propel difference
I like the approach of dumping the mysql data. It is the probably the
only solutions, considering propel.
Now have a little pake task:
propel-build-all-save-mysql

which does mysqldump, propel-build-all, load dump in that order
It's still quite raw, but working nicely.

Mysqldiff seems to be working wonders as well :)


    Reply to author    Forward