{-# LANGUAGE TemplateHaskell #-}
module Hasura.Server.Migrate.LatestVersion
( latestCatalogVersion,
latestCatalogVersionString,
)
where
import Data.FileEmbed (embedStringFile, makeRelativeToProject)
import Hasura.Prelude
import Hasura.Server.Migrate.Version
import Language.Haskell.TH.Syntax qualified as TH
latestCatalogVersion :: MetadataCatalogVersion
latestCatalogVersion :: MetadataCatalogVersion
latestCatalogVersion =
$( do
let s = $(makeRelativeToProject "src-rsr/catalog_version.txt" >>= embedStringFile)
TH.lift (read s :: MetadataCatalogVersion)
)
latestCatalogVersionString :: Text
latestCatalogVersionString :: Text
latestCatalogVersionString = MetadataCatalogVersion -> Text
forall a. Show a => a -> Text
tshow MetadataCatalogVersion
latestCatalogVersion