tomjerry741

History

Nov 26th, 2020 (edited)
810
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2.  
  3. use Illuminate\Database\Migrations\Migration;
  4. use Illuminate\Database\Schema\Blueprint;
  5.  
  6. class CreateHistoryTable extends Migration
  7. {
  8.     /**
  9.      * Run the migrations.
  10.      */
  11.     public function up()
  12.     {
  13.         Schema::create('history', function (Blueprint $table) {
  14.             $table->bigIncrements('id');
  15.             $table->unsignedInteger('historable_id');
  16.             $table->string('historable_type');
  17.             $table->unsignedBigInteger('user_id')->nullable();
  18.             $table->string('title')->nullable();
  19.             $table->string('locale')->nullable();
  20.             $table->string('historable_table');
  21.             $table->string('action');
  22.             $table->json('old');
  23.             $table->json('new');
  24.             $table->timestamps();
  25.         });
  26.     }
  27.  
  28.     /**
  29.      * Reverse the migrations.
  30.      */
  31.     public function down()
  32.     {
  33.         Schema::drop('history');
  34.     }
  35. }
RAW Paste Data