package idear import ( "embed" "github.com/carlosframework/rastrillo/migrate" ) //go:embed migrations var migrationFS embed.FS // Schema is idear's migration set, following the sessions / auth / // blobs convention exactly. // // Merge it into your app's BootSchema — // migrate.Merge(sessions.Schema, idear.Schema, Schema) — and apply // that merged set at boot. Never merge it into your app's own Schema, // and never add idear's model structs to your app's own Models list: // rastrillo's `migration check`/`generate` diff one app's Schema // against that same app's Models as a matched pair, so mixing idear's // models into your app's list compares them against a Schema that has // no idear migrations in it. That makes `migration check` permanently // red and makes `generate` write a second, GORM-flavoured // `CREATE TABLE idear_members` into your app's own migration file — // one that collides at boot with idear's own // `CREATE TABLE IF NOT EXISTS idear_members` from BootSchema. idear's // Schema and its model structs are a pair scoped to idear alone; no // core subsystem (sessions, auth, blobs, passkey) exports its models // for the same reason. var Schema = migrate.MustFromFS(migrationFS, "idear") // models is idear's own model list, used only by idear's tests to // check Schema and the struct tags agree. It is deliberately // unexported — see Schema's doc comment for why an app must never be // handed this list. func models() []any { return []any{&Member{}, &Invitation{}} }