feat(epistemics): persist truth bundles with source provenance
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
package research_contracts_test
|
||||
|
||||
import (
|
||||
"os"
|
||||
"strings"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestTruthBundlePersistenceMigrationIsOwnedAndIdempotent(t *testing.T) {
|
||||
payload, err := os.ReadFile("../../database/migrations/034_epistemics_truth_bundles.sql")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
script := string(payload)
|
||||
for _, required := range []string{
|
||||
"SET ROLE epistemics_role",
|
||||
"CREATE TABLE IF NOT EXISTS epistemics.truth_bundles",
|
||||
"UNIQUE (snapshot_id, excerpt_id, claim_id)",
|
||||
"CREATE INDEX IF NOT EXISTS truth_bundles_source_time_idx",
|
||||
"RESET ROLE",
|
||||
} {
|
||||
if !strings.Contains(script, required) {
|
||||
t.Fatalf("migration missing %q", required)
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user