Safe Haskell | None |
---|---|
Language | Haskell2010 |
Migrations for the Hasura catalog.
To add a new migration:
- Bump the catalog version number in
src-rsr/catalog_version.txt
. - Add a migration script in the
src-rsrmigrations
directory with the nameversion_to_version.sql
. - Create a downgrade script in the
src-rsrmigrations
directory with the nameversion_to_version.sql
. - If making a new release, add the mapping from application version to catalog
schema version in
src-rsr/catalog_versions.txt
. - If appropriate, add the change to
serversrc-rsrinitialise.sql
for fresh installations of hasura.
The Template Haskell code in this module will automatically compile the new migration script into
the graphql-engine
executable.
NOTE: Please have a look at the `serverdocumentationmigration-guidelines.md` before adding any new migration if you haven't already looked at it
Documentation
data MigrationResult Source #
MRNothingToDo | |
MRInitialized | |
MRMigrated Text | old catalog version |
MRMaintanenceMode |
Instances
Eq MigrationResult Source # | |
Defined in Hasura.Server.Migrate (==) :: MigrationResult -> MigrationResult -> Bool # (/=) :: MigrationResult -> MigrationResult -> Bool # | |
Show MigrationResult Source # | |
Defined in Hasura.Server.Migrate showsPrec :: Int -> MigrationResult -> ShowS # show :: MigrationResult -> String # showList :: [MigrationResult] -> ShowS # | |
ToEngineLog MigrationResult Hasura Source # | |
Defined in Hasura.Server.Migrate toEngineLog :: MigrationResult -> (LogLevel, EngineLogType Hasura, Value) Source # |
data MigrationPair m Source #
migrateCatalog :: forall m. (MonadTx m, MonadIO m, MonadBaseControl IO m) => Maybe (SourceConnConfiguration ('Postgres 'Vanilla)) -> ExtensionsSchema -> MaintenanceMode () -> UTCTime -> m (MigrationResult, Metadata) Source #
downgradeCatalog :: forall m. (MonadIO m, MonadTx m) => Maybe (SourceConnConfiguration ('Postgres 'Vanilla)) -> DowngradeOptions -> UTCTime -> m MigrationResult Source #
migrations :: forall m. (MonadIO m, MonadTx m) => Maybe (SourceConnConfiguration ('Postgres 'Vanilla)) -> Bool -> MaintenanceMode () -> [(MetadataCatalogVersion, MigrationPair m)] Source #