Documentation
¶
Overview ¶
Package migrations is fabriq's DDL authority: grove Go-code migrations for every fabriq-owned table. The registry never generates DDL; the registry-conformance integration test keeps the two in sync.
Run them with `fabriq migrate up|down|status` (which wraps grove's orchestrator under its advisory migration lock) — never at app startup. Expand/contract discipline is documented in docs/MIGRATIONS.md.
Index ¶
Constants ¶
const GroupName = "fabriq"
GroupName identifies fabriq's migration group; host applications that embed fabriq alongside their own grove migration groups can depend on it (migrate.DependsOn(migrations.GroupName)).
Variables ¶
This section is empty.
Functions ¶
func Group ¶
Group returns fabriq's migration group with all migrations registered, in version order.
func NewOrchestrator ¶
func NewOrchestrator(drv any) (*migrate.Orchestrator, error)
NewOrchestrator builds a grove migration orchestrator for the given driver (a *pgdriver.PgDB). The orchestrator acquires grove's migration lock on a dedicated connection, so concurrent `fabriq migrate` runs are safe.
func OpenOrchestrator ¶
OpenOrchestrator dials Postgres and returns a ready orchestrator plus a close function. It exists so the CLI (and worker bootstrap) can run migrations without importing grove drivers directly — driver imports stay fenced to adapters/, fabriqtest/ and this package.
func ScopeAwareTenantPolicy ¶
ScopeAwareTenantPolicy returns the SQL to (re)create the tenant_isolation policy with the soft secondary-scope predicate for a table that has a nullable scope_id column. Tenant stays the hard boundary; scope is soft: an unscoped read (app.scope_id=”) sees all rows in the tenant; a scoped read sees its scope plus shared (NULL-scope) rows. Consumers (kgkit/twinos) reuse this for their own entity tables that adopt scope_id.
Types ¶
This section is empty.
Source Files
¶
- 0001_outbox.go
- 0002_projection_state.go
- 0003_site_asset_tag.go
- 0004_rls_policies.go
- 0005_timescale.go
- 0006_pgvector.go
- 0007_crdt_updates.go
- 0008_crdt_docs.go
- 0009_link.go
- 0010_live_subscriptions.go
- 0011_postgis.go
- 0012_scope.go
- 0013_crdt_scope.go
- 0014_blob.go
- 0015_blob_cas_created_at.go
- 0016_fs_node.go
- 0017_fs_node_mount.go
- 0018_fs_permission.go
- 0019_fs_share.go
- 0020_fs_bookmark.go
- 0021_blob_source.go
- 0022_digest_node.go
- module.go
- runner.go