> > The whole propel dumping and re-importing seems very flaky. It's
> > really screwed me up too as I've a bunch of schema changes that I've
> > been unable to apply.
>
> You don't use the acutal key you use the name designation in the
> import_data.yml. Consider the following:
>
> TableOne:
>   to_record_1:
>    table_two_id: tt_record_1
>    other_value: foo bar
>
> TableTwo:
>   tt_record_1:
>     value_1: foo
>     value_2: bar
>
> See how its linked? you use the yml name of the record (ie. to_record_1,
> tt_record_1, etc..)

Sure, but a record named - say - Town_63 is getting inserted with ID
of 60, which is not right.

> Additionally all you tables need to be in dependency order. Using the
> example above TableTwo would have to come before TableOne in your
> import_data.yml file so that any records that TableOne might link to will
> have been assigned keys before it attempts to link them.

The data was generated by propel-dump-data, I'd assumed that this was
all taken care of. Thanks to your suggestion I have since checked and
moved things around a bit. I am now certain that the data is int he
right order.

For the sake of completness here's the summary of the steps I'm taking
to make changes to the model then re-import the live data:

On production server

#> symfony propel-dump-data backend myData.yml
#> symfony propel-build-schema

On development server

Copy down data/fixtures/myData.yml and config/schema.yml that were
generated by the above commands to the same locations. Also made sure
that there are no other schema*.xml files in config/ and that nothing
else is in the data/fixtures folder. Finally I deleted anything in
data/sql.

I also had to ensure that my connection name in propel.ini is propel
else I got errors later about no connection parameters for <connection
name>

Doing this manually as I had some problems with propel-build-all

#> symfony propel-build-sql
mysql> drop database <db>;
mysql> create database <db>;
#> mysql -u root <db> < data/sql/lib.model.schema.sql
#> symfony propel-build-model
#> symfony propel-load-data backend
#> symfony cc

Foreign key relationships are lost. In the schema they've values but
where there's a relationship I'm getting 0's entered on the insert:

Jul 11 16:01:22 symfony [info] {sfCreole} prepareStatement(): INSERT
INTO favorite_university (STUDENT_ID,UNIVERSITY_ID) VALUES (?,?)
Jul 11 16:01:22 symfony [info] {sfCreole} executeUpdate(): INSERT INTO
favorite_university (STUDENT_ID,UNIVERSITY_ID) VALUES (0,0)
Jul 11 16:01:22 symfony [info] {sfCreole} committing transaction.
Jul 11 16:01:22 symfony [info] {sfCreole} committing transaction.
Jul 11 16:01:22 symfony [info] {sfCreole} beginning transaction.
Jul 11 16:01:22 symfony [info] {sfCreole} beginning transaction.
Jul 11 16:01:22 symfony [info] {sfCreole} prepareStatement(): INSERT
INTO favorite_university (STUDENT_ID,UNIVERSITY_ID) VALUES (?,?)
Jul 11 16:01:22 symfony [info] {sfCreole} executeUpdate(): INSERT INTO
favorite_university (STUDENT_ID,UNIVERSITY_ID) VALUES (0,0)
Jul 11 16:01:22 symfony [info] {sfCreole} committing transaction.
Jul 11 16:01:22 symfony [info] {sfCreole} committing transaction.
Jul 11 16:01:22 symfony [info] {sfCreole} beginning transaction.
Jul 11 16:01:22 symfony [info] {sfCreole} beginning transaction.
Jul 11 16:01:22 symfony [info] {sfCreole} prepareStatement(): INSERT
INTO favorite_university (STUDENT_ID,UNIVERSITY_ID) VALUES (?,?)
Jul 11 16:01:22 symfony [info] {sfCreole} executeUpdate(): INSERT INTO
favorite_university (STUDENT_ID,UNIVERSITY_ID) VALUES (0,0)








--~--~---------~--~----~------------~-------~--~----~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to