mirror of
https://github.com/OpenFusionProject/OpenFusion.git
synced 2025-10-24 05:40:14 +00:00
Record claimed code items, and other misc DB fixes
* Create new table to store redeemed codes * Check if a player already used a code when using /redeem * Change Coordinate columns to non-plural form * Fixed EmailItems unique constraint not being specific enough * Bumped DB version to 3
This commit is contained in:
@@ -28,9 +28,9 @@ CREATE TABLE IF NOT EXISTS Players (
|
||||
AppearanceFlag INTEGER DEFAULT 0 NOT NULL,
|
||||
TutorialFlag INTEGER DEFAULT 0 NOT NULL,
|
||||
PayZoneFlag INTEGER DEFAULT 0 NOT NULL,
|
||||
XCoordinates INTEGER NOT NULL,
|
||||
YCoordinates INTEGER NOT NULL,
|
||||
ZCoordinates INTEGER NOT NULL,
|
||||
XCoordinate INTEGER NOT NULL,
|
||||
YCoordinate INTEGER NOT NULL,
|
||||
ZCoordinate INTEGER NOT NULL,
|
||||
Angle INTEGER NOT NULL,
|
||||
HP INTEGER NOT NULL,
|
||||
FusionMatter INTEGER DEFAULT 0 NOT NULL,
|
||||
@@ -140,7 +140,7 @@ CREATE TABLE IF NOT EXISTS EmailItems (
|
||||
Opt INTEGER NOT NULL,
|
||||
TimeLimit INTEGER NOT NULL,
|
||||
FOREIGN KEY(PlayerID) REFERENCES Players(PlayerID) ON DELETE CASCADE,
|
||||
UNIQUE (MsgIndex, Slot)
|
||||
UNIQUE (PlayerID, MsgIndex, Slot)
|
||||
);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS RaceResults(
|
||||
@@ -152,3 +152,10 @@ CREATE TABLE IF NOT EXISTS RaceResults(
|
||||
Timestamp INTEGER NOT NULL,
|
||||
FOREIGN KEY(PlayerID) REFERENCES Players(PlayerID) ON DELETE CASCADE
|
||||
);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS RedeemedCodes(
|
||||
PlayerID INTEGER NOT NULL,
|
||||
Code TEXT NOT NULL,
|
||||
FOREIGN KEY(PlayerID) REFERENCES Players(PlayerID) ON DELETE CASCADE,
|
||||
UNIQUE (PlayerID, Code)
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user