12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273 |
- <?php
- use think\migration\Migrator;
- use think\migration\db\Column;
- use Phinx\Db\Adapter\MysqlAdapter;
- class StationHeartbeat extends Migrator
- {
- /**
- * Change Method.
- *
- * Write your reversible migrations using this method.
- *
- * More information on writing migrations is available here:
- * http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
- *
- * The following commands can be used in this method and Phinx will
- * automatically reverse them when rolling back:
- *
- * createTable
- * renameTable
- * addColumn
- * renameColumn
- * addIndex
- * addForeignKey
- *
- * Remember to call "create()" or "update()" and NOT "save()" when working
- * with the Table class.
- */
- public function change()
- {
- $table = $this->table('station_heartbeat', ['engine' => 'InnoDB', 'comment' => '' ,'id' => 'id','signed' => true ,'primary_key' => ['id']]);
- $table->addColumn('device_id', 'string', ['limit' => 50,'null' => true,'signed' => true,'comment' => '设备ID',])
- ->addColumn('device_imei', 'string', ['limit' => 50,'null' => true,'signed' => true,'comment' => '设备Imei',])
- ->addColumn('station_sn', 'string', ['limit' => 50,'null' => true,'signed' => true,'comment' => '序列号',])
- ->addColumn('core_version', 'string', ['limit' => 50,'null' => true,'signed' => true,'comment' => '底层固件版本号',])
- ->addColumn('script_version', 'string', ['limit' => 50,'null' => true,'signed' => true,'comment' => '脚本版本号',])
- ->addColumn('sim_iccid', 'string', ['limit' => 50,'null' => true,'signed' => true,'comment' => 'sim卡iccid',])
- ->addColumn('sim_imsi', 'string', ['limit' => 50,'null' => true,'signed' => true,'comment' => 'sim卡imsi',])
- ->addColumn('add_time', 'datetime', ['null' => true,'signed' => true,'comment' => '请求时间',])
- ->addColumn('ddzx_ip', 'string', ['limit' => 50,'null' => true,'signed' => true,'comment' => '调度中心ip',])
- ->addColumn('ddzx_tcp_port', 'string', ['limit' => 50,'null' => true,'signed' => true,'comment' => '调度中心tcp端口',])
- ->addColumn('ddzx_wait_recv_msg_max_time', 'integer', ['limit' => MysqlAdapter::INT_REGULAR,'null' => true,'signed' => true,'comment' => '等待接收超时时间',])
- ->addColumn('rfid_offline_timeout', 'integer', ['limit' => MysqlAdapter::INT_REGULAR,'null' => true,'signed' => true,'comment' => 'rfid离线超时时间',])
- ->addColumn('dev_reboot_time', 'string', ['limit' => 50,'null' => true,'signed' => true,'comment' => '设备定时重启时间',])
- ->addColumn('http_devops_interval', 'integer', ['limit' => MysqlAdapter::INT_REGULAR,'null' => true,'signed' => true,'comment' => 'http运维通道请求间隔',])
- ->addColumn('rfid_rssi_filter_val', 'integer', ['limit' => MysqlAdapter::INT_REGULAR,'null' => true,'signed' => true,'comment' => 'rssi信号过滤值',])
- ->addColumn('response_content', 'text', ['limit' => MysqlAdapter::TEXT_REGULAR,'null' => true,'signed' => true,'comment' => '响应内容',])
- ->addColumn('response_time', 'datetime', ['null' => true,'signed' => true,'comment' => '响应时间',])
- ->addColumn('ota_check_interval', 'integer', ['limit' => MysqlAdapter::INT_REGULAR,'null' => true,'signed' => true,'comment' => '空中升级检测周期',])
- ->addColumn('error_log_report_url', 'string', ['limit' => 100,'null' => true,'signed' => true,'comment' => '错误日志上报地址',])
- ->addColumn('error_log_report_interval', 'integer', ['limit' => MysqlAdapter::INT_REGULAR,'null' => true,'signed' => true,'comment' => '错误日志上报间隔',])
- ->addColumn('boot_num', 'integer', ['limit' => MysqlAdapter::INT_REGULAR,'null' => true,'signed' => true,'comment' => '设备开机次数',])
- ->addColumn('data_ip', 'string', ['limit' => 50,'null' => true,'signed' => true,'comment' => '数据通道IP',])
- ->addColumn('data_tcp_port', 'string', ['limit' => 50,'null' => true,'signed' => true,'comment' => '数据通道TCP端口',])
- ->addColumn('data_udp_port', 'string', ['limit' => 50,'null' => true,'signed' => true,'comment' => '数据通道UDP端口',])
- ->addColumn('rfid_report_interval_rlian', 'integer', ['limit' => MysqlAdapter::INT_REGULAR,'null' => true,'signed' => true,'comment' => 'rfid数据上报周期',])
- ->addColumn('rfid_buffer_max_count_rlian', 'integer', ['limit' => MysqlAdapter::INT_REGULAR,'null' => true,'signed' => true,'comment' => 'rfid缓存信号数',])
- ->addColumn('rfid_enable_throttle_rlian', 'integer', ['limit' => MysqlAdapter::INT_REGULAR,'null' => true,'signed' => true,'comment' => '是否启用节流模式',])
- ->addColumn('rfid_offline_timeout_rlian', 'integer', ['limit' => MysqlAdapter::INT_REGULAR,'null' => true,'signed' => true,'comment' => 'rfid离线时间阀值',])
- ->addColumn('dev_model', 'string', ['limit' => 50,'null' => true,'signed' => true,'comment' => '设备型号',])
- ->addColumn('ram_used', 'string', ['limit' => 50,'null' => true,'signed' => true,'comment' => '使用内存',])
- ->addColumn('free_flash', 'string', ['limit' => 50,'null' => true,'signed' => true,'comment' => '剩余flash空间',])
- ->addColumn('net_rssi', 'string', ['limit' => 50,'null' => true,'signed' => true,'comment' => '4G信号强度',])
- ->addColumn('rfid_min_diff_time', 'integer', ['limit' => MysqlAdapter::INT_REGULAR,'null' => true,'signed' => true,'comment' => '首末次信号最小时间差',])
- ->addColumn('creator_id', 'integer', ['limit' => MysqlAdapter::INT_REGULAR,'null' => false,'default' => 0,'signed' => false,'comment' => '创建人ID',])
- ->addColumn('created_at', 'integer', ['limit' => MysqlAdapter::INT_REGULAR,'null' => false,'default' => 0,'signed' => false,'comment' => '创建时间',])
- ->addColumn('updated_at', 'integer', ['limit' => MysqlAdapter::INT_REGULAR,'null' => false,'default' => 0,'signed' => false,'comment' => '更新时间',])
- ->addColumn('deleted_at', 'integer', ['limit' => MysqlAdapter::INT_REGULAR,'null' => false,'default' => 0,'signed' => false,'comment' => '软删除',])
- ->create();
- }
- }
|