| xqd
@@ -0,0 +1,106 @@
|
|
|
+<?php
|
|
|
+
|
|
|
+use Illuminate\Support\Facades\Schema;
|
|
|
+use Illuminate\Database\Schema\Blueprint;
|
|
|
+use Illuminate\Database\Migrations\Migration;
|
|
|
+use Illuminate\Support\Facades\DB;
|
|
|
+
|
|
|
+class AddAllDevicesTableComment extends Migration
|
|
|
+{
|
|
|
+ public function boot()
|
|
|
+ {
|
|
|
+ Schema::defaultStringLength(191);
|
|
|
+ }
|
|
|
+ /**
|
|
|
+ * Run the migrations.
|
|
|
+ *
|
|
|
+ * @return void
|
|
|
+ */
|
|
|
+ public function up()
|
|
|
+ {
|
|
|
+ //inner_devices表
|
|
|
+ Schema::table('inner_devices', function (Blueprint $table) {
|
|
|
+ $table->string('device_name_id')->comment('设备名称编号')->change();
|
|
|
+ $table->string('quantity')->comment('数量')->change();
|
|
|
+ $table->string('id')->comment('自增id')->change();
|
|
|
+ $table->string('name')->comment('名称')->change();
|
|
|
+ $table->string('project_id')->comment('项目名称id')->change();
|
|
|
+ $table->string('work_point_id')->comment('工点id')->change();
|
|
|
+ });
|
|
|
+ DB::statement("ALTER TABLE `inner_devices` comment '内部设备表'");
|
|
|
+
|
|
|
+ //order_devices 租赁设备表
|
|
|
+ Schema::table('order_devices', function (Blueprint $table) {
|
|
|
+ $table->string('id')->comment('自增id')->change();
|
|
|
+ $table->string('name')->comment('名称')->change();
|
|
|
+ $table->string('order_id')->comment('订单id')->change();
|
|
|
+ $table->string('user_id')->comment('用户id')->change();
|
|
|
+ $table->string('project_id')->comment('项目名称id')->change();
|
|
|
+ $table->string('device_id')->comment('设备类型id')->change();
|
|
|
+ $table->string('inner_device_id')->comment('内部设备id')->change();
|
|
|
+ $table->string('spec_id')->comment('设备类型id')->change();
|
|
|
+ $table->string('device_name_id')->comment('设备名称编号')->change();
|
|
|
+ $table->string('quantity')->comment('数量')->change();
|
|
|
+ $table->string('price')->comment('单价 单位:分')->change();
|
|
|
+ $table->string('created_at')->comment('创建时间')->change();
|
|
|
+ $table->string('updated_at')->comment('更新时间')->change();
|
|
|
+ $table->string('start_date')->comment('租赁开始时间')->change();
|
|
|
+ $table->string('end_date')->comment('租赁结束时间')->change();
|
|
|
+ });
|
|
|
+ DB::statement("ALTER TABLE `order_devices` comment '租赁设备表'");
|
|
|
+
|
|
|
+
|
|
|
+ //devices表
|
|
|
+ Schema::table('devices', function (Blueprint $table) {
|
|
|
+ $table->string('id')->comment('自增id')->change();
|
|
|
+ $table->string('name')->comment('设备类型名称')->change();
|
|
|
+ $table->string('sort')->comment('排序等级')->change();
|
|
|
+ $table->string('created_at')->comment('创建时间')->change();
|
|
|
+ $table->string('updated_at')->comment('更新时间')->change();
|
|
|
+ });
|
|
|
+ DB::statement("ALTER TABLE `devices` comment '设备类型表'");
|
|
|
+
|
|
|
+
|
|
|
+ //device_names表
|
|
|
+ Schema::table('device_names', function (Blueprint $table) {
|
|
|
+ $table->string('id')->comment('自增id')->change();
|
|
|
+ $table->string('name')->comment('设备名称')->change();
|
|
|
+ $table->string('sort')->comment('排序等级')->change();
|
|
|
+ $table->string('created_at')->comment('创建时间')->change();
|
|
|
+ $table->string('updated_at')->comment('更新时间')->change();
|
|
|
+ });
|
|
|
+ DB::statement("ALTER TABLE `device_names` comment '设备名称表'");
|
|
|
+
|
|
|
+
|
|
|
+ //repair_devices 表
|
|
|
+ Schema::table('repair_devices', function (Blueprint $table) {
|
|
|
+ $table->string('id')->comment('自增id')->change();
|
|
|
+ $table->string('user_id')->comment('用户id')->change();
|
|
|
+ $table->string('project_id')->comment('项目id')->change();
|
|
|
+ $table->string('work_point_id')->comment('工点id')->change();
|
|
|
+ $table->string('inner_device_id')->comment('内部设备id')->change();
|
|
|
+ $table->string('money')->comment('维修总金额')->change();
|
|
|
+ $table->string('reason')->comment('维修原因')->change();
|
|
|
+ $table->string('day')->comment('维修日期')->change();
|
|
|
+ $table->string('remark')->comment('备注')->change();
|
|
|
+ $table->string('start_date')->comment('开始时间')->change();
|
|
|
+ $table->string('end_date')->comment('结束时间')->change();
|
|
|
+ $table->string('created_at')->comment('创建时间')->change();
|
|
|
+ $table->string('updated_at')->comment('更新时间')->change();
|
|
|
+
|
|
|
+ });
|
|
|
+ DB::statement("ALTER TABLE `repair_devices` comment '维修记录表'");
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Reverse the migrations.
|
|
|
+ *
|
|
|
+ * @return void
|
|
|
+ */
|
|
|
+ public function down()
|
|
|
+ {
|
|
|
+ //
|
|
|
+ }
|
|
|
+}
|