1 | <?php |
||
7 | class CreateUserEmailsTable extends Migration |
||
8 | { |
||
9 | /** |
||
10 | * Run the migrations. |
||
11 | * |
||
12 | * @return void |
||
13 | */ |
||
14 | public function up() |
||
15 | { |
||
16 | Schema::create('user_emails', function (Blueprint $table) { |
||
17 | $table->increments('id'); |
||
18 | $table->integer('user_id')->unsigned(); |
||
19 | $table->foreign('user_id')->references('id')->on('users'); |
||
20 | $table->string('email'); |
||
21 | $table->string('password')->nullable(); |
||
22 | $table->boolean('is_primary')->default(0); |
||
23 | $table->timestamps(); |
||
24 | }); |
||
25 | } |
||
26 | |||
27 | /** |
||
28 | * Reverse the migrations. |
||
29 | * |
||
30 | * @return void |
||
31 | */ |
||
32 | public function down() |
||
33 | { |
||
34 | Schema::dropIfExists('user_emails'); |
||
35 | } |
||
36 | } |
||
37 |