ajun пре 4 година
родитељ
комит
9e64ffc1de

+ 42 - 0
database/migrations/2021_08_04_093716_create_work_orders_table.php

@@ -0,0 +1,42 @@
+<?php
+
+use Illuminate\Database\Migrations\Migration;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Support\Facades\Schema;
+
+class CreateWorkOrdersTable extends Migration
+{
+    /**
+     * Run the migrations.
+     *
+     * @return void
+     */
+    public function up()
+    {
+        Schema::create('work_orders', function (Blueprint $table) {
+            $table->id();
+            $table->integer('creator_id')->comment('创建人');
+            $table->integer('reviewer_id')->comment('审核人');
+            $table->integer('work_order_type_id')->comment('类型');
+            $table->integer('work_order_child_type_id')->comment('子类型');
+            $table->string('outer_table_name')->comment('关联表名');
+            $table->integer('outer_table_id')->comment('关联表id');
+            $table->tinyInteger('grad')->comment('工单等级');
+            $table->tinyInteger('status')->comment('工单状态');
+            $table->string('remark')->comment('描述信息');
+            $table->dateTime('review_at')->default(null)->nullable()->comment('审核时间');
+            $table->softDeletes();
+            $table->timestamps();
+        });
+    }
+
+    /**
+     * Reverse the migrations.
+     *
+     * @return void
+     */
+    public function down()
+    {
+        Schema::dropIfExists('work_orders');
+    }
+}

+ 32 - 0
database/migrations/2021_08_04_101843_create_work_order_types_table.php

@@ -0,0 +1,32 @@
+<?php
+
+use Illuminate\Database\Migrations\Migration;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Support\Facades\Schema;
+
+class CreateWorkOrderTypesTable extends Migration
+{
+    /**
+     * Run the migrations.
+     *
+     * @return void
+     */
+    public function up()
+    {
+        Schema::create('work_order_types', function (Blueprint $table) {
+            $table->id();
+            $table->string('name')->comment('工单类型');
+            $table->timestamps();
+        });
+    }
+
+    /**
+     * Reverse the migrations.
+     *
+     * @return void
+     */
+    public function down()
+    {
+        Schema::dropIfExists('work_order_types');
+    }
+}

+ 34 - 0
database/migrations/2021_08_04_101906_create_work_order_child_types_table.php

@@ -0,0 +1,34 @@
+<?php
+
+use Illuminate\Database\Migrations\Migration;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Support\Facades\Schema;
+
+class CreateWorkOrderChildTypesTable extends Migration
+{
+    /**
+     * Run the migrations.
+     *
+     * @return void
+     */
+    public function up()
+    {
+        Schema::create('work_order_child_types', function (Blueprint $table) {
+            $table->id();
+            $table->tinyInteger('work_order_type_id')->comment('工单类型');
+            $table->string('name')->comment('子类型名称');
+            $table->string('table_name')->comment('关联表');
+            $table->timestamps();
+        });
+    }
+
+    /**
+     * Reverse the migrations.
+     *
+     * @return void
+     */
+    public function down()
+    {
+        Schema::dropIfExists('work_order_child_types');
+    }
+}