Documentation
¶
Overview ¶
Package migrate applies declarative Atlas HCL schemas to PostgreSQL databases.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Apply ¶
Apply loads colocated HCL and SQL migrations from schemaFS. SQL scripts marked phase pre run before the Atlas realm diff; all other SQL defaults to the post phase. Declared PostgreSQL roles and permissions are reconciled last. Tables absent from a partial schema bundle are never dropped unless WithTableDrops is supplied.
Types ¶
type Option ¶
type Option func(*options)
Option configures an HCL migration.
func WithExclude ¶
WithExclude excludes database objects from Atlas inspection. Values use Atlas's schema inspection patterns (for example "table.column").
func WithName ¶
WithName sets the metadata scope used for SQL hashes and managed security. It should be stable and unique for each migration bundle sharing a database.
func WithTableDrops ¶
func WithTableDrops() Option
WithTableDrops allows HCL files to remove tables. Drops are suppressed by default so a partial schema bundle cannot delete tables owned by consumers.