Files
NextChair/database/migrations/0001_01_01_000000_create_users_table.php
T
Stefan Lazic 2ef3654841
CI / ci (push) Canceled after 0s
PHP Rebuild
Initial PHP rebuild of the app
2026-09-05 08:21:33 +01:00

55 lines
1.8 KiB
PHP

<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::create('User', function (Blueprint $table) {
$table->string('id', 191)->primary();
$table->string('name')->nullable();
$table->string('email')->nullable()->unique();
$table->dateTime('emailVerified')->nullable();
$table->string('phone')->nullable()->unique();
$table->dateTime('phoneVerified')->nullable();
$table->string('image')->nullable();
$table->string('passwordHash')->nullable();
$table->boolean('isSuperAdmin')->default(false);
$table->string('remember_token')->nullable();
$table->timestamp('createdAt')->useCurrent();
$table->timestamp('updatedAt')->useCurrent()->useCurrentOnUpdate();
});
Schema::create('password_reset_tokens', function (Blueprint $table) {
$table->string('email')->primary();
$table->string('token');
$table->timestamp('created_at')->nullable();
});
Schema::create('sessions', function (Blueprint $table) {
$table->string('id')->primary();
$table->foreignId('user_id')->nullable()->index();
$table->string('ip_address', 45)->nullable();
$table->text('user_agent')->nullable();
$table->longText('payload');
$table->integer('last_activity')->index();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('User');
Schema::dropIfExists('password_reset_tokens');
Schema::dropIfExists('sessions');
}
};