fix: add DEFAULT 0 to last_username_change column, seeder, fillable, and factory

This commit is contained in:
root
2026-05-27 20:23:06 +02:00
parent 7814176358
commit 1f9af5279a
5 changed files with 21 additions and 3 deletions
+1
View File
@@ -17,6 +17,7 @@ class UserFactory extends Factory
'last_login' => time(),
'look' => setting('start_look') ?: 'hr-100-61.hd-180-1.ch-210-66.lg-270-110.sh-305-62',
'credits' => setting('start_credits') ?: 1000,
'last_username_change' => 0,
'ip_register' => '127.0.0.1',
'ip_current' => '127.0.0.1',
];
+1 -1
View File
@@ -3899,7 +3899,7 @@ CREATE TABLE `users` (
`is_hidden` tinyint(1) NOT NULL DEFAULT 0,
`home_background` varchar(255) DEFAULT NULL,
`background_card_id` int(11) NOT NULL DEFAULT 0,
`last_username_change` int(11) NOT NULL,
`last_username_change` int(11) NOT NULL DEFAULT 0,
PRIMARY KEY (`id`) USING BTREE,
UNIQUE KEY `username` (`username`) USING BTREE,
UNIQUE KEY `id` (`id`) USING BTREE,
+1 -1
View File
@@ -3899,7 +3899,7 @@ CREATE TABLE `users` (
`is_hidden` tinyint(1) NOT NULL DEFAULT 0,
`home_background` varchar(255) DEFAULT NULL,
`background_card_id` int(11) NOT NULL DEFAULT 0,
`last_username_change` int(11) NOT NULL,
`last_username_change` int(11) NOT NULL DEFAULT 0,
PRIMARY KEY (`id`) USING BTREE,
UNIQUE KEY `username` (`username`) USING BTREE,
UNIQUE KEY `id` (`id`) USING BTREE,
+17
View File
@@ -0,0 +1,17 @@
<?php
namespace Database\Seeders;
use Illuminate\Database\Seeder;
use Illuminate\Support\Facades\DB;
class UpdateLastUsernameChangeSeeder extends Seeder
{
public function run(): void
{
DB::table('users')
->whereNull('last_username_change')
->orWhere('last_username_change', 0)
->update(['last_username_change' => 0]);
}
}