diff --git a/frontend/src/lib/components/DatatableSchemaDiff.svelte b/frontend/src/lib/components/DatatableSchemaDiff.svelte index 485559c31c..b2c303fab3 100644 --- a/frontend/src/lib/components/DatatableSchemaDiff.svelte +++ b/frontend/src/lib/components/DatatableSchemaDiff.svelte @@ -157,6 +157,7 @@ import { runScriptAndPollResult } from '$lib/components/jobs/utils' import YAML from 'yaml' import DrawerContent from './common/drawer/DrawerContent.svelte' + import ConfirmationModal from './common/confirmationModal/ConfirmationModal.svelte' import Alert from './common/alert/Alert.svelte' interface Props { @@ -178,6 +179,7 @@ let drawerDirection: 'ahead' | 'behind' | undefined = $state(undefined) let migrationSql = $state('') let migrationRunning = $state(false) + let confirmDeployOpen = $state(false) async function loadDiffs() { loading = true @@ -453,7 +455,17 @@ > {#snippet actions()} (drawerOpen = false)}>Cancel - + { + if (drawerDirection === 'ahead') { + confirmDeployOpen = true + } else { + runMigration() + } + }} + > Run migration {/snippet} @@ -500,3 +512,24 @@ {/if} + + { + confirmDeployOpen = false + await runMigration() + }} + onCanceled={() => { + confirmDeployOpen = false + }} +> + + This will run the following SQL on {parentWorkspaceId}: + + {migrationSql} +
+ This will run the following SQL on {parentWorkspaceId}: +
{migrationSql}