isle.pizza/server/migrations/0001_initial.sql
foxtacles 93a0c46b46
Add multiplayer frontend updates (#30)
* Add multiplayer, cloud sync, crash reporting, scene player, and memories features

* Fix multiplayer overlay showing "Waiting for ..." with no names

* Fix OGL link in README

* Update README with architecture, backend setup, environment variables, and CI docs

* Fix save editor showing wrong name for orphaned save slots

Players.gsi could fall out of sync with save files during cloud sync
because the saveSlotWritten event only tracked the slot file and
History.gsi for incremental upload, not Players.gsi. This caused
slots without a matching Players.gsi entry to display the first
player's name due to a fallback to index 0.

- Track Players.gsi in saveSlotWritten handler for incremental uploads
- Remove broken fallback to player index 0 in name resolution
- Hide save slots with no Players.gsi entry from the save editor UI
2026-04-05 17:13:23 +02:00

61 lines
1.7 KiB
SQL

-- better-auth core tables (generated via getSchema with anonymous plugin)
CREATE TABLE IF NOT EXISTS "user" (
id TEXT PRIMARY KEY NOT NULL,
"name" TEXT NOT NULL,
"email" TEXT NOT NULL UNIQUE,
"emailVerified" INTEGER NOT NULL,
"image" TEXT,
"createdAt" TEXT NOT NULL,
"updatedAt" TEXT NOT NULL,
"isAnonymous" INTEGER
);
CREATE TABLE IF NOT EXISTS "session" (
id TEXT PRIMARY KEY NOT NULL,
"expiresAt" TEXT NOT NULL,
"token" TEXT NOT NULL UNIQUE,
"createdAt" TEXT NOT NULL,
"updatedAt" TEXT NOT NULL,
"ipAddress" TEXT,
"userAgent" TEXT,
"userId" TEXT NOT NULL REFERENCES "user"(id)
);
CREATE TABLE IF NOT EXISTS "account" (
id TEXT PRIMARY KEY NOT NULL,
"accountId" TEXT NOT NULL,
"providerId" TEXT NOT NULL,
"userId" TEXT NOT NULL REFERENCES "user"(id),
"accessToken" TEXT,
"refreshToken" TEXT,
"idToken" TEXT,
"accessTokenExpiresAt" TEXT,
"refreshTokenExpiresAt" TEXT,
"scope" TEXT,
"password" TEXT,
"createdAt" TEXT NOT NULL,
"updatedAt" TEXT NOT NULL
);
CREATE TABLE IF NOT EXISTS "verification" (
id TEXT PRIMARY KEY NOT NULL,
"identifier" TEXT NOT NULL,
"value" TEXT NOT NULL,
"expiresAt" TEXT NOT NULL,
"createdAt" TEXT NOT NULL,
"updatedAt" TEXT NOT NULL
);
-- Memory completions: every animation completion event is recorded
CREATE TABLE IF NOT EXISTS memory_completions (
id INTEGER PRIMARY KEY AUTOINCREMENT,
user_id TEXT NOT NULL,
object_id INTEGER NOT NULL,
event_id TEXT NOT NULL,
completed_at INTEGER NOT NULL,
char_index INTEGER NOT NULL,
display_name TEXT NOT NULL,
participants TEXT NOT NULL DEFAULT '[]',
UNIQUE(user_id, event_id)
);