瀏覽代碼

弥被stationType的迁移数据

LD 5 年之前
父節點
當前提交
e4adbdb762
共有 1 個文件被更改,包括 30 次插入0 次删除
  1. 30 0
      database/migrations/2021_05_31_140957_create_station_types2_table.php

+ 30 - 0
database/migrations/2021_05_31_140957_create_station_types2_table.php

@@ -0,0 +1,30 @@
+<?php
+
+use App\StationType;
+use Illuminate\Database\Migrations\Migration;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Support\Facades\Schema;
+
+class CreateStationTypes2Table extends Migration
+{
+    /**
+     * Run the migrations.
+     *
+     * @return void
+     */
+    public function up()
+    {
+        StationType::query()->firstOrCreate(['name'=>'立库']);
+        StationType::query()->firstOrCreate(['name'=>'缓存架']);
+    }
+
+    /**
+     * Reverse the migrations.
+     *
+     * @return void
+     */
+    public function down()
+    {
+        StationType::query()->whereIn('name',['立库','缓存架'])->delete();
+    }
+}