Issue 91: Create feature to disable a repo

This commit is contained in:
Nathan Adams
2015-02-09 23:24:51 -06:00
parent feb001ed8e
commit 4febdda65f
9 changed files with 85 additions and 5 deletions

View File

@@ -18,7 +18,7 @@ function IDF_Migrations_30SyntaxHighlightTheme_up()
}
function IDF_Migrations_28OTPKey_down()
function IDF_Migrations_30SyntaxHighlightTheme_down()
{
$table = Pluf::factory('IDF_Project')->getSqlTable();

View File

@@ -0,0 +1,36 @@
<?php
function IDF_Migrations_31DisableProject_up()
{
$table = Pluf::factory('IDF_Project')->getSqlTable();
$sql = array();
$sql["MySQL"] = "ALTER TABLE " . $table . " ADD COLUMN `disabled` int(11) NULL AFTER `current_activity`;";
$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_31DisableProject_down()
{
$table = Pluf::factory('IDF_Project')->getSqlTable();
$sql = array();
$sql["MySQL"] = "ALTER TABLE " . $table . " DROP COLUMN `disabled`;";
$db = Pluf::db();
$engine = Pluf::f('db_engine');
if (!isset($sql[$engine])) {
throw new Exception('SQLite complex migration not supported.');
}
$db->execute($sql[$engine]);
}