Advertisement
Guest User

Untitled

a guest
Jan 24th, 2020
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.96 KB | None | 0 0
  1. class CreateFrontUserGamesItemTable extends Migration
  2. {
  3.     /**
  4.      * Run the migrations.
  5.      *
  6.      * @return void
  7.      */
  8.     public function up()
  9.     {
  10.         Schema::create('front_user_games_item', function (Blueprint $table) {
  11.             $table->bigIncrements('id');
  12.             $table->string('key');
  13.             $table->unsignedBigInteger('front_user_id');
  14.             $table->unsignedBigInteger('games_item_id');
  15.             $table->float('price');
  16.             $table->boolean('expired')->default(0);
  17.             $table->timestamp('expired_at');
  18.             $table->timestamps();
  19.  
  20.             $table->foreign('front_user_id')->references('id')->on('front_users');
  21.             $table->foreign('games_item_id')->references('id')->on('games_items');
  22.         });
  23.  
  24.  
  25.     }
  26.  
  27.     /**
  28.      * Reverse the migrations.
  29.      *
  30.      * @return void
  31.      */
  32.     public function down()
  33.     {
  34.         Schema::dropIfExists('front_user_games_item');
  35.     }
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement