feat: clean migrations

This commit is contained in:
2026-05-22 13:20:30 +02:00
parent 73315b7354
commit 6a100c03fa
16 changed files with 27 additions and 371 deletions
@@ -17,14 +17,34 @@ return new class extends Migration
$table->string('email')->unique();
$table->timestamp('email_verified_at')->nullable();
$table->string('password');
$table->string('role')->default('user');
$table->text('bio')->nullable();
$table->integer('height')->nullable();
$table->date('date_of_birth')->nullable();
$table->string('sex')->default('unknown');
$table->string('physical_activity_level')->default('sedentary');
$table->string('weight_goal')->default('lose_weight');
$table->string('pace_preference')->default('slow');
$table->string('locale', 8)->default('en')->after('email');
$table->string('avatar_url', 2048)->nullable();
// Goals
$table->unsignedInteger('daily_calorie_goal')->default(2000)->after('avatar_url');
$table->decimal('daily_protein_goal', 8, 2)->default(120)->after('daily_calorie_goal');
$table->decimal('daily_carbs_goal', 8, 2)->default(250)->after('daily_protein_goal');
$table->decimal('daily_fats_goal', 8, 2)->default(70)->after('daily_carbs_goal');
// 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('password_reset_tokens', function (Blueprint $table) {