ulid('id')->primary(); $table->string('name'); $table->string('email')->unique(); $table->timestamp('email_verified_at')->nullable(); $table->string('password')->nullable(); $table->string('role')->default('user'); $table->text('bio')->nullable(); $table->unsignedSmallInteger('height')->nullable(); $table->decimal('target_weight', 5, 2)->nullable(); $table->date('date_of_birth')->nullable(); $table->string('sex')->nullable(); $table->string('physical_activity_level')->nullable(); $table->string('weight_goal')->nullable(); $table->string('pace_preference')->nullable(); $table->string('locale', 8)->default('en')->after('email'); $table->string('avatar_url', 2048)->nullable(); $table->timestampTz('onboarding_completed_at')->nullable()->index(); $table->timestampTz('nutrition_estimate_accepted_at')->nullable(); // Moderation $table->timestamp('suspended_at')->nullable()->after('deleted_at')->index(); $table->ulid('suspended_by')->nullable()->after('suspended_at')->index(); $table->text('suspended_reason')->nullable()->after('suspended_by'); $table->rememberToken(); $table->timestampTz('account_verified_at')->nullable(); $table->timestamps(); $table->softDeletesTz(); }); Schema::table('users', function (Blueprint $table) { $table->foreign('suspended_by')->references('id')->on('users')->nullOnDelete(); }); Schema::create('social_accounts', function (Blueprint $table) { $table->id(); $table->foreignUlid('user_id')->constrained()->cascadeOnDelete(); $table->string('provider', 32); $table->string('provider_user_id'); $table->text('provider_refresh_token')->nullable(); $table->timestamps(); $table->unique(['provider', 'provider_user_id']); $table->unique(['user_id', 'provider']); }); 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->foreignUlid('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('social_accounts'); Schema::dropIfExists('users'); Schema::dropIfExists('password_reset_tokens'); Schema::dropIfExists('sessions'); } };