table('maintain_log', ['engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '维护记录' ,'id' => 'id','signed' => true ,'primary_key' => ['id']]); $table->addColumn('device_number', 'string', ['limit' => 32,'null' => true,'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('device_state', 'string', ['limit' => 32,'null' => true,'signed' => true,'comment' => '设备状态',]) ->addColumn('online_time', 'integer', ['limit' => MysqlAdapter::INT_REGULAR,'null' => true,'signed' => true,'comment' => '运行时间',]) ->addColumn('info', 'string', ['limit' => 64,'null' => false,'default' => '','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(); } }