package store import ( "context" "database/sql" "pageswiki/internal/db" ) type SchemaInspection struct { Coverage string `json:"coverage"` Components []db.MigrationInspection `json:"components"` LegacyAreas []string `json:"legacy_areas"` } // InspectSchema deliberately does not construct a Store: constructors can // migrate, backfill, generate keys, seed defaults and requeue interrupted jobs. func InspectSchema(ctx context.Context, database *sql.DB) (SchemaInspection, error) { plans := make(map[string][]db.SQLMigration, len(managedStoreSchemas)+1) for name, steps := range managedStoreSchemas { plans[name] = steps } plans["document-store"] = documentBackfillMigrations components, err := db.InspectSQLiteMigrations(ctx, database, plans) return SchemaInspection{Coverage: "managed-components-only", Components: components, LegacyAreas: []string{ "core-bootstrap", "campuses/domains/federation", "auth/ACL/user-space", "outbox/notifications/publication-approval", "City", "tasks/calendars", "periodicals", "search/object-listing/assets/GC", }}, err }