Documentation
¶
Overview ¶
Package migrations registers all database migrations for the application. Migrations are executed in ULID order during application startup.
To add a new migration:
- Create a new file named `ULID_description.go` (e.g., `01JFGH12ABC_add_branch_table.go`)
- Generate a ULID using idwrap.NewNow().String()
- Implement the migration following the pattern in existing files
- Import the migration file in this package (side-effect import via init)
Migration checksums should be stable hashes of the migration logic. If you change migration code, you MUST change its checksum.
Index ¶
Constants ¶
const MigrationAddAITablesChecksum = "sha256:add-ai-tables-v1"
MigrationAddAITablesChecksum is a stable hash of this migration.
const MigrationAddAITablesID = "01KFF093T2EFF5NQH0GKHGP1QN"
MigrationAddAITablesID is the ULID for the AI tables migration.
const MigrationAddFlowErrorChecksum = "sha256:add-flow-error-and-node-id-mapping-v1"
const MigrationAddFlowErrorID = "01KJSYH5EHQ1MEG2R4H3N3WK71"
const MigrationAddFlowNodeWaitChecksum = "sha256:add-flow-node-wait-v1"
const MigrationAddFlowNodeWaitID = "01KJZMR5232X0983HYB7GS2WZ7"
const MigrationAddGraphQLDeltaFileKindChecksum = "sha256:add-graphql-delta-file-kind-v2"
MigrationAddGraphQLDeltaFileKindChecksum is a stable hash of this migration.
const MigrationAddGraphQLDeltaFileKindID = "01KK31SQD0GFP92RZ3XMN5V6BQ"
MigrationAddGraphQLDeltaFileKindID is the ULID for the GraphQL delta file kind migration.
const MigrationAddGraphQLTablesChecksum = "sha256:add-graphql-tables-v2"
MigrationAddGraphQLTablesChecksum is a stable hash of this migration.
const MigrationAddGraphQLTablesID = "01KHDYWX1KV5MX8H9MNTPCWDV9"
MigrationAddGraphQLTablesID is the ULID for the GraphQL tables migration.
const MigrationAddHttpIsSnapshotChecksum = "sha256:add-http-is-snapshot-v2"
MigrationAddHttpIsSnapshotChecksum is a stable hash of this migration.
const MigrationAddHttpIsSnapshotID = "01KGZC9EQCWJN09C2SJQBWRZQM"
MigrationAddHttpIsSnapshotID is the ULID for the http is_snapshot column migration.
const MigrationAddSubFlowTablesChecksum = "sha256:add-sub-flow-tables-v1"
const MigrationAddSubFlowTablesID = "01KK7EDJV31GSEJFTN11H5WGFH"
const MigrationAddUserAuthColumnsChecksum = "sha256:add-user-auth-columns-v2"
MigrationAddUserAuthColumnsChecksum is a stable hash of this migration.
const MigrationAddUserAuthColumnsID = "01KGTFDMC0A8NKA2ER2K6YFQCY"
MigrationAddUserAuthColumnsID is the ULID for the user auth columns migration.
const MigrationAddWebSocketTablesChecksum = "sha256:add-websocket-tables-v1"
MigrationAddWebSocketTablesChecksum is a stable hash of this migration.
const MigrationAddWebSocketTablesID = "01KKFQT81KV5MX8H9MNTPCWDV9"
MigrationAddWebSocketTablesID is the ULID for the WebSocket tables migration.
const MigrationEnforceDeltaSnapshotExclusivityChecksum = "sha256:enforce-delta-snapshot-exclusivity-v1"
MigrationEnforceDeltaSnapshotExclusivityChecksum is a stable hash of this migration.
const MigrationEnforceDeltaSnapshotExclusivityID = "01KH1AZ5P9V9SD3XTXM9W1RNK7"
MigrationEnforceDeltaSnapshotExclusivityID is the ULID for the delta/snapshot mutual exclusivity migration.
const MigrationRepackFileDisplayOrderChecksum = "sha256:repack-file-display-order-v1"
MigrationRepackFileDisplayOrderChecksum is a stable hash of this migration.
const MigrationRepackFileDisplayOrderID = "01KWRQ3ZC05MK9VPB0ZMQZCZ4G"
MigrationRepackFileDisplayOrderID is the ULID for the file display_order repack migration.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct {
// DatabasePath is the absolute path to the SQLite database file.
DatabasePath string
// DataDir is the base data directory (backups stored under DataDir/migrations/backups).
DataDir string
// Logger for migration events.
Logger *slog.Logger
}
Config holds configuration for running migrations.
Source Files
¶
- 01KFF093_add_ai_tables.go
- 01KGTFDM_add_external_id.go
- 01KGZC9E_add_http_is_snapshot.go
- 01KH1AZ5_enforce_delta_snapshot_exclusivity.go
- 01KHDYWX_add_graphql_tables.go
- 01KJSYH5_add_flow_error.go
- 01KJZMR5_add_flow_node_wait.go
- 01KK31SQ_add_graphql_delta_file_kind.go
- 01KK7EDJ_add_sub_flow_tables.go
- 01KKFQT8_add_websocket_tables.go
- 01KWRQ3Z_repack_file_display_order.go
- migrations.go