Development

#2907 (propel/pgsql created SQL broken)

You must first sign up to be able to contribute.

Ticket #2907 (closed defect: invalid)

Opened 1 year ago

Last modified 4 months ago

propel/pgsql created SQL broken

Reported by: birne Assigned to: dwhittle
Priority: major Milestone:
Component: sfPropelPlugin Version: 1.0.11
Keywords: pgsql postgresql propel build sql propel-build-sql Cc:
Qualification: Unreviewed

Description

When using

symfony propel-build-sql

to build the DDL SQL for a PostgreSQL database having foreign keys defined, the resulting lib.model.schema.sql file will be technically valid but broken in terms of what the content represents (and what tables/foreign keys will be build therefrom).

This is mainly because DROP .. CASCADE statements are spread all over the file. So creating a table with some foreign keys to another table initially works. Then this other table get dropped and recreated. But the mutually dropped foreign keys from the first table are missing in the end.

Also the ALTER TABLE statements to create the foreign keys are as well spread all over the file. But trying to setup a foreign key relation to a table not yet existing will not work either.

The solution will be:

  • all the DROP statements at first
  • then all CREATE TABLE statements
  • then all ALTER TABLE statements to setup foreign keys

Change History

09/21/08 21:51:33 changed by FabianLange

  • owner changed from fabien to dwhittle.
  • component changed from generator to sfPropelPlugin.

cleaning here, dustin can you check?

09/22/08 11:09:54 changed by dwhittle

  • status changed from new to closed.
  • resolution set to invalid.

This is a propel issues, and should be reported at http://propel.phpdb.org