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:
@@ -119,5 +119,9 @@ function IDF_Migrations_Backup_restore($folder, $name)
|
||||
foreach ($full_data as $model => $data) {
|
||||
Pluf_Test_Fixture::load($data, false);
|
||||
}
|
||||
foreach ($models as $model) {
|
||||
$schema->model = new $model();
|
||||
$schema->createConstraints();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
@@ -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();
|
||||
|
Reference in New Issue
Block a user