UpgradeDatabaseAlert.tsx31 lines · main
| 1 | import Link from 'next/link' |
| 2 | import { Button } from 'ui' |
| 3 | import { Admonition } from 'ui-patterns/admonition' |
| 4 | |
| 5 | import { useSelectedProjectQuery } from '@/hooks/misc/useSelectedProject' |
| 6 | |
| 7 | interface UpgradeDatabaseAlertProps { |
| 8 | minimumVersion?: string |
| 9 | } |
| 10 | |
| 11 | export const UpgradeDatabaseAlert = ({ minimumVersion = '15.6' }: UpgradeDatabaseAlertProps) => { |
| 12 | const { data: project } = useSelectedProjectQuery() |
| 13 | |
| 14 | return ( |
| 15 | <Admonition |
| 16 | type="default" |
| 17 | title="Database upgrade needed" |
| 18 | childProps={{ description: { className: 'flex flex-col gap-y-2' } }} |
| 19 | > |
| 20 | <div className="prose text-sm max-w-full"> |
| 21 | <p> |
| 22 | This integration requires the <code>pgmq</code> extension which is not available on this |
| 23 | version of Postgres. The extension is available on version {minimumVersion} and higher. |
| 24 | </p> |
| 25 | </div> |
| 26 | <Button color="primary" className="w-fit"> |
| 27 | <Link href={`/project/${project?.ref}/settings/infrastructure`}>Upgrade database</Link> |
| 28 | </Button> |
| 29 | </Admonition> |
| 30 | ) |
| 31 | } |