@@ -7,21 +7,25 @@ import (
77 "time"
88)
99
10+ // 0 means legacy. not hashed.
11+ const FormatVersion = 1
12+
1013// DDL-only schema snapshot; sizing/activity live in AnnotatedSchema
1114type SchemaSnapshot struct {
12- PgVersion string `json:"pg_version"`
13- Database string `json:"database"`
14- Timestamp time.Time `json:"timestamp"`
15- ContentHash string `json:"content_hash"`
16- Source * string `json:"source,omitempty"`
17- Tables []Table `json:"tables"`
18- Enums []EnumType `json:"enums"`
19- Domains []DomainType `json:"domains"`
20- Composites []CompositeType `json:"composites"`
21- Views []View `json:"views"`
22- Functions []Function `json:"functions"`
23- Extensions []Extension `json:"extensions"`
24- GUCs []GucSetting `json:"gucs"`
15+ FormatVersion int `json:"format_version"`
16+ PgVersion string `json:"pg_version"`
17+ Database string `json:"database"`
18+ Timestamp time.Time `json:"timestamp"`
19+ ContentHash string `json:"content_hash"`
20+ Source * string `json:"source,omitempty"`
21+ Tables []Table `json:"tables"`
22+ Enums []EnumType `json:"enums"`
23+ Domains []DomainType `json:"domains"`
24+ Composites []CompositeType `json:"composites"`
25+ Views []View `json:"views"`
26+ Functions []Function `json:"functions"`
27+ Extensions []Extension `json:"extensions"`
28+ GUCs []GucSetting `json:"gucs"`
2529}
2630
2731type Table struct {
@@ -441,6 +445,7 @@ type IndexActivityEntry struct {
441445
442446// Persisted planner inputs; schema_ref_hash binds rows to a SchemaSnapshot
443447type PlannerStatsSnapshot struct {
448+ FormatVersion int `json:"format_version"`
444449 SchemaRefHash string `json:"schema_ref_hash"`
445450 ContentHash string `json:"content_hash"`
446451 Database string `json:"database"`
@@ -456,6 +461,7 @@ type PlannerStatsSnapshot struct {
456461
457462// Persisted per-node activity counters
458463type ActivityStatsSnapshot struct {
464+ FormatVersion int `json:"format_version"`
459465 SchemaRefHash string `json:"schema_ref_hash"`
460466 ContentHash string `json:"content_hash"`
461467 Node NodeIdentity `json:"node"`
0 commit comments