Advertisement
Guest User

Untitled

a guest
Apr 24th, 2019
284
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.73 KB | None | 0 0
  1. <?php
  2.  
  3. use Illuminate\Support\Facades\Schema;
  4. use Illuminate\Database\Schema\Blueprint;
  5. use Illuminate\Database\Migrations\Migration;
  6.  
  7. class AddNullableToCityIdCards extends Migration
  8. {
  9.     /**
  10.      * Run the migrations.
  11.      *
  12.      * @return void
  13.      */
  14.     public function up()
  15.     {
  16.         Schema::table('cards', function (Blueprint $table) {
  17.             $table->dropForeign(['city_id']);
  18.             $table->integer('city_id')->nullable()->change();
  19.         });
  20.         Schema::table('cities', function (Blueprint $table) {
  21.             $table->dropForeign(['id']);
  22.  
  23.         });
  24.     }
  25.  
  26.     /**
  27.      * Reverse the migrations.
  28.      *
  29.      * @return void
  30.      */
  31.     public function down()
  32.     {
  33.         //
  34.     }
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement