mirror of
https://github.com/hasura/graphql-engine.git
synced 2024-12-14 17:02:49 +03:00
server: check for event triggers before throwing source-cleanup-failed
warnings
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/8885 GitOrigin-RevId: 7e02829608c6838f5db8226b532b436dd97f1b22
This commit is contained in:
parent
8af30c4c6b
commit
b158aae73b
@ -119,14 +119,6 @@ tests = do
|
||||
`shouldReturnYaml` [yaml|
|
||||
is_consistent: true
|
||||
inconsistent_objects: []
|
||||
warnings:
|
||||
- code: source-cleanup-failed
|
||||
message: >-
|
||||
Could not cleanup the source '"postgres"' while dropping it from the graphql-engine as it is
|
||||
inconsistent. Please consider cleaning the resources created by the graphql engine, refer
|
||||
https://hasura.io/docs/latest/graphql/core/event-triggers/remove-event-triggers/#clean-footprints-manually
|
||||
type: source
|
||||
name: source postgres
|
||||
|]
|
||||
|
||||
reloadMetadata :: Value
|
||||
|
@ -103,10 +103,11 @@ postDropSourceHookHelper ::
|
||||
postDropSourceHookHelper oldSchemaCache sourceName sourceMetadataBackend = do
|
||||
logger :: (HL.Logger HL.Hasura) <- asks getter
|
||||
|
||||
AB.dispatchAnyBackend @BackendMetadata sourceMetadataBackend \(_ :: SourceMetadata b) -> do
|
||||
AB.dispatchAnyBackend @BackendMetadata sourceMetadataBackend \(oldSourceMetadata :: SourceMetadata b) -> do
|
||||
let sourceInfoMaybe = unsafeSourceInfo @b =<< HM.lookup sourceName (scSources oldSchemaCache)
|
||||
case sourceInfoMaybe of
|
||||
Nothing -> do
|
||||
unless (null (getTriggersMap oldSourceMetadata)) do
|
||||
let message =
|
||||
"Could not cleanup the source '"
|
||||
<> sourceName
|
||||
@ -475,8 +476,8 @@ runReplaceMetadataV2' ReplaceMetadataV2 {..} = do
|
||||
flip catchError catcher do
|
||||
sourceConfigMaybe <- askSourceConfigMaybe @b source
|
||||
case sourceConfigMaybe of
|
||||
Nothing -> do
|
||||
-- TODO: Add user facing docs on how to drop triggers manually. Issue #7104
|
||||
Nothing ->
|
||||
unless (null oldTriggersMap) do
|
||||
let message =
|
||||
"Could not drop SQL triggers present in the source '"
|
||||
<> source
|
||||
|
Loading…
Reference in New Issue
Block a user