mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-31 17:16:18 +00:00
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:
parent
3b8b34114b
commit
0c759b9ce7
1 changed files with 22 additions and 0 deletions
|
@ -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...
|
||||||
*
|
*
|
||||||
|
|
Loading…
Add table
Reference in a new issue