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