Use Pluf's new migration capabilities to prevent problems with the

circular dependency between project and project activity during
new db installations (issue 800).
ATTENTION: IDF now needs Pluf a45dc195 or newer!
This commit is contained in:
Thomas Keller 2012-05-15 22:43:15 +02:00
parent 831439120c
commit 839444cc8a
3 changed files with 18 additions and 0 deletions

View File

@ -1,5 +1,8 @@
# InDefero 1.3.3 - xxx xxx xx xx:xx 2012 UTC # InDefero 1.3.3 - xxx xxx xx xx:xx 2012 UTC
**ATTENTION**: InDefero needs Pluf [a45dc195](http://projects.ceondo.com/p/pluf/source/commit/a45dc195)
or newer to run properly!
## Bugfixes ## Bugfixes
- If an anonymous or authenticated user had no access to any project in a - If an anonymous or authenticated user had no access to any project in a
@ -10,6 +13,9 @@
authorized_keys file when the public key data contained slashes (thanks authorized_keys file when the public key data contained slashes (thanks
to Simon Gareste for the fix!) to Simon Gareste for the fix!)
- Under PostgreSQL indefero could not be set up because of a circular
foreign key dependency. This has been fixed (issue 800).
- Under PostgreSQL new projects could not be created due to a failing - Under PostgreSQL new projects could not be created due to a failing
foreign key relation. Adding project tags was not possible for a similar foreign key relation. Adding project tags was not possible for a similar
reason. This has been fixed (issue 800, continued). reason. This has been fixed (issue 800, continued).

View File

@ -119,5 +119,9 @@ function IDF_Migrations_Backup_restore($folder, $name)
foreach ($full_data as $model => $data) { foreach ($full_data as $model => $data) {
Pluf_Test_Fixture::load($data, false); Pluf_Test_Fixture::load($data, false);
} }
foreach ($models as $model) {
$schema->model = new $model();
$schema->createConstraints();
}
return true; return true;
} }

View File

@ -62,6 +62,10 @@ function IDF_Migrations_Install_setup($params=null)
$schema->model = new $model(); $schema->model = new $model();
$schema->createTables(); $schema->createTables();
} }
foreach ($models as $model) {
$schema->model = new $model();
$schema->createConstraints();
}
// Install the permissions // Install the permissions
$perm = new Pluf_Permission(); $perm = new Pluf_Permission();
$perm->name = 'Project membership'; $perm->name = 'Project membership';
@ -120,6 +124,10 @@ function IDF_Migrations_Install_teardown($params=null)
); );
$db = Pluf::db(); $db = Pluf::db();
$schema = new Pluf_DB_Schema($db); $schema = new Pluf_DB_Schema($db);
foreach ($models as $model) {
$schema->model = new $model();
$schema->dropConstraints();
}
foreach ($models as $model) { foreach ($models as $model) {
$schema->model = new $model(); $schema->model = new $model();
$schema->dropTables(); $schema->dropTables();