BookStack/database/migrations/2014_10_12_000000_create_users_table.php

44 lines
1.1 KiB
PHP
Raw Normal View History

2015-07-12 19:01:42 +00:00
<?php
use Illuminate\Database\Migrations\Migration;
2021-06-26 15:23:15 +00:00
use Illuminate\Database\Schema\Blueprint;
2015-07-12 19:01:42 +00:00
class CreateUsersTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('users', function (Blueprint $table) {
$table->increments('id');
$table->string('name');
$table->string('email')->unique();
$table->string('password', 60);
$table->rememberToken();
2016-02-16 21:25:11 +00:00
$table->nullableTimestamps();
2015-07-12 19:01:42 +00:00
});
2015-08-29 14:03:42 +00:00
// Create the initial admin user
DB::table('users')->insert([
2021-06-26 15:23:15 +00:00
'name' => 'Admin',
'email' => 'admin@admin.com',
'password' => bcrypt('password'),
'created_at' => \Carbon\Carbon::now()->toDateTimeString(),
2021-06-26 15:23:15 +00:00
'updated_at' => \Carbon\Carbon::now()->toDateTimeString(),
2015-08-29 14:03:42 +00:00
]);
2015-07-12 19:01:42 +00:00
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('users');
}
}