diff --git a/hwe/sammo/DTO/GeneralAccessLog.php b/hwe/sammo/DTO/GeneralAccessLog.php index 35898da0..6e4924b8 100644 --- a/hwe/sammo/DTO/GeneralAccessLog.php +++ b/hwe/sammo/DTO/GeneralAccessLog.php @@ -20,7 +20,8 @@ class GeneralAccessLog extends \LDTO\DTO public ?int $userID, #[RawName('nation_id')] - public int $nationID, + #[NullIsUndefined] + public ?int $nationID, #[RawName('last_refresh')] #[Convert(DateTimeConverter::class)] @@ -28,7 +29,7 @@ class GeneralAccessLog extends \LDTO\DTO #[RawName('last_connect')] #[Convert(DateTimeConverter::class)] - public \DateTimeImmutable $lastConnect, + public ?\DateTimeImmutable $lastConnect, #[RawName('login_total')] public int $loginTotal, diff --git a/hwe/sql/schema.sql b/hwe/sql/schema.sql index b99b3239..834e5c2b 100644 --- a/hwe/sql/schema.sql +++ b/hwe/sql/schema.sql @@ -106,12 +106,12 @@ CREATE TABLE `general_access_log` ( `id` INT(11) NOT NULL AUTO_INCREMENT, `general_id` INT(11) NOT NULL, `user_id` INT(11) NULL DEFAULT NULL, - `nation_id` INT(11) NOT NULL, - `last_refresh` DATETIME NOT NULL, - `last_connect` DATETIME NOT NULL, - `login_total` INT(11) NOT NULL, - `refresh` INT(11) NOT NULL, - `refresh_total` INT(11) NOT NULL, + `nation_id` INT(11) NULL DEFAULT NULL, + `last_refresh` DATETIME NULL DEFAULT NULL, + `last_connect` DATETIME NULL DEFAULT NULL, + `login_total` INT(11) NOT NULL DEFAULT '0', + `refresh` INT(11) NOT NULL DEFAULT '0', + `refresh_total` INT(11) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), UNIQUE INDEX `general_id` (`general_id`), INDEX `nation_id` (`nation_id`)