]> BookStack Code Mirror - bookstack/blob - database/migrations/2014_10_12_000000_create_users_table.php
17e71de5f99d933aaafb7d6996cb337203a468da
[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->rememberToken();
21             $table->nullableTimestamps();
22         });
23
24         // Create the initial admin user
25         DB::table('users')->insert([
26             'name' => 'Admin',
27             'email' => '[email protected]',
28             'password' => bcrypt('password'),
29             'created_at' => \Carbon\Carbon::now()->toDateTimeString(),
30             'updated_at' => \Carbon\Carbon::now()->toDateTimeString()
31         ]);
32     }
33
34     /**
35      * Reverse the migrations.
36      *
37      * @return void
38      */
39     public function down()
40     {
41         Schema::drop('users');
42     }
43 }