mirror of
https://github.com/Oreolek/kohana-migrations.git
synced 2024-06-26 03:40:54 +03:00
table name with prefix also in checking query
This commit is contained in:
parent
5ffab5e738
commit
5d1e612515
|
@ -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->_db->table_prefix() . $this->_table)
|
->set('table_name', $table)
|
||||||
->render();
|
->render();
|
||||||
|
|
||||||
$this->_db->query(NULL, $sql);
|
$this->_db->query(NULL, $sql);
|
||||||
|
|
Loading…
Reference in a new issue