tomjerry741

Migrate

Nov 25th, 2020 (edited)
462
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 CreateUsersTable extends Migration
  7. {
  8.     /**
  9.      * Run the migrations.
  10.      */
  11.     public function up()
  12.     {
  13.         Schema::create('users', function (Blueprint $table) {
  14.             $table->bigIncrements('id');
  15.             $table->string('email')->unique();
  16.             $table->string('password');
  17.             $table->boolean('activated')->default(0);
  18.             $table->boolean('superuser')->default(0);
  19.             $table->boolean('privacy_policy_accepted')->default(0);
  20.             $table->string('first_name')->nullable();
  21.             $table->string('last_name')->nullable();
  22.             $table->string('phone')->nullable();
  23.             $table->string('locale')->nullable();
  24.             $table->string('street')->nullable();
  25.             $table->string('number')->nullable();
  26.             $table->string('box')->nullable();
  27.             $table->string('postal_code')->nullable();
  28.             $table->string('city')->nullable();
  29.             $table->string('country')->nullable();
  30.             $table->text('preferences')->nullable();
  31.             $table->uuid('api_token')->unique();
  32.             $table->timestamp('email_verified_at')->nullable();
  33.             $table->rememberToken();
  34.             $table->timestamps();
  35.         });
  36.     }
  37.  
  38.     /**
  39.      * Reverse the migrations.
  40.      */
  41.     public function down()
  42.     {
  43.         Schema::drop('users');
  44.     }
  45. }
RAW Paste Data