mirror of
https://github.com/hasura/graphql-engine.git
synced 2024-12-17 20:41:49 +03:00
647231b685
Manually enables: * EmptyCase * ExistentialQuantification * QuantifiedConstraints * QuasiQuotes * TemplateHaskell * TypeFamilyDependencies ...in the following components: * 'graphql-engine' library * 'graphql-engine' 'src-test' * 'graphql-engine' 'tests/integration' * 'graphql-engine' tests-hspec' Additionally, performs some light refactoring and documentation. PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3991 GitOrigin-RevId: 514477d3466b01f60eca8935d0fef60dd0756838
30 lines
1.1 KiB
Haskell
30 lines
1.1 KiB
Haskell
{-# LANGUAGE TemplateHaskell #-}
|
|
|
|
-- | A module that defines the current catalog version and nothing else. This is necessary to
|
|
-- circumvent the unfortunate “GHC stage restriction,” which prevents us from using a binding in a
|
|
-- compile-time splice unless it is defined in a different module. The actual migration code is in
|
|
-- "Hasura.Server.Migrate".
|
|
module Hasura.Server.Migrate.Version
|
|
( latestCatalogVersion,
|
|
latestCatalogVersionString,
|
|
)
|
|
where
|
|
|
|
import Data.FileEmbed (embedStringFile, makeRelativeToProject)
|
|
import Data.Text qualified as T
|
|
import Hasura.Prelude
|
|
import Language.Haskell.TH.Syntax qualified as TH
|
|
|
|
-- | The current catalog schema version. We store this in a file
|
|
-- because we want to append the current verson to the catalog_versions file
|
|
-- when tagging a new release, in @tag-release.sh@.
|
|
latestCatalogVersion :: Integer
|
|
latestCatalogVersion =
|
|
$( do
|
|
let s = $(makeRelativeToProject "src-rsr/catalog_version.txt" >>= embedStringFile)
|
|
TH.lift (read s :: Integer)
|
|
)
|
|
|
|
latestCatalogVersionString :: Text
|
|
latestCatalogVersionString = T.pack $ show latestCatalogVersion
|