// Package store holds Base's members and app installs. package store import ( "embed" "amadan.net/oficina/home/connect/linkstore" "amadan.net/oficina/home/handoff" "amadan.net/rastrillo/rastrillo/auth" "amadan.net/rastrillo/rastrillo/migrate" "amadan.net/rastrillo/rastrillo/passkey" "amadan.net/rastrillo/rastrillo/pow" "amadan.net/rastrillo/rastrillo/sessions" ) //go:embed migrations/*.sql var migrationFS embed.FS // Schema holds only Base's own tables. var Schema = migrate.MustFromFS(migrationFS, "base") // BootSchema adds the framework tables the sign-in flow needs: sessions, // email links, the sign-in form's proof and passkeys. var BootSchema = migrate.Merge(sessions.Schema, auth.Schema, pow.Schema, passkey.Schema, Schema) // HomeSchema is what Oficina ID sign-in adds: the hand-off exchange and the // account links, in the namespaces every Oficina app uses for them. var HomeSchema = migrate.Merge( migrate.MustFromFS(handoff.Migrations, "oficina_handoff"), migrate.MustFromFS(linkstore.Migrations, linkstore.SchemaNamespace), ) // Boot is the schema to apply at start-up: BootSchema, and HomeSchema too // when Oficina ID sign-in is on. func Boot(home bool) *migrate.Set { if home { return migrate.Merge(BootSchema, HomeSchema) } return BootSchema }