The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.
TypeScript aialternativeauthdatabasedenoembeddingsexamplefirebasenextjsoauth2pgvectorpostgispostgrespostgresqlpostgrestrealtimesupabasevectorswebsockets
Invalidate project upgrade eligibility query when disabling database extension (#37589)
Joshen Lim58d6b4b91228
diff --git a/apps/studio/components/interfaces/Database/Extensions/ExtensionCard.tsx b/apps/studio/components/interfaces/Database/Extensions/ExtensionCard.tsxindex c155b75005a..b68d93f3c97 100644--- a/apps/studio/components/interfaces/Database/Extensions/ExtensionCard.tsx+++ b/apps/studio/components/interfaces/Database/Extensions/ExtensionCard.tsx@@ -111,7 +111,7 @@ const ExtensionCard = ({ extension }: ExtensionCardProps) => {<div className={cn('flex h-full flex-col gap-y-3 py-3', X_PADDING)}><p className="text-sm text-foreground-light capitalize-sentence">{extension.comment}</p>- <div className="flex items-center gap-x-2">+ <div className="flex items-center gap-2 flex-wrap">{extensionMeta?.github_url && (<Button asChild type="default" icon={<Github />} className="rounded-full"><adiff --git a/apps/studio/components/interfaces/Settings/Infrastructure/UpgradeWarnings.tsx b/apps/studio/components/interfaces/Settings/Infrastructure/UpgradeWarnings.tsxindex 29e67a85e57..5937daaddf5 100644--- a/apps/studio/components/interfaces/Settings/Infrastructure/UpgradeWarnings.tsx+++ b/apps/studio/components/interfaces/Settings/Infrastructure/UpgradeWarnings.tsx@@ -1,3 +1,5 @@+import { useParams } from 'common'+import Link from 'next/link'import { Alert_Shadcn_, AlertDescription_Shadcn_, AlertTitle_Shadcn_, Button } from 'ui'export const ReadReplicasWarning = ({ latestPgVersion }: { latestPgVersion: string }) => {@@ -27,7 +29,7 @@ export const ObjectsToBeDroppedWarning = ({<AlertTitle_Shadcn_>A new version of Postgres is available</AlertTitle_Shadcn_><AlertDescription_Shadcn_ className="flex flex-col gap-3"><div>- <p className="mb-1">You'll need to remove the following objects before upgrading:</p>+ <p className="mb-1">The following objects have to be removed before upgrading:</p><ul className="pl-4">{objectsToBeDropped.map((obj) => (@@ -59,6 +61,8 @@ export const UnsupportedExtensionsWarning = ({}: {unsupportedExtensions: string[]}) => {+ const { ref } = useParams()+return (<Alert_Shadcn_variant="warning"@@ -67,12 +71,17 @@ export const UnsupportedExtensionsWarning = ({<AlertTitle_Shadcn_>A new version of Postgres is available</AlertTitle_Shadcn_><AlertDescription_Shadcn_ className="flex flex-col gap-3"><div>- <p className="mb-1">You'll need to remove the following extensions before upgrading:</p>+ <p className="mb-1">The following extensions have to be removed before upgrading:</p><ul className="pl-4">{unsupportedExtensions.map((obj: string) => (<li className="list-disc" key={obj}>- {obj}+ <Link+ href={`/project/${ref}/database/extensions?filter=${obj}`}+ className="hover:text-foreground transition"+ >+ {obj}+ </Link></li>))}</ul>diff --git a/apps/studio/data/database-extensions/database-extension-disable-mutation.ts b/apps/studio/data/database-extensions/database-extension-disable-mutation.tsindex 241be5740bd..7f1723db365 100644--- a/apps/studio/data/database-extensions/database-extension-disable-mutation.ts+++ b/apps/studio/data/database-extensions/database-extension-disable-mutation.ts@@ -2,6 +2,7 @@ import pgMeta from '@supabase/pg-meta'import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query'import { toast } from 'sonner'+import { configKeys } from 'data/config/keys'import { executeSql } from 'data/sql/execute-sql-query'import type { ResponseError } from 'types'import { databaseExtensionsKeys } from './keys'@@ -56,7 +57,10 @@ export const useDatabaseExtensionDisableMutation = ({>((vars) => disableDatabaseExtension(vars), {async onSuccess(data, variables, context) {const { projectRef } = variables- await queryClient.invalidateQueries(databaseExtensionsKeys.list(projectRef))+ await Promise.all([+ queryClient.invalidateQueries(databaseExtensionsKeys.list(projectRef)),+ queryClient.invalidateQueries(configKeys.upgradeEligibility(projectRef)),+ ])await onSuccess?.(data, variables, context)},async onError(data, variables, context) {