From 0c759b9ce706feb2d2ecf7aae308115f3cd10dcf Mon Sep 17 00:00:00 2001 From: phpnut Date: Fri, 3 Nov 2006 06:01:48 +0000 Subject: [PATCH] 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 --- cake/scripts/acl.php | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/cake/scripts/acl.php b/cake/scripts/acl.php index ee3aa641e..867fdabd5 100644 --- a/cake/scripts/acl.php +++ b/cake/scripts/acl.php @@ -210,6 +210,9 @@ class AclCLI { case 'initdb': $this->initdb(); break; + case 'upgrade': + $this->upgradedb(); + break; case 'help': $this->help(); break; @@ -389,6 +392,25 @@ class AclCLI { 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... *