From 348c9843b99552884a745d926711051f716d04fd Mon Sep 17 00:00:00 2001 From: "T9-CNUD11\\NASPC" Date: Wed, 15 Jul 2026 15:03:44 +0700 Subject: [PATCH] feat: add missing profile and status columns to users table --- ...007_add_missing_columns_to_users_table.php | 36 ++++++++++++++----- 1 file changed, 27 insertions(+), 9 deletions(-) diff --git a/database/migrations/2026_07_15_150007_add_missing_columns_to_users_table.php b/database/migrations/2026_07_15_150007_add_missing_columns_to_users_table.php index c249e772..509269db 100644 --- a/database/migrations/2026_07_15_150007_add_missing_columns_to_users_table.php +++ b/database/migrations/2026_07_15_150007_add_missing_columns_to_users_table.php @@ -9,15 +9,33 @@ return new class extends Migration public function up(): void { Schema::table('users', function (Blueprint $table) { - $table->string('phone')->nullable()->after('name'); - $table->string('user_email')->nullable()->after('phone'); - $table->integer('birth_year')->nullable()->after('user_email'); - $table->string('address')->nullable()->after('birth_year'); - $table->tinyInteger('known_sis')->nullable()->after('address'); - $table->string('job')->nullable()->after('known_sis'); - $table->tinyInteger('status')->default(1)->after('job'); - $table->tinyInteger('spined')->default(0)->after('status'); - $table->string('confirmation_string')->nullable()->after('spined'); + if (!Schema::hasColumn('users', 'phone')) { + $table->string('phone')->nullable()->after('name'); + } + if (!Schema::hasColumn('users', 'user_email')) { + $table->string('user_email')->nullable()->after('phone'); + } + if (!Schema::hasColumn('users', 'birth_year')) { + $table->integer('birth_year')->nullable()->after('user_email'); + } + if (!Schema::hasColumn('users', 'address')) { + $table->string('address')->nullable()->after('birth_year'); + } + if (!Schema::hasColumn('users', 'known_sis')) { + $table->tinyInteger('known_sis')->nullable()->after('address'); + } + if (!Schema::hasColumn('users', 'job')) { + $table->string('job')->nullable()->after('known_sis'); + } + if (!Schema::hasColumn('users', 'status')) { + $table->tinyInteger('status')->default(1)->after('job'); + } + if (!Schema::hasColumn('users', 'spined')) { + $table->tinyInteger('spined')->default(0)->after('status'); + } + if (!Schema::hasColumn('users', 'confirmation_string')) { + $table->string('confirmation_string')->nullable()->after('spined'); + } }); }