Make sure that sstv images table doesnt already exist

这个提交包含在:
Peter Goodhall 2024-03-28 15:22:01 +00:00
父节点 ab8abd1ccc
当前提交 41bc9b3e1b

查看文件

@ -1,37 +1,41 @@
<?php <?php
defined('BASEPATH') OR exit('No direct script access allowed'); defined('BASEPATH') or exit('No direct script access allowed');
class Migration_add_sstv_images_table extends CI_Migration { class Migration_add_sstv_images_table extends CI_Migration
{
public function up() public function up()
{ {
$this->dbforge->add_field(array( // if sstv_images table doesn't exist
'id' => array( if (!$this->db->table_exists('sstv_images')) {
'type' => 'INT', $this->dbforge->add_field(array(
'constraint' => 5, 'id' => array(
'unsigned' => TRUE, 'type' => 'INT',
'auto_increment' => TRUE 'constraint' => 5,
), 'unsigned' => TRUE,
'qsoid' => array( 'auto_increment' => TRUE
'type' => 'VARCHAR', ),
'constraint' => '250', 'qsoid' => array(
), 'type' => 'VARCHAR',
'filename' => array( 'constraint' => '250',
'type' => 'VARCHAR', ),
'constraint' => '250', 'filename' => array(
), 'type' => 'VARCHAR',
'modified' => array( 'constraint' => '250',
'type' => 'timestamp', ),
'null' => TRUE, 'modified' => array(
), 'type' => 'timestamp',
)); 'null' => TRUE,
$this->dbforge->add_key('id', TRUE); ),
$this->dbforge->create_table('sstv_images'); ));
$this->dbforge->add_key('id', TRUE);
$this->dbforge->create_table('sstv_images');
}
} }
public function down() public function down()
{ {
echo "not possible"; echo "not possible";
} }
} }