Documentation
¶
Overview ¶
Package migrations embeds AuthKit's Postgres schema migrations.
Run them with migratekit (github.com/open-rails/migratekit), the same way host applications do — name-tracked per app in public.migrations, so a recorded migration is never re-applied:
ms, _ := migratekit.LoadFromFS(migrations.FS) m := migratekit.NewPostgres(sqlDB, "authkit") _ = m.ApplyMigrations(ctx, ms)
Hosts that configure a non-default schema (core.Config.Schema, authkit issue 69) must run the migrations rendered for that schema instead:
fsys, _ := migrations.FSForSchema("openrails_auth")
ms, _ := migratekit.LoadFromFS(fsys)
Index ¶
Constants ¶
This section is empty.
Variables ¶
var FS = migrationFS
FS exposes the embedded SQL for external runners. It targets the default "profiles" schema; see FSForSchema for a configurable schema.
Functions ¶
func FSForSchema ¶ added in v0.26.0
FSForSchema returns the embedded migrations rendered for the given schema: every reference to the default "profiles" schema in the DDL (CREATE SCHEMA, qualified table/function names, table_schema string literals) is replaced with the configured name. The schema must match ^[a-z_][a-z0-9_]*$ (max 63 bytes). For "profiles" (or empty) it returns the embedded FS unchanged, so callers can pass core.Service.Schema() unconditionally.
This is a deliberate, validated text substitution performed once at load time — the embedded files themselves are never modified, and the FS export above keeps its historical behavior.
Types ¶
This section is empty.