- game_saves table + migration 002 (JSON state, anti-cheat metadata) - saveControllers.js : load/save avec validation delta ressources (750k/s × 1.1) - GameSaveManager : upsert MySQL ON DUPLICATE KEY UPDATE - useSaveSync hook : auto-save 30s + keepalive beforeunload + guest fallback - save-validation.test.ts : 8 tests anti-cheat - economy.ts : arbre d'évolution 5 nœuds + prestige ADN (rattrapage step 2) - economy.test.ts : +40 tests (évolution tree, multipliers, start bonus) - GDD + SPRINT1.md : docs sprint complètes - Rethème data : shop.json, Achievements.json, Cookie, Legal (rattrapage step 1)
15 lines
560 B
SQL
15 lines
560 B
SQL
-- Migration 002 — Game saves with anti-cheat metadata
|
|
-- Safe: CREATE TABLE IF NOT EXISTS, no data loss
|
|
-- Run: mysql -u <user> -p clickerz < migrations/002_game_saves.sql
|
|
|
|
CREATE TABLE IF NOT EXISTS game_saves (
|
|
id INT AUTO_INCREMENT PRIMARY KEY,
|
|
user_id INT NOT NULL UNIQUE,
|
|
game_state JSON NOT NULL,
|
|
last_save TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
|
lifetime_tadpoles BIGINT DEFAULT 0,
|
|
prestige_count INT DEFAULT 0,
|
|
play_time_seconds INT DEFAULT 0,
|
|
FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE
|
|
);
|