Skip to content

Commit

Permalink
Merge pull request #182 from MrDave1999/db/update-check-constraint
Browse files Browse the repository at this point in the history
db: Allow the 'skin_id' column to accept the value '-1'
  • Loading branch information
MrDave1999 authored Oct 20, 2024
2 parents dc103d7 + f98faf6 commit b950952
Showing 3 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion scripts/mariadb/gamemode.sql
Original file line number Diff line number Diff line change
@@ -20,7 +20,7 @@ CREATE TABLE IF NOT EXISTS players (
returned_flags int(11) NOT NULL CHECK(returned_flags >= 0),
head_shots int(11) NOT NULL CHECK(head_shots >= 0),
role_id enum('Basic','VIP','Moderator','Admin') NOT NULL,
skin_id int(11) NOT NULL CHECK(skin_id >= 0 AND skin_id <= 311),
skin_id int(11) NOT NULL CHECK(skin_id >= -1 AND skin_id <= 311),
rank_id int(11) NOT NULL CHECK(rank_id >= 0 AND rank_id <= 14),
created_at datetime NOT NULL,
last_connection datetime NOT NULL,
2 changes: 1 addition & 1 deletion scripts/sqlite/gamemode.sql
Original file line number Diff line number Diff line change
@@ -18,7 +18,7 @@ CREATE TABLE IF NOT EXISTS players (
returned_flags INTEGER NOT NULL CHECK(returned_flags >= 0),
head_shots INTEGER NOT NULL CHECK(head_shots >= 0),
role_id INTEGER NOT NULL CHECK(role_id >= 0 AND role_id <= 3),
skin_id INTEGER NOT NULL CHECK(skin_id >= 0 AND skin_id <= 311),
skin_id INTEGER NOT NULL CHECK(skin_id >= -1 AND skin_id <= 311),
rank_id INTEGER NOT NULL CHECK(rank_id >= 0 AND rank_id <= 14),
created_at TEXT NOT NULL,
last_connection TEXT NOT NULL,
1 change: 0 additions & 1 deletion tests/Persistence.Tests/Players/Create.cs
Original file line number Diff line number Diff line change
@@ -12,7 +12,6 @@ public void Create_WhenCalled_ShouldCreatePlayerAndSetAccountId(IRepositoryManag
var playerInfo = new PlayerInfo();
playerInfo.SetName("Player1");
playerInfo.SetPassword("DSR8887$#");
playerInfo.SetSkin(146);

// Act
playerRepository.Create(playerInfo);

0 comments on commit b950952

Please sign in to comment.