import Link from 'next/link' import { useParams } from 'common' import { useProjectContext } from 'components/layouts/ProjectLayout/ProjectContext' import { ScaffoldContainer, ScaffoldDivider, ScaffoldSection, ScaffoldSectionContent, ScaffoldSectionDetail, } from 'components/layouts/Scaffold' import AlertError from 'components/ui/AlertError' import { GenericSkeletonLoader } from 'components/ui/ShimmeringLoader' import { useProjectUpgradeEligibilityQuery } from 'data/config/project-upgrade-eligibility-query' import { useReadReplicasQuery } from 'data/read-replicas/replicas-query' import { useIsFeatureEnabled } from 'hooks/misc/useIsFeatureEnabled' import { AlertDescription_Shadcn_, AlertTitle_Shadcn_, Alert_Shadcn_, Badge, Button, Input, TooltipContent_Shadcn_, TooltipTrigger_Shadcn_, Tooltip_Shadcn_, } from 'ui' import { ProjectUpgradeAlert } from '../General/Infrastructure/ProjectUpgradeAlert' import InstanceConfiguration from './InfrastructureConfiguration/InstanceConfiguration' const InfrastructureInfo = () => { const { ref } = useParams() const { project } = useProjectContext() const authEnabled = useIsFeatureEnabled('project_auth:all') const { data, error, isLoading: isLoadingUpgradeEligibility, isError: isErrorUpgradeEligibility, isSuccess: isSuccessUpgradeEligibility, } = useProjectUpgradeEligibilityQuery({ projectRef: ref, }) const { data: databases } = useReadReplicasQuery({ projectRef: ref }) const { current_app_version, latest_app_version, requires_manual_intervention } = data || {} const isOnLatestVersion = current_app_version === latest_app_version const currentPgVersion = (current_app_version ?? '').split('supabase-postgres-')[1] const latestPgVersion = (latest_app_version ?? '').split('supabase-postgres-')[1] const isInactive = project?.status === 'INACTIVE' const hasReadReplicas = (databases ?? []).length > 1 const subject = 'Request%20for%20Postgres%20upgrade%20for%20project' const message = `Upgrade information:%0A• Manual intervention reason: ${requires_manual_intervention}` return ( <> {project?.cloud_provider !== 'FLY' && ( <> )}

Service Versions

Information on your provisioned instance

{isInactive ? ( Service versions cannot be retrieved while project is paused Restoring the project will update Postgres to the newest version ) : ( <> {isLoadingUpgradeEligibility && } {isErrorUpgradeEligibility && ( )} {isSuccessUpgradeEligibility && ( <> {authEnabled && ( )} Latest Project is on the latest version of Postgres that Supabase supports ), ]} /> {data?.eligible && !hasReadReplicas && } {data.eligible && hasReadReplicas && ( A new version of Postgres is available for your project You will need to remove all read replicas first prior to upgrading your Postgrest version to the latest available ({latestPgVersion}). )} {!data?.eligible && data?.requires_manual_intervention && ( A new version of Postgres is available for your project

Please reach out to us via our support form if you are keen to upgrade your Postgres version to the latest available ({latestPgVersion}).

)} {!data?.eligible && (data?.extension_dependent_objects || []).length > 0 && ( New version of Postgres available

This project cannot be upgraded due to the following extension dependent objects:

    {(data?.extension_dependent_objects || []).map((obj) => (
  • {obj}
  • ))}

Once the above objects are exported and removed, you can proceed to upgrade your project, and re-import the objects after the upgrade operation is complete. Please refer to the docs on additional extensions that might also need to be dropped.

)} )} )}
) } export default InfrastructureInfo