Restore initial data type of frequency column in cat table

Signed-off-by: phl0 <github@florian-wolters.de>
这个提交包含在:
phl0 2022-09-30 11:11:11 +02:00 提交者 kb-light
父节点 b081ab5449
当前提交 43f46f9879
共有 2 个文件被更改,包括 46 次插入1 次删除

查看文件

@ -21,7 +21,7 @@ $config['migration_enabled'] = TRUE;
| be upgraded / downgraded to.
|
*/
$config['migration_version'] = 100;
$config['migration_version'] = 101;
/*
|--------------------------------------------------------------------------

查看文件

@ -0,0 +1,45 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
/*
Restore initial field settings for frequency as it
broke with commit f6feea5
*/
class Migration_make_frequency_bigint_again extends CI_Migration {
public function up()
{
if ($this->db->table_exists('cat')) {
if ($this->db->field_exists('frequency', 'cat')) {
$fields = array(
'frequency' => array(
'name' => 'frequency',
'type' => 'BIGINT',
'null' => TRUE,
'default' => NULL,
),
);
$this->dbforge->modify_column('cat', $fields);
}
}
}
public function down()
{
if ($this->db->table_exists('cat')) {
if ($this->db->field_exists('frequency', 'cat')) {
$fields = array(
'frequency' => array(
'name' => 'frequency',
'type' => 'VARCHAR(10)',
'null' => TRUE,
'default' => NULL,
),
);
$this->dbforge->modify_column('cat', $fields);
}
}
}
}