diff --git a/database/migrations/0001_01_01_000000_create_users_table.php b/database/migrations/0001_01_01_000000_create_users_table.php index fbca46c..0b8b03a 100644 --- a/database/migrations/0001_01_01_000000_create_users_table.php +++ b/database/migrations/0001_01_01_000000_create_users_table.php @@ -1,5 +1,6 @@ uuid('id')->primary(); $table->string('username'); $table->string('email')->unique(); + $table->integer('xp')->default(0); + $table->integer('participations')->default(0); + $table->integer('victories')->default(0); $table->timestamp('email_verified_at')->nullable(); $table->string('password'); + $table->string('role')->default(UserRole::USER->value); + $table->string('avatar_uri')->nullable(); + $table->unsignedInteger('level')->default(1); $table->rememberToken(); + $table->softDeletes(); $table->timestamps(); }); diff --git a/database/migrations/2025_11_30_221421_add_deleted_at_to_users_table.php b/database/migrations/2025_11_30_221421_add_deleted_at_to_users_table.php deleted file mode 100644 index a7bda58..0000000 --- a/database/migrations/2025_11_30_221421_add_deleted_at_to_users_table.php +++ /dev/null @@ -1,28 +0,0 @@ -softDeletes(); - }); - } - - /** - * Reverse the migrations. - */ - public function down(): void - { - Schema::table('users', function (Blueprint $table) { - $table->dropSoftDeletes(); - }); - } -}; diff --git a/database/migrations/2025_12_18_092945_create_hunts_table.php b/database/migrations/2025_12_18_092945_create_hunts_table.php index 2b064a5..2a69a61 100644 --- a/database/migrations/2025_12_18_092945_create_hunts_table.php +++ b/database/migrations/2025_12_18_092945_create_hunts_table.php @@ -1,5 +1,6 @@ string('partner_id')->index(); + $table->id(); + $table->string('partner_id')->nullable()->index(); $table->string('title'); $table->string('slug')->unique(); $table->text('description')->nullable(); $table->string('status')->index(); - $table->string('difficulty')->index(); + $table->string('difficulty')->default(HuntDifficulty::EASY->value)->index(); $table->string('city')->index(); $table->decimal('latitude', 10, 7)->nullable(); diff --git a/database/migrations/2025_12_19_100429_add_stats_to_users.php b/database/migrations/2025_12_19_100429_add_stats_to_users.php deleted file mode 100644 index be1dcd4..0000000 --- a/database/migrations/2025_12_19_100429_add_stats_to_users.php +++ /dev/null @@ -1,30 +0,0 @@ -integer('xp')->default(0); - $table->integer('participations')->default(0); - $table->integer('victories')->default(0); - }); - } - - /** - * Reverse the migrations. - */ - public function down(): void - { - Schema::table('users', function (Blueprint $table) { - // - }); - } -}; diff --git a/database/migrations/2025_12_19_103518_add_id_to_hunts.php b/database/migrations/2025_12_19_103518_add_id_to_hunts.php deleted file mode 100644 index eb69eb3..0000000 --- a/database/migrations/2025_12_19_103518_add_id_to_hunts.php +++ /dev/null @@ -1,33 +0,0 @@ -id(); - } - if (!Schema::hasColumn('hunts', 'xp')) { - $table->unsignedBigInteger('xp')->default(0); - } - }); - } - - /** - * Reverse the migrations. - */ - public function down(): void - { - Schema::table('hunts', function (Blueprint $table) { - // - }); - } -}; diff --git a/database/migrations/2025_12_19_103600_add_role_to_users.php b/database/migrations/2025_12_19_103600_add_role_to_users.php deleted file mode 100644 index 299ddf7..0000000 --- a/database/migrations/2025_12_19_103600_add_role_to_users.php +++ /dev/null @@ -1,28 +0,0 @@ -string('role')->default('user'); - }); - } - - /** - * Reverse the migrations. - */ - public function down(): void - { - Schema::table('users', function (Blueprint $table) { - // - }); - } -}; diff --git a/database/migrations/2025_12_19_111126_make_partner_id_nullable_in_hunts_table.php b/database/migrations/2025_12_19_111126_make_partner_id_nullable_in_hunts_table.php deleted file mode 100644 index b2a694a..0000000 --- a/database/migrations/2025_12_19_111126_make_partner_id_nullable_in_hunts_table.php +++ /dev/null @@ -1,28 +0,0 @@ -string('partner_id')->nullable()->change(); - }); - } - - /** - * Reverse the migrations. - */ - public function down(): void - { - Schema::table('hunts', function (Blueprint $table) { - $table->string('partner_id')->nullable(false)->change(); - }); - } -}; diff --git a/database/migrations/2025_12_19_135018_add_image_to_users.php b/database/migrations/2025_12_19_135018_add_image_to_users.php deleted file mode 100644 index db910d9..0000000 --- a/database/migrations/2025_12_19_135018_add_image_to_users.php +++ /dev/null @@ -1,28 +0,0 @@ -string('avatarUri')->nullable(); - }); - } - - /** - * Reverse the migrations. - */ - public function down(): void - { - Schema::table('users', function (Blueprint $table) { - $table->dropColumn('avatarUri'); - }); - } -}; diff --git a/database/migrations/2026_01_05_084918_rename_avatar_uri_in_users_table.php b/database/migrations/2026_01_05_084918_rename_avatar_uri_in_users_table.php deleted file mode 100644 index 2d82d32..0000000 --- a/database/migrations/2026_01_05_084918_rename_avatar_uri_in_users_table.php +++ /dev/null @@ -1,28 +0,0 @@ -renameColumn('avatarUri', 'avatar_uri'); - }); - } - - /** - * Reverse the migrations. - */ - public function down(): void - { - Schema::table('users', function (Blueprint $table) { - $table->renameColumn('avatar_uri', 'avatarUri'); - }); - } -}; diff --git a/database/migrations/2026_01_05_120000_add_defaults_to_hunts_and_users.php b/database/migrations/2026_01_05_120000_add_defaults_to_hunts_and_users.php deleted file mode 100644 index 361aecd..0000000 --- a/database/migrations/2026_01_05_120000_add_defaults_to_hunts_and_users.php +++ /dev/null @@ -1,38 +0,0 @@ -string('difficulty')->default(HuntDifficulty::EASY->value)->change(); - }); - - Schema::table('users', function (Blueprint $table) { - $table->string('role')->default(UserRole::USER->value)->change(); - }); - } - - /** - * Reverse the migrations. - */ - public function down(): void - { - Schema::table('hunts', function (Blueprint $table) { - $table->string('difficulty')->nullable(false)->change(); - }); - - Schema::table('users', function (Blueprint $table) { - $table->string('role')->default('user')->change(); // Originally it was default 'user' string, restoring to that or removing default if it had none before (but it did have one). - }); - } -}; diff --git a/database/migrations/2026_01_07_092057_add_level_to_users.php b/database/migrations/2026_01_07_092057_add_level_to_users.php deleted file mode 100644 index 050b3f6..0000000 --- a/database/migrations/2026_01_07_092057_add_level_to_users.php +++ /dev/null @@ -1,28 +0,0 @@ -unsignedInteger('level')->default(1); - }); - } - - /** - * Reverse the migrations. - */ - public function down(): void - { - Schema::table('users', function (Blueprint $table) { - $table->dropColumn('level'); - }); - } -};