Add DB migration for station_power

这个提交包含在:
phl0 2023-04-27 23:09:31 +02:00
父节点 75ac1b2620
当前提交 a593efc2f6
找不到此签名对应的密钥
GPG 密钥 ID: 48EA1E640798CA9A
共有 2 个文件被更改,包括 25 次插入1 次删除

查看文件

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

查看文件

@ -0,0 +1,24 @@
<?php
defined('BASEPATH') or exit('No direct script access allowed');
class Migration_add_station_power extends CI_Migration
{
public function up()
{
$fields = array(
'station_power SMALLINT NULL DEFAULT NULL AFTER `station_callsign`',
);
if (!$this->db->field_exists('station_power', 'station_profile')) {
$this->dbforge->add_column('station_profile', $fields);
}
}
public function down()
{
if ($this->db->field_exists('station_power', 'station_profile')) {
$this->dbforge->drop_column('station_profile', 'station_power');
}
}
}