Make sure tables dont exist before running migration
这个提交包含在:
父节点
79d9167e8b
当前提交
a80089f97c
共有 2 个文件被更改,包括 61 次插入 和 57 次删除
|
|
@ -11,6 +11,7 @@ class Migration_create_station_logbook_table extends CI_Migration {
|
||||||
|
|
||||||
public function up()
|
public function up()
|
||||||
{
|
{
|
||||||
|
if (!$this->db->table_exists('station_logbooks')) {
|
||||||
$this->dbforge->add_field(array(
|
$this->dbforge->add_field(array(
|
||||||
'logbook_id' => array(
|
'logbook_id' => array(
|
||||||
'type' => 'BIGINT',
|
'type' => 'BIGINT',
|
||||||
|
|
@ -44,6 +45,7 @@ class Migration_create_station_logbook_table extends CI_Migration {
|
||||||
|
|
||||||
$this->dbforge->create_table('station_logbooks');
|
$this->dbforge->create_table('station_logbooks');
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public function down()
|
public function down()
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,7 @@ class Migration_create_station_logbook_relationship_table extends CI_Migration {
|
||||||
|
|
||||||
public function up()
|
public function up()
|
||||||
{
|
{
|
||||||
|
if (!$this->db->table_exists('station_logbooks_relationship')) {
|
||||||
$this->dbforge->add_field(array(
|
$this->dbforge->add_field(array(
|
||||||
'logbook_relation_id' => array(
|
'logbook_relation_id' => array(
|
||||||
'type' => 'BIGINT',
|
'type' => 'BIGINT',
|
||||||
|
|
@ -46,6 +47,7 @@ class Migration_create_station_logbook_relationship_table extends CI_Migration {
|
||||||
|
|
||||||
$this->dbforge->create_table('station_logbooks_relationship');
|
$this->dbforge->create_table('station_logbooks_relationship');
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public function down()
|
public function down()
|
||||||
{
|
{
|
||||||
|
|
|
||||||
正在加载…
在新工单中引用