From dda7e50963a3402e0dc49f51996a641400b39c17 Mon Sep 17 00:00:00 2001 From: Lobo Date: Sun, 19 Apr 2026 14:35:02 +0200 Subject: [PATCH] Support now null as not initialized for SteamId --- .../persistence/entities/RegisteredUserEntity.java | 5 +++-- .../resources/db/migration/V4__Add_Valid_SteamId.sql | 9 --------- 2 files changed, 3 insertions(+), 11 deletions(-) delete mode 100644 src/main/resources/db/migration/V4__Add_Valid_SteamId.sql diff --git a/src/main/java/auth_service/modules/registration/persistence/entities/RegisteredUserEntity.java b/src/main/java/auth_service/modules/registration/persistence/entities/RegisteredUserEntity.java index 8cc334b..2481226 100644 --- a/src/main/java/auth_service/modules/registration/persistence/entities/RegisteredUserEntity.java +++ b/src/main/java/auth_service/modules/registration/persistence/entities/RegisteredUserEntity.java @@ -12,6 +12,7 @@ import java.time.LocalDateTime; @NoArgsConstructor @AllArgsConstructor @Builder +@Inheritance(strategy = InheritanceType.SINGLE_TABLE) public class RegisteredUserEntity { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) @@ -26,7 +27,7 @@ public class RegisteredUserEntity { @Column(nullable = false) private boolean enabled; - @Column(name = "steam_id", unique = true, nullable = false) + @Column(name = "steam_id", unique = true) private Long steamId; @Column(name = "registration_date", nullable = false) @@ -34,4 +35,4 @@ public class RegisteredUserEntity { @Column(name = "last_login_date") private LocalDateTime lastLoginDate; -} +} \ No newline at end of file diff --git a/src/main/resources/db/migration/V4__Add_Valid_SteamId.sql b/src/main/resources/db/migration/V4__Add_Valid_SteamId.sql deleted file mode 100644 index 6710677..0000000 --- a/src/main/resources/db/migration/V4__Add_Valid_SteamId.sql +++ /dev/null @@ -1,9 +0,0 @@ -UPDATE users -SET steam_id = 0 -WHERE steam_id IS NULL; - -ALTER TABLE users - ALTER COLUMN steam_id SET DEFAULT 0; - -ALTER TABLE users - ALTER COLUMN steam_id SET NOT NULL; \ No newline at end of file