|
0
|
1 <?php
|
|
|
2
|
|
|
3 use Illuminate\Database\Migrations\Migration;
|
|
|
4 use Illuminate\Database\Schema\Blueprint;
|
|
|
5 use Illuminate\Support\Facades\Schema;
|
|
|
6
|
|
|
7 return new class extends Migration
|
|
|
8 {
|
|
|
9 /**
|
|
|
10 * Run the migrations.
|
|
|
11 */
|
|
|
12 public function up(): void
|
|
|
13 {
|
|
|
14 Schema::create('users', function (Blueprint $table) {
|
|
|
15 $table->id();
|
|
|
16 $table->string('name');
|
|
|
17 $table->string('email')->unique();
|
|
|
18 $table->timestamp('email_verified_at')->nullable();
|
|
|
19 $table->string('password');
|
|
|
20 $table->rememberToken();
|
|
|
21 $table->timestamps();
|
|
|
22 });
|
|
|
23
|
|
|
24 Schema::create('password_reset_tokens', function (Blueprint $table) {
|
|
|
25 $table->string('email')->primary();
|
|
|
26 $table->string('token');
|
|
|
27 $table->timestamp('created_at')->nullable();
|
|
|
28 });
|
|
|
29
|
|
|
30 Schema::create('sessions', function (Blueprint $table) {
|
|
|
31 $table->string('id')->primary();
|
|
|
32 $table->foreignId('user_id')->nullable()->index();
|
|
|
33 $table->string('ip_address', 45)->nullable();
|
|
|
34 $table->text('user_agent')->nullable();
|
|
|
35 $table->longText('payload');
|
|
|
36 $table->integer('last_activity')->index();
|
|
|
37 });
|
|
|
38 }
|
|
|
39
|
|
|
40 /**
|
|
|
41 * Reverse the migrations.
|
|
|
42 */
|
|
|
43 public function down(): void
|
|
|
44 {
|
|
|
45 Schema::dropIfExists('users');
|
|
|
46 Schema::dropIfExists('password_reset_tokens');
|
|
|
47 Schema::dropIfExists('sessions');
|
|
|
48 }
|
|
|
49 };
|