Advertisement
Guest User

Untitled

a guest
Jan 22nd, 2020
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.12 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 CreateUsersDevicesTable extends Migration {
  8.     /**
  9.      * Run the migrations.
  10.      *
  11.      * @return void
  12.      */
  13.     public function up() {
  14.         Schema::create('users_devices', function (Blueprint $table) {
  15.             $table->increments('id');
  16.             $table->unsignedInteger("user_id");
  17.             $table->text("device_id");
  18.             $table->string("platform", 20)->nullable();
  19.             $table->string("model", 30)->nullable();
  20.             $table->string("uuid", 150)->nullable();
  21.             $table->string("manufacturer", 20)->nullable();
  22.             $table->string("version", 10)->nullable();
  23.             $table->timestamp('created_at');
  24.            
  25.             $table->foreign('user_id', 'users_devices_user_id_foreign')->references('id')->on('users');
  26.         });
  27.            
  28.     }
  29.    
  30.     /**
  31.      * Reverse the migrations.
  32.      *
  33.      * @return void
  34.      */
  35.     public function down() {
  36.         Schema::dropIfExists('users_devices');
  37.     }
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement