B4: chain tables, HD index assignment and signing key reserved to the worker (DAT-81..84, ARC-78)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
davideandClaude Sonnet 5.5 committed 2026-11-16 15:53:50 +01:00
1 parent 0092596b07
commit f1d09075a1
18 files changed
+741 -8

No files matched your search

@@ -0,0 +1,20 @@
"""Transaction versions are append-only in the database too (DAT-83): a raw `UPDATE` or `DELETE` is refused.
SQLite syntax, like the audit triggers (ADR-55)."""
from django.db import migrations
CREATE = [
"""CREATE TRIGGER lottery_txversion_no_update BEFORE UPDATE ON lottery_transactionversion
BEGIN SELECT RAISE(ABORT, 'transaction versions are append-only'); END""",
"""CREATE TRIGGER lottery_txversion_no_delete BEFORE DELETE ON lottery_transactionversion
BEGIN SELECT RAISE(ABORT, 'transaction versions are append-only'); END""",
]
DROP = [
"DROP TRIGGER IF EXISTS lottery_txversion_no_update",
"DROP TRIGGER IF EXISTS lottery_txversion_no_delete",
]
class Migration(migrations.Migration):
dependencies = [("lottery", "0004_chain_tables")]
operations = [migrations.RunSQL(sql=CREATE, reverse_sql=DROP)]