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 { useProjectServiceVersionsQuery } from 'data/projects/project-service-versions' import { useReadReplicasQuery } from 'data/read-replicas/replicas-query' import { useIsFeatureEnabled } from 'hooks/misc/useIsFeatureEnabled' import { AlertDescription_Shadcn_, AlertTitle_Shadcn_, Alert_Shadcn_, Badge, Button, Input, Tooltip, TooltipContent, TooltipTrigger, } 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: serviceVersions, error: serviceVersionsError, isLoading: isLoadingServiceVersions, isError: isErrorServiceVersions, isSuccess: isSuccessServiceVersions, } = useProjectServiceVersionsQuery({ projectRef: ref }) const { data: databases } = useReadReplicasQuery({ projectRef: ref }) const { current_app_version, current_app_version_release_channel, latest_app_version } = data || {} const isOnLatestVersion = current_app_version === latest_app_version const currentPgVersion = (current_app_version ?? '') .split('supabase-postgres-')[1] ?.replace('-orioledb', '') const isOnNonGenerallyAvailableReleaseChannel = current_app_version_release_channel && current_app_version_release_channel !== 'ga' ? current_app_version_release_channel : undefined const isOrioleDb = (current_app_version ?? '').includes('orioledb') const latestPgVersion = (latest_app_version ?? '').split('supabase-postgres-')[1] const isInactive = project?.status === 'INACTIVE' const hasReadReplicas = (databases ?? []).length > 1 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 && ( <> {isLoadingServiceVersions && } {isErrorServiceVersions && ( )} {isSuccessServiceVersions && ( <> {authEnabled && ( )} {isOnNonGenerallyAvailableReleaseChannel} This project uses a {isOnNonGenerallyAvailableReleaseChannel}{' '} database version release ), isOrioleDb && ( <> OrioleDB This project uses OrioleDB ), isOnLatestVersion && ( 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 prior to upgrading 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