1
0
Fork 0
mirror of https://github.com/Oreolek/kohana-migrations.git synced 2024-05-04 18:18:16 +03:00

Merge pull request #44 from f1ames/3.3/develop

use table_prefix from database config when creating migrations table
This commit is contained in:
Lorenzo Pisani 2014-02-28 09:13:40 -08:00
commit 35556a52fa
2 changed files with 5 additions and 3 deletions

3
.gitignore vendored
View file

@ -3,4 +3,5 @@ Icon?
.svn
nbproject
Thumbs.db
*.komodoproject
*.komodoproject
.idea

View file

@ -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->_table)
->set('table_name', $table)
->render();
$this->_db->query(NULL, $sql);