Просмотр исходного кода

弥被stationType的迁移数据

LD 5 лет назад
Родитель
Сommit
e4adbdb762

+ 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();
+    }
+}