|
|
@@ -1,45 +0,0 @@
|
|
|
-<?php
|
|
|
-
|
|
|
-use Illuminate\Database\Migrations\Migration;
|
|
|
-use Illuminate\Database\Schema\Blueprint;
|
|
|
-use Illuminate\Support\Facades\Schema;
|
|
|
-
|
|
|
-class CreateDeliveryAppointmentsTable extends Migration
|
|
|
-{
|
|
|
- public $authorities = [
|
|
|
- "入库管理-盘收一体-客户预约",
|
|
|
- ];
|
|
|
- /**
|
|
|
- * Run the migrations.
|
|
|
- *
|
|
|
- * @return void
|
|
|
- */
|
|
|
- public function up()
|
|
|
- {
|
|
|
- Schema::create('delivery_appointments', function (Blueprint $table) {
|
|
|
- $table->id();
|
|
|
- $table->timestamps();
|
|
|
- });
|
|
|
- foreach ($this->authorities as $authority){
|
|
|
- \App\Authority::query()->firstOrCreate([
|
|
|
- "name"=>$authority
|
|
|
- ],[
|
|
|
- "name"=>$authority,
|
|
|
- "alias_name"=>$authority
|
|
|
- ]);
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * Reverse the migrations.
|
|
|
- *
|
|
|
- * @return void
|
|
|
- */
|
|
|
- public function down()
|
|
|
- {
|
|
|
- Schema::dropIfExists('delivery_appointments');
|
|
|
- foreach ($this->authorities as $authority){
|
|
|
- \App\Authority::query()->where("name",$authority)->delete();
|
|
|
- }
|
|
|
- }
|
|
|
-}
|