Extract Grammaratur, Dregarnuhr, Geduldh, Mestionora, Ordoschnellic, Schutzaria, Kunstzeal and Seheweit behind compatible application contracts. Include accumulated editor resilience, navigation and theme UX, remote CLI, storage/schema and DR groundwork, tests and design/operations documentation. Verified: uncached full Go suite; go vet ./...; race tests for all eight components; 11 targeted Chromium tests; Node suites; 19 Python CLI tests; reproducible editor build. No push, release tag or deployment in this checkpoint.
30 lines
1.1 KiB
Go
30 lines
1.1 KiB
Go
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
|
|
}
|