Documentation
¶
Index ¶
- Constants
- func ConnectPostgres(dsn string) (*gorm.DB, error)
- func EnsureInstallID(db *gorm.DB) (string, error)
- func NewRedis(addr, password string, db int) (*redis.Client, error)
- func SeedAdmin(db *gorm.DB, email, password string) (*models.User, error)
- func SeedDefaultOrganization(db *gorm.DB) (*models.Organization, error)
- func SeedPlans(db *gorm.DB) error
Constants ¶
const InstallIDKey = "install_id"
InstallIDKey is the settings key holding this deployment's stable Install ID.
Variables ¶
This section is empty.
Functions ¶
func ConnectPostgres ¶
ConnectPostgres opens a GORM connection to PostgreSQL without running migrations.
func EnsureInstallID ¶
EnsureInstallID returns this instance's stable Install ID, generating and persisting one on first call. The ID is immutable for the life of the deployment: it uniquely identifies the instance to the license/customer portal (a customer copies it when purchasing a license), so it must survive restarts and never change. Idempotent and race-safe across concurrent boots (server + worker) via FirstOrCreate.
func SeedAdmin ¶
SeedAdmin ensures a platform admin exists: returns the existing admin if one is already present, otherwise creates one from the configured credentials. Idempotent — safe to run on every boot. (Mirrors the Posta admin seeder.)
func SeedDefaultOrganization ¶
func SeedDefaultOrganization(db *gorm.DB) (*models.Organization, error)
SeedDefaultOrganization ensures exactly one default organization exists — the realm new workspaces and SSO providers attach to. Idempotent; safe on every boot. Returns the default org.
Types ¶
This section is empty.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package logbackfill migrates pre-existing large log rows out of Postgres into the shared log store (see plans/log-storage.md, sub-phase P6).
|
Package logbackfill migrates pre-existing large log rows out of Postgres into the shared log store (see plans/log-storage.md, sub-phase P6). |
|
upgrade
Package upgrade runs ordered, versioned data-upgrade steps.
|
Package upgrade runs ordered, versioned data-upgrade steps. |