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

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