- Ya
- 9 Agosti 2026, 22:52 UTC
- Mwandishi
- Kamo
- Ahadi ya
- 56e7492
All 15 migrations now apply cleanly to YugabyteDB: 111 tables, matching CockroachDB exactly. Eight distinct CockroachDB-only constructs had to be handled, found one at a time by running the migrator until it stopped failing: STRING/BYTES types, USING HASH bucket_count, inline INDEX inside CREATE TABLE, ON UPDATE column clauses, row-level TTL, ALTER PRIMARY KEY, ADD CONSTRAINT IF NOT EXISTS, and x'..' byte literals. Three of those were behavioural, not syntactic, and would have passed a syntax check while silently changing what the database does: - ON UPDATE now() genuinely maintains a column on every update. Dropping it would have frozen 20 updated_at/last_seen_at columns at their insert value. Replaced with BEFORE UPDATE triggers. - Row-level TTL actually deletes rows. Eight tables had retention policies (chat_messages 90 days, player_sessions_daily 400, ...). Stripping the clause is required to parse, so the policies are re-implemented as explicit DELETEs in 02-retention-sweeper.sql. Nothing enforces that correspondence now -- each statement names the policy it replaces. - x'DEADBEEF' is a BYTES literal in CockroachDB but a BIT STRING in PostgreSQL. The 8 affected literals are 32-byte worldgen master seeds that every planet's terrain derives from; verified byte-identical after conversion to '\xDEADBEEF'::bytea.