- Add PlayerState model to database schema for storing game states - Create player identifier system (UUID-based) for cross-domain sync - Implement API endpoints for loading/saving player states - Refactor gameState hook to use backend storage with localStorage fallback - Support synchronization between hoerdle.de and hördle.de - Migration automatically runs on Docker container start
17 lines
529 B
SQL
17 lines
529 B
SQL
-- CreateTable
|
|
CREATE TABLE "PlayerState" (
|
|
"id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
|
|
"identifier" TEXT NOT NULL,
|
|
"genreKey" TEXT NOT NULL,
|
|
"gameState" TEXT NOT NULL,
|
|
"statistics" TEXT NOT NULL,
|
|
"lastPlayed" DATETIME NOT NULL,
|
|
"createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP
|
|
);
|
|
|
|
-- CreateIndex
|
|
CREATE INDEX "PlayerState_identifier_idx" ON "PlayerState"("identifier");
|
|
|
|
-- CreateIndex
|
|
CREATE UNIQUE INDEX "PlayerState_identifier_genreKey_key" ON "PlayerState"("identifier", "genreKey");
|