URL Shortener 1.0
A Laravel-based URL shortener application
Chargement...
Recherche...
Aucune correspondance
0001_01_01_000000_create_users_table.php
Aller à la documentation de ce fichier.
1<?php
2
3use Illuminate\Database\Migrations\Migration;
4use Illuminate\Database\Schema\Blueprint;
5use Illuminate\Support\Facades\Schema;
6
7return new class extends Migration
8{
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
43 public function down(): void
44 {
45 Schema::dropIfExists('users');
46 Schema::dropIfExists('password_reset_tokens');
47 Schema::dropIfExists('sessions');
48 }
49};
down()
Reverse the migrations.