From 5ffab5e738e0d9278e26d46b2871ed12c3432f0b Mon Sep 17 00:00:00 2001 From: f1ames Date: Tue, 25 Feb 2014 12:51:23 +0100 Subject: [PATCH 1/2] use table_prefix from database config when creating migrations table --- .gitignore | 3 ++- classes/Model/Minion/Migration.php | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 67c4323..5ddd23c 100644 --- a/.gitignore +++ b/.gitignore @@ -3,4 +3,5 @@ Icon? .svn nbproject Thumbs.db -*.komodoproject \ No newline at end of file +*.komodoproject +.idea \ No newline at end of file diff --git a/classes/Model/Minion/Migration.php b/classes/Model/Minion/Migration.php index 57d3d01..640edcb 100644 --- a/classes/Model/Minion/Migration.php +++ b/classes/Model/Minion/Migration.php @@ -172,7 +172,7 @@ class Model_Minion_Migration extends Model if ( ! count($query)) { $sql = View::factory('minion/task/migrations/schema') - ->set('table_name', $this->_table) + ->set('table_name', $this->_db->table_prefix() . $this->_table) ->render(); $this->_db->query(NULL, $sql); From 5d1e612515746693e6074a88cf85c78ad3c99d5a Mon Sep 17 00:00:00 2001 From: f1ames Date: Wed, 26 Feb 2014 09:40:16 +0100 Subject: [PATCH 2/2] table name with prefix also in checking query --- classes/Model/Minion/Migration.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/classes/Model/Minion/Migration.php b/classes/Model/Minion/Migration.php index 640edcb..79e95b5 100644 --- a/classes/Model/Minion/Migration.php +++ b/classes/Model/Minion/Migration.php @@ -167,12 +167,13 @@ class Model_Minion_Migration extends Model */ public function ensure_table_exists() { - $query = $this->_db->query(Database::SELECT, "SHOW TABLES like '".$this->_table."'"); + $table = $this->_db->table_prefix() . $this->_table; + $query = $this->_db->query(Database::SELECT, "SHOW TABLES like '".$table."'"); if ( ! count($query)) { $sql = View::factory('minion/task/migrations/schema') - ->set('table_name', $this->_db->table_prefix() . $this->_table) + ->set('table_name', $table) ->render(); $this->_db->query(NULL, $sql);