12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273 |
- <?php
- use think\migration\Migrator;
- use think\migration\db\Column;
- use Phinx\Db\Adapter\MysqlAdapter;
- class Station 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', ['engine' => 'InnoDB', 'comment' => '' ,'id' => 'id','signed' => true ,'primary_key' => ['id']]);
- $table->addColumn('station_name', 'string', ['limit' => 50,'null' => true,'signed' => true,'comment' => '基站名称',])
- ->addColumn('station_mac', 'string', ['limit' => 20,'null' => true,'signed' => true,'comment' => '基站Mac',])
- ->addColumn('station_code', 'string', ['limit' => 20,'null' => true,'signed' => true,'comment' => '基站简码',])
- ->addColumn('station_type', 'integer', ['limit' => MysqlAdapter::INT_REGULAR,'null' => false,'default' => 0,'signed' => true,'comment' => '基站类型',])
- ->addColumn('longitude', 'decimal', ['precision' => 10,'scale' => 6,'null' => true,'signed' => true,'comment' => '经度',])
- ->addColumn('latitude', 'decimal', ['precision' => 10,'scale' => 6,'null' => true,'signed' => true,'comment' => '纬度',])
- ->addColumn('coordinate_x', 'integer', ['limit' => 4,'null' => true,'signed' => true,'comment' => 'x轴坐标',])
- ->addColumn('coordinate_y', 'integer', ['limit' => 4,'null' => true,'signed' => true,'comment' => 'y轴坐标',])
- ->addColumn('access_id', 'integer', ['limit' => MysqlAdapter::INT_REGULAR,'null' => true,'signed' => true,'comment' => '出入口id',])
- ->addColumn('province_id', 'integer', ['limit' => MysqlAdapter::INT_REGULAR,'null' => true,'signed' => true,'comment' => '省',])
- ->addColumn('city_id', 'integer', ['limit' => MysqlAdapter::INT_REGULAR,'null' => true,'signed' => true,'comment' => '市',])
- ->addColumn('district_id', 'integer', ['limit' => MysqlAdapter::INT_REGULAR,'null' => true,'signed' => true,'comment' => '县区',])
- ->addColumn('online_time', 'datetime', ['null' => true,'signed' => true,'comment' => '在线时间',])
- ->addColumn('install_photo', 'string', ['limit' => 200,'null' => true,'signed' => true,'comment' => '安装图片',])
- ->addColumn('orientation', 'integer', ['limit' => MysqlAdapter::INT_REGULAR,'null' => false,'default' => 0,'signed' => true,'comment' => '基站朝向 0-未知 1-朝外 2-朝内',])
- ->addColumn('school_id', 'integer', ['limit' => MysqlAdapter::INT_REGULAR,'null' => true,'signed' => true,'comment' => '学校id',])
- ->addColumn('station_model', 'string', ['limit' => 20,'null' => true,'signed' => true,'comment' => '基站型号',])
- ->addColumn('station_sn', 'string', ['limit' => 50,'null' => true,'signed' => true,'comment' => '基站串号',])
- ->addColumn('station_version', 'string', ['limit' => 20,'null' => true,'signed' => true,'comment' => '基站版本',])
- ->addColumn('wan_ip', 'string', ['limit' => 20,'null' => true,'signed' => true,'comment' => 'WAN口IP',])
- ->addColumn('net_model', 'integer', ['limit' => MysqlAdapter::INT_REGULAR,'null' => false,'default' => 0,'signed' => true,'comment' => '网络模式 0-静态地址,1-动态获取,2-PPPOE拨号,3-3G拨号,4-4G拨号',])
- ->addColumn('rssi', 'string', ['limit' => 10,'null' => true,'signed' => true,'comment' => '信号强度(dbm)',])
- ->addColumn('sim_serial_number', 'string', ['limit' => 50,'null' => true,'signed' => true,'comment' => 'sim卡序列号',])
- ->addColumn('cmcc_phone_id', 'string', ['limit' => 50,'null' => true,'signed' => true,'comment' => '话机编号',])
- ->addColumn('attendance_config', 'text', ['limit' => MysqlAdapter::TEXT_REGULAR,'null' => true,'signed' => true,'comment' => '考勤配置',])
- ->addColumn('device_status', 'text', ['limit' => MysqlAdapter::TEXT_REGULAR,'null' => true,'signed' => true,'comment' => '设备状态',])
-
- ->addColumn('rssi_sensitive', 'integer', ['limit' => MysqlAdapter::INT_REGULAR,'null' => false,'default' => 62,'signed' => true,'comment' => '信号灵敏度 默认62,大于此值会被过滤',])
- ->addColumn('throttling', 'integer', ['limit' => MysqlAdapter::INT_REGULAR,'null' => false,'default' => 0,'signed' => true,'comment' => '节流 0-关闭,1-开启',])
- ->addColumn('address', 'string', ['limit' => 100,'null' => true,'signed' => true,'comment' => '安装地址',])
- ->addColumn('enable_push_qywx', 'boolean', ['null' => false,'default' => 0,'signed' => true,'comment' => '推送企业微信0-否,1-是',])
- ->addColumn('building_id', 'integer', ['limit' => MysqlAdapter::INT_REGULAR,'null' => true,'signed' => true,'comment' => '建筑id',])
- ->addColumn('floor_id', 'integer', ['limit' => MysqlAdapter::INT_REGULAR,'null' => true,'signed' => true,'comment' => '楼层id',])
- ->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();
- }
- }
|