mirror of
https://github.com/Oreolek/kohana-migrations.git
synced 2024-06-28 20:55:08 +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:
commit
35556a52fa
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -4,3 +4,4 @@ Icon?
|
||||||
nbproject
|
nbproject
|
||||||
Thumbs.db
|
Thumbs.db
|
||||||
*.komodoproject
|
*.komodoproject
|
||||||
|
.idea
|
|
@ -167,12 +167,13 @@ class Model_Minion_Migration extends Model
|
||||||
*/
|
*/
|
||||||
public function ensure_table_exists()
|
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))
|
if ( ! count($query))
|
||||||
{
|
{
|
||||||
$sql = View::factory('minion/task/migrations/schema')
|
$sql = View::factory('minion/task/migrations/schema')
|
||||||
->set('table_name', $this->_table)
|
->set('table_name', $table)
|
||||||
->render();
|
->render();
|
||||||
|
|
||||||
$this->_db->query(NULL, $sql);
|
$this->_db->query(NULL, $sql);
|
||||||
|
|
Loading…
Reference in a new issue