diff --git a/src/IDF/Migrations/19IssueDueDate.php b/src/IDF/Migrations/19IssueDueDate.php new file mode 100644 index 0000000..8cf809f --- /dev/null +++ b/src/IDF/Migrations/19IssueDueDate.php @@ -0,0 +1,55 @@ +getSqlTable(); + $sql = array(); + $sql['PostgreSQL'] = 'ALTER TABLE '.$table.' ADD COLUMN "due_dtime" DATETIME'; + $sql['MySQL'] = 'ALTER TABLE '.$table.' ADD COLUMN `due_dtime` DATETIME'; + $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_19IssueDueDate_down($params=null) +{ + $table = Pluf::factory('IDF_Issue')->getSqlTable(); + $sql = array(); + $sql['PostgreSQL'] = 'ALTER TABLE '.$table.' DROP COLUMN "due_dtime"'; + $sql['MySQL'] = 'ALTER TABLE '.$table.' DROP COLUMN `due_dtime`'; + $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