id(); $table->string('name')->comment('设备名称'); $table->string('sn')->comment('设备唯一编码'); $table->string('powered_by')->nullable()->comment('厂家'); $table->string('model_sn')->nullable()->comment('型号'); $table->unsignedTinyInteger('type')->comment('类型: 1 监控设备, 2 土壤设备, 3 水质设备, 4 气象设备'); $table->unsignedTinyInteger('state')->default(2)->comment('状态: 0 禁用, 1 在线, 2 离线, 3 故障'); $table->text('extends')->nullable()->comment('扩展信息'); $table->unsignedTinyInteger('is_recommend')->default(0)->comment('推荐开关'); $table->unsignedTinyInteger('is_enable')->default(1)->comment('显示开关'); $table->unsignedInteger('sort')->default(0)->comment('排序'); $table->timestamps(); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::dropIfExists('devices'); } };