mirror of
https://github.com/Mezeporta/Erupe.git
synced 2026-03-22 07:32:32 +01:00
docs: log savedata corruption defense in CHANGELOG
Merge migrations 0007 and 0008 into a single 0007_savedata_integrity migration since neither has been released yet.
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
-- Rotating savedata backup table (3 slots per character, time-gated).
|
||||
-- Savedata integrity protections: rotating backups + checksum verification.
|
||||
|
||||
-- Rotating backup table (3 slots per character, time-gated).
|
||||
-- Prevents permanent data loss from save corruption by keeping recent snapshots.
|
||||
CREATE TABLE IF NOT EXISTS savedata_backups (
|
||||
char_id INTEGER NOT NULL REFERENCES characters(id) ON DELETE CASCADE,
|
||||
@@ -7,3 +9,8 @@ CREATE TABLE IF NOT EXISTS savedata_backups (
|
||||
saved_at TIMESTAMPTZ NOT NULL DEFAULT now(),
|
||||
PRIMARY KEY (char_id, slot)
|
||||
);
|
||||
|
||||
-- SHA-256 checksum column for savedata integrity verification.
|
||||
-- Stored as 32 raw bytes (not hex). NULL means no hash computed yet
|
||||
-- (backwards-compatible with existing data).
|
||||
ALTER TABLE characters ADD COLUMN IF NOT EXISTS savedata_hash BYTEA;
|
||||
@@ -1,4 +0,0 @@
|
||||
-- Add SHA-256 checksum column for savedata integrity verification.
|
||||
-- Stored as 32 raw bytes (not hex). NULL means no hash computed yet
|
||||
-- (backwards-compatible with existing data).
|
||||
ALTER TABLE characters ADD COLUMN IF NOT EXISTS savedata_hash BYTEA;
|
||||
Reference in New Issue
Block a user