Hi,

I have two problems with doctrine:migrate here (symfony 1.4).

The first is caused by an empty onUpdate declaration

        $this->createForeignKey('comment', 'comment_game_id_game_id', array(
             'name' => 'comment_game_id_game_id',
             'local' => 'game_id',
             'foreign' => 'id',
             'foreignTable' => 'game',
             'onUpdate' => '',
             'onDelete' => 'CASCADE',
             ));


   - SQLSTATE[42601]: Syntax error: 7 BŁĄD:  błąd składni w lub blisko "ON"
LINE 1: ...EIGN KEY (game_id) REFERENCES game(id) ON UPDATE  ON DELETE ...
                                                             ^.
Failing Query: "ALTER TABLE comment ADD CONSTRAINT
comment_game_id_game_id FOREIGN KEY (game_id) REFERENCES game(id) ON
UPDATE  ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE"

It generates "ON UPDATE  ON DELETE ". I guess that
getAdvancedForeignKeyOptions in
plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Export.php
should be fixed.

The second issue appears while migrating down

        $this->removeIndex('rate', 'rate_game_id', array(
             'fields' =>.
             array(
              0 => 'game_id',
             ),
             ));


[Doctrine_Connection_Pgsql_Exception]
SQLSTATE[25P02]: In failed sql transaction: 7 BŁĄD:  current
transaction is aborted, commands ignored until end of transaction
block. Failing Query: "DROP INDEX rate_game_id_idx"

Caused by
$name = 
$this->conn->quoteIdentifier($this->conn->formatter->getIndexName($name));
in
plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Export.php
because index name is "rate_game_id" not "rate_game_id_idx"

IMHO these issues are quite serious for doctrine:migrate users.

Regards,
Michal

-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups "symfony developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/symfony-devs?hl=en

To unsubscribe, reply using "remove me" as the subject.

Reply via email to