feat(gl): add immutable postgres ledger storage

This commit is contained in:
2026-08-14 19:00:45 +03:30
parent b1e0b01598
commit 0b3eaa0c3d
14 changed files with 1139 additions and 1 deletions
+26
View File
@@ -0,0 +1,26 @@
package postgres
import (
"strings"
"testing"
)
func TestInitialMigrationContainsLedgerSafetyGuards(t *testing.T) {
contents, err := migrationFiles.ReadFile("migrations/000001_init.up.sql")
if err != nil {
t.Fatal(err)
}
schema := string(contents)
for _, required := range []string{
"amount numeric(38, 18)",
"idempotency_key text NOT NULL UNIQUE",
"guard_journal_seal",
"journal is not balanced per asset",
"cannot append to a sealed journal",
"reject_ledger_mutation",
} {
if !strings.Contains(schema, required) {
t.Fatalf("migration is missing %q", required)
}
}
}