diff --git a/NEWS.mdtext b/NEWS.mdtext index 7205df9..9f62604 100644 --- a/NEWS.mdtext +++ b/NEWS.mdtext @@ -2,15 +2,17 @@ ## Bugfixes -- If an anonymous or authenticated user had no access - to any project in a forge, all projects were listed - for him (but still no one was actually accessible). - This has been fixed. - -- Fixed a problem where the SyncGit plugin doesn't properly - updates the authorized_keys file when the public key - data contained slashes (thanks to Simon Gareste for the - fix!) +- If an anonymous or authenticated user had no access to any project in a + forge, all projects were listed for him (but still no one was actually + accessible). This has been fixed. + +- Fixed a problem where the SyncGit plugin doesn't properly updates the + authorized_keys file when the public key data contained slashes (thanks + to Simon Gareste for the fix!) + +- Under PostgreSQL new projects could not be created due to a failing + foreign key relation. Adding project tags was not possible for a similar + reason. This has been fixed (issue 800, continued). # InDefero 1.3.2 - Wed May 09 20:05 2012 UTC diff --git a/src/IDF/Migrations/25NullableProjectInTag.php b/src/IDF/Migrations/25NullableProjectInTag.php index 22e10d7..0829acf 100644 --- a/src/IDF/Migrations/25NullableProjectInTag.php +++ b/src/IDF/Migrations/25NullableProjectInTag.php @@ -37,6 +37,7 @@ function IDF_Migrations_25NullableProjectInTag_up($params=null) function IDF_Migrations_25NullableProjectInTag_down($params=null) { + $engine = Pluf::f('db_engine'); $db = Pluf::db(); if ($engine === 'PostgreSQL') { $db->execute('ALTER TABLE '.$db->pfx.'idf_tags ALTER COLUMN project SET NOT NULL'); diff --git a/src/IDF/Migrations/26NullableActivityInProject.php b/src/IDF/Migrations/26NullableActivityInProject.php new file mode 100644 index 0000000..6335d84 --- /dev/null +++ b/src/IDF/Migrations/26NullableActivityInProject.php @@ -0,0 +1,46 @@ +execute('ALTER TABLE '.$db->pfx.'idf_projects ALTER COLUMN current_activity DROP NOT NULL'); + } else if ($engine === 'MySQL') { + $db->execute('ALTER TABLE '.$db->pfx.'idf_projects MODIFY current_activity MEDIUMINT NULL'); + // this is only needed for non-transactional setups where MySQL set 0 as default value + $db->execute('UPDATE '.$db->pfx.'idf_projects SET current_activity=NULL WHERE current_activity=0'); + } +} + +function IDF_Migrations_26NullableActivityInProject_down($params=null) +{ + $engine = Pluf::f('db_engine'); + $db = Pluf::db(); + if ($engine === 'PostgreSQL') { + $db->execute('ALTER TABLE '.$db->pfx.'idf_projects ALTER COLUMN current_activity SET NOT NULL'); + } else if ($engine === 'MySQL') { + $db->execute('ALTER TABLE '.$db->pfx.'idf_projects MODIFY current_activity MEDIUMINT NOT NULL'); + } +} diff --git a/src/IDF/Project.php b/src/IDF/Project.php index 04cd41b..b773281 100644 --- a/src/IDF/Project.php +++ b/src/IDF/Project.php @@ -105,6 +105,8 @@ class IDF_Project extends Pluf_Model 'type' => 'Pluf_DB_Field_Foreignkey', 'model' => 'IDF_ProjectActivity', 'blank' => true, + 'is_null' => true, + 'default' => null, 'verbose' => __('current project activity'), ), ); diff --git a/src/IDF/Tag.php b/src/IDF/Tag.php index 7b6349e..6809bc2 100644 --- a/src/IDF/Tag.php +++ b/src/IDF/Tag.php @@ -50,6 +50,7 @@ class IDF_Tag extends Pluf_Model 'model' => 'IDF_Project', 'blank' => true, 'is_null' => true, + 'default' => null, 'verbose' => __('project'), ), 'class' =>