From a79d13ee3f786913f3498a14b9fd68d222ed290d Mon Sep 17 00:00:00 2001 From: Loic d'Anterroches Date: Tue, 2 Dec 2008 13:23:17 +0100 Subject: [PATCH] Fixed issues 64 and 65, add a short description for the projects. Bulk of the changes were made in commit 209715a. --- src/IDF/Migrations/9ShortDescription.php | 55 ++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 src/IDF/Migrations/9ShortDescription.php diff --git a/src/IDF/Migrations/9ShortDescription.php b/src/IDF/Migrations/9ShortDescription.php new file mode 100644 index 0000000..d6f2f1c --- /dev/null +++ b/src/IDF/Migrations/9ShortDescription.php @@ -0,0 +1,55 @@ +getSqlTable(); + $sql = array(); + $sql['PostgreSQL'] = 'ALTER TABLE '.$table.' ADD COLUMN "shortdesc" VARCHAR(255) DEFAULT \'\''; + $sql['MySQL'] = 'ALTER TABLE '.$table.' ADD COLUMN `shortdesc` VARCHAR(255) DEFAULT \'\''; + $db = Pluf::db(); + $engine = Pluf::f('db_engine'); + if (!isset($sql[$engine])) { + throw new Exception('SQLite complex migration not supported.'); + } + $db->execute($sql[$engine]); +} + +function IDF_Migrations_9ShortDescription_down($params=null) +{ + $table = Pluf::factory('IDF_Project')->getSqlTable(); + $sql = array(); + $sql['PostgreSQL'] = 'ALTER TABLE '.$table.' DROP COLUMN "shortdesc"'; + $sql['MySQL'] = 'ALTER TABLE '.$table.' DROP COLUMN `shortdesc`'; + $db = Pluf::db(); + $engine = Pluf::f('db_engine'); + if (!isset($sql[$engine])) { + throw new Exception('SQLite complex migration not supported.'); + } + $db->execute($sql[$engine]); + +} \ No newline at end of file