Root/
File | Age | Message | Size | |
---|---|---|---|---|
.. | ||||
Thomas Keller: When new tables are created (e.g. on initial installations or during upgrades), Pluf used to create foreign key relations as part of the table definitions. This however made problems when two tables, A and B, cross-referenced themselves via a foreign key relation, because strict DBMS like PostgreSQL or MySQL couldn't create such a relation without that both target tables existed prior. This patch changes this behaviour by separating table creation and foreign key setup into two phases, that have to be called after another, namely Pluf_DB_Schema::createTables() and Pluf_DB_Schema::createConstraints(). For "reverse" migrations the same logic is used, at first Pluf_DB_Schema::dropConstraints() has to be called, then Pluf_DB_Schema::dropTables() can be executed. | ||||
Thomas Keller: When new tables are created (e.g. on initial installations or during upgrades), Pluf used to create foreign key relations as part of the table definitions. This however made problems when two tables, A and B, cross-referenced themselves via a foreign key relation, because strict DBMS like PostgreSQL or MySQL couldn't create such a relation without that both target tables existed prior. This patch changes this behaviour by separating table creation and foreign key setup into two phases, that have to be called after another, namely Pluf_DB_Schema::createTables() and Pluf_DB_Schema::createConstraints(). For "reverse" migrations the same logic is used, at first Pluf_DB_Schema::dropConstraints() has to be called, then Pluf_DB_Schema::dropTables() can be executed. | ||||
Thomas Keller: When new tables are created (e.g. on initial installations or during upgrades), Pluf used to create foreign key relations as part of the table definitions. This however made problems when two tables, A and B, cross-referenced themselves via a foreign key relation, because strict DBMS like PostgreSQL or MySQL couldn't create such a relation without that both target tables existed prior. This patch changes this behaviour by separating table creation and foreign key setup into two phases, that have to be called after another, namely Pluf_DB_Schema::createTables() and Pluf_DB_Schema::createConstraints(). For "reverse" migrations the same logic is used, at first Pluf_DB_Schema::dropConstraints() has to be called, then Pluf_DB_Schema::dropTables() can be executed. |
Download this version or git clone git://archive.srchub.org/pluf2.git