]> BookStack Code Mirror - bookstack/blob - database/migrations/2015_09_05_164707_add_email_confirmation_table.php
2f20cf0cfe9216ff389648995eefeadc221ce6a0
[bookstack] / database / migrations / 2015_09_05_164707_add_email_confirmation_table.php
1 <?php
2
3 use Illuminate\Database\Schema\Blueprint;
4 use Illuminate\Database\Migrations\Migration;
5
6 class AddEmailConfirmationTable extends Migration
7 {
8     /**
9      * Run the migrations.
10      *
11      * @return void
12      */
13     public function up()
14     {
15         Schema::table('users', function (Blueprint $table) {
16             $table->boolean('email_confirmed')->default(true);
17         });
18
19         Schema::create('email_confirmations', function (Blueprint $table) {
20             $table->increments('id');
21             $table->integer('user_id')->index();
22             $table->string('token')->index();
23             $table->timestamps();
24         });
25     }
26
27     /**
28      * Reverse the migrations.
29      *
30      * @return void
31      */
32     public function down()
33     {
34         Schema::table('users', function (Blueprint $table) {
35             $table->dropColumn('email_confirmed');
36         });
37         Schema::drop('email_confirmations');
38     }
39 }