]> BookStack Code Mirror - bookstack/blob - database/migrations/2014_10_12_000000_create_users_table.php
Applied required changes
[bookstack] / database / migrations / 2014_10_12_000000_create_users_table.php
1 <?php
2
3 use Illuminate\Database\Schema\Blueprint;
4 use Illuminate\Database\Migrations\Migration;
5
6 class CreateUsersTable extends Migration
7 {
8     /**
9      * Run the migrations.
10      *
11      * @return void
12      */
13     public function up()
14     {
15         Schema::create('users', function (Blueprint $table) {
16             $table->increments('id');
17             $table->string('name');
18             $table->string('email')->unique();
19             $table->string('password', 60);
20             $table->string('books_display')->default('grid');
21             $table->rememberToken();
22             $table->nullableTimestamps();
23         });
24
25         // Create the initial admin user
26         DB::table('users')->insert([
27             'name' => 'Admin',
28             'email' => '[email protected]',
29             'password' => bcrypt('password'),
30             'books_display' => 'grid',
31             'created_at' => \Carbon\Carbon::now()->toDateTimeString(),
32             'updated_at' => \Carbon\Carbon::now()->toDateTimeString()
33         ]);
34     }
35
36     /**
37      * Reverse the migrations.
38      *
39      * @return void
40      */
41     public function down()
42     {
43         Schema::drop('users');
44     }
45 }