/
2020_10_03_233352_create_other_users_table.php
67 lines (63 loc) · 1.97 KB
/
2020_10_03_233352_create_other_users_table.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Support\Facades\DB;
use Carbon\Carbon;
class CreateOtherUsersTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('other_users', function (Blueprint $table)
{
$table->increments('id');
$table->string('name');
$table->string('email')->unique();
$table->string('password');
$table->boolean('is_admin')->default(0)->index();
$table->boolean('can_be_impersonated')->default(1)->index();
$table->rememberToken();
$table->timestamps();
});
DB::table('other_users')->insert([
[
'name' => 'OtherAdmin',
'email' => 'otheradmin@test.rocks',
'password' => bcrypt('password'),
'is_admin' => 1,
'can_be_impersonated' => 1,
'created_at' => Carbon::now()->toDateTimeString(),
],
[
'name' => 'OtherUser',
'email' => 'otheruser@test.rocks',
'password' => bcrypt('password'),
'is_admin' => 0,
'can_be_impersonated' => 1,
'created_at' => Carbon::now()->toDateTimeString(),
],
[
'name' => 'OtherSuperAdmin',
'email' => 'othersuperadmin@test.rocks',
'password' => bcrypt('password'),
'is_admin' => 1,
'can_be_impersonated' => 0,
'created_at' => Carbon::now()->toDateTimeString(),
],
]);
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('other_users');
}
}