Adding AclCLI::upgrade() for upgrading previous releases to 1.1.9.x and above

git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@3812 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
phpnut 2006-11-03 06:01:48 +00:00
parent 3b8b34114b
commit 0c759b9ce7

View file

@ -210,6 +210,9 @@ class AclCLI {
case 'initdb': case 'initdb':
$this->initdb(); $this->initdb();
break; break;
case 'upgrade':
$this->upgradedb();
break;
case 'help': case 'help':
$this->help(); $this->help();
break; break;
@ -389,6 +392,25 @@ class AclCLI {
fwrite($this->stdout, "\nDone.\n"); fwrite($this->stdout, "\nDone.\n");
} }
/**
* Enter description here...
*
*/
function upgrade() {
$db =& ConnectionManager::getDataSource($this->dataSource);
fwrite($this->stdout, "Initializing Database...\n");
fwrite($this->stdout, "Upgrading table (aros)...\n");
$sql = "ALTER TABLE ".$db->fullTableName('aros')."
CHANGE ".$db->name('user_id')."
".$db->name('foreign_key')."
INT( 10 ) UNSIGNED NULL DEFAULT NULL;";
if ($db->query($sql) === false) {
die("Error: " . $db->lastError() . "\n\n");
}
}
/** /**
* Enter description here... * Enter description here...
* *