mirror of
https://github.com/wavelog/wavelog.git
synced 2026-03-22 10:24:14 +00:00
Make mig more failsafe
This commit is contained in:
@@ -10,8 +10,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
|
|||||||
|
|
||||||
class Migration_add_bandedges extends CI_Migration {
|
class Migration_add_bandedges extends CI_Migration {
|
||||||
|
|
||||||
public function up()
|
public function up() {
|
||||||
{
|
|
||||||
if (!$this->db->table_exists('bandedges')) {
|
if (!$this->db->table_exists('bandedges')) {
|
||||||
// Create the bandedges table
|
// Create the bandedges table
|
||||||
$this->dbforge->add_field([
|
$this->dbforge->add_field([
|
||||||
@@ -92,11 +91,12 @@ class Migration_add_bandedges extends CI_Migration {
|
|||||||
|
|
||||||
$this->db->insert_batch('bandedges', $data);
|
$this->db->insert_batch('bandedges', $data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function down()
|
public function down() {
|
||||||
{
|
if ($this->db->table_exists('bandedges')) {
|
||||||
$this->dbforge->drop_table('bandedges');
|
$this->dbforge->drop_table('bandedges');
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user