20210601101625_station_heartbeat.php 6.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. <?php
  2. use think\migration\Migrator;
  3. use think\migration\db\Column;
  4. use Phinx\Db\Adapter\MysqlAdapter;
  5. class StationHeartbeat extends Migrator
  6. {
  7. /**
  8. * Change Method.
  9. *
  10. * Write your reversible migrations using this method.
  11. *
  12. * More information on writing migrations is available here:
  13. * http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
  14. *
  15. * The following commands can be used in this method and Phinx will
  16. * automatically reverse them when rolling back:
  17. *
  18. * createTable
  19. * renameTable
  20. * addColumn
  21. * renameColumn
  22. * addIndex
  23. * addForeignKey
  24. *
  25. * Remember to call "create()" or "update()" and NOT "save()" when working
  26. * with the Table class.
  27. */
  28. public function change()
  29. {
  30. $table = $this->table('station_heartbeat', ['engine' => 'InnoDB', 'comment' => '' ,'id' => 'id','signed' => true ,'primary_key' => ['id']]);
  31. $table->addColumn('device_id', 'string', ['limit' => 50,'null' => true,'signed' => true,'comment' => '设备ID',])
  32. ->addColumn('device_imei', 'string', ['limit' => 50,'null' => true,'signed' => true,'comment' => '设备Imei',])
  33. ->addColumn('station_sn', 'string', ['limit' => 50,'null' => true,'signed' => true,'comment' => '序列号',])
  34. ->addColumn('core_version', 'string', ['limit' => 50,'null' => true,'signed' => true,'comment' => '底层固件版本号',])
  35. ->addColumn('script_version', 'string', ['limit' => 50,'null' => true,'signed' => true,'comment' => '脚本版本号',])
  36. ->addColumn('sim_iccid', 'string', ['limit' => 50,'null' => true,'signed' => true,'comment' => 'sim卡iccid',])
  37. ->addColumn('sim_imsi', 'string', ['limit' => 50,'null' => true,'signed' => true,'comment' => 'sim卡imsi',])
  38. ->addColumn('add_time', 'datetime', ['null' => true,'signed' => true,'comment' => '请求时间',])
  39. ->addColumn('ddzx_ip', 'string', ['limit' => 50,'null' => true,'signed' => true,'comment' => '调度中心ip',])
  40. ->addColumn('ddzx_tcp_port', 'string', ['limit' => 50,'null' => true,'signed' => true,'comment' => '调度中心tcp端口',])
  41. ->addColumn('ddzx_wait_recv_msg_max_time', 'integer', ['limit' => MysqlAdapter::INT_REGULAR,'null' => true,'signed' => true,'comment' => '等待接收超时时间',])
  42. ->addColumn('rfid_offline_timeout', 'integer', ['limit' => MysqlAdapter::INT_REGULAR,'null' => true,'signed' => true,'comment' => 'rfid离线超时时间',])
  43. ->addColumn('dev_reboot_time', 'string', ['limit' => 50,'null' => true,'signed' => true,'comment' => '设备定时重启时间',])
  44. ->addColumn('http_devops_interval', 'integer', ['limit' => MysqlAdapter::INT_REGULAR,'null' => true,'signed' => true,'comment' => 'http运维通道请求间隔',])
  45. ->addColumn('rfid_rssi_filter_val', 'integer', ['limit' => MysqlAdapter::INT_REGULAR,'null' => true,'signed' => true,'comment' => 'rssi信号过滤值',])
  46. ->addColumn('response_content', 'text', ['limit' => MysqlAdapter::TEXT_REGULAR,'null' => true,'signed' => true,'comment' => '响应内容',])
  47. ->addColumn('response_time', 'datetime', ['null' => true,'signed' => true,'comment' => '响应时间',])
  48. ->addColumn('ota_check_interval', 'integer', ['limit' => MysqlAdapter::INT_REGULAR,'null' => true,'signed' => true,'comment' => '空中升级检测周期',])
  49. ->addColumn('error_log_report_url', 'string', ['limit' => 100,'null' => true,'signed' => true,'comment' => '错误日志上报地址',])
  50. ->addColumn('error_log_report_interval', 'integer', ['limit' => MysqlAdapter::INT_REGULAR,'null' => true,'signed' => true,'comment' => '错误日志上报间隔',])
  51. ->addColumn('boot_num', 'integer', ['limit' => MysqlAdapter::INT_REGULAR,'null' => true,'signed' => true,'comment' => '设备开机次数',])
  52. ->addColumn('data_ip', 'string', ['limit' => 50,'null' => true,'signed' => true,'comment' => '数据通道IP',])
  53. ->addColumn('data_tcp_port', 'string', ['limit' => 50,'null' => true,'signed' => true,'comment' => '数据通道TCP端口',])
  54. ->addColumn('data_udp_port', 'string', ['limit' => 50,'null' => true,'signed' => true,'comment' => '数据通道UDP端口',])
  55. ->addColumn('rfid_report_interval_rlian', 'integer', ['limit' => MysqlAdapter::INT_REGULAR,'null' => true,'signed' => true,'comment' => 'rfid数据上报周期',])
  56. ->addColumn('rfid_buffer_max_count_rlian', 'integer', ['limit' => MysqlAdapter::INT_REGULAR,'null' => true,'signed' => true,'comment' => 'rfid缓存信号数',])
  57. ->addColumn('rfid_enable_throttle_rlian', 'integer', ['limit' => MysqlAdapter::INT_REGULAR,'null' => true,'signed' => true,'comment' => '是否启用节流模式',])
  58. ->addColumn('rfid_offline_timeout_rlian', 'integer', ['limit' => MysqlAdapter::INT_REGULAR,'null' => true,'signed' => true,'comment' => 'rfid离线时间阀值',])
  59. ->addColumn('dev_model', 'string', ['limit' => 50,'null' => true,'signed' => true,'comment' => '设备型号',])
  60. ->addColumn('ram_used', 'string', ['limit' => 50,'null' => true,'signed' => true,'comment' => '使用内存',])
  61. ->addColumn('free_flash', 'string', ['limit' => 50,'null' => true,'signed' => true,'comment' => '剩余flash空间',])
  62. ->addColumn('net_rssi', 'string', ['limit' => 50,'null' => true,'signed' => true,'comment' => '4G信号强度',])
  63. ->addColumn('rfid_min_diff_time', 'integer', ['limit' => MysqlAdapter::INT_REGULAR,'null' => true,'signed' => true,'comment' => '首末次信号最小时间差',])
  64. ->addColumn('creator_id', 'integer', ['limit' => MysqlAdapter::INT_REGULAR,'null' => false,'default' => 0,'signed' => false,'comment' => '创建人ID',])
  65. ->addColumn('created_at', 'integer', ['limit' => MysqlAdapter::INT_REGULAR,'null' => false,'default' => 0,'signed' => false,'comment' => '创建时间',])
  66. ->addColumn('updated_at', 'integer', ['limit' => MysqlAdapter::INT_REGULAR,'null' => false,'default' => 0,'signed' => false,'comment' => '更新时间',])
  67. ->addColumn('deleted_at', 'integer', ['limit' => MysqlAdapter::INT_REGULAR,'null' => false,'default' => 0,'signed' => false,'comment' => '软删除',])
  68. ->create();
  69. }
  70. }