@@ -20,15 +29,32 @@
+ {#if isRecreated}
+
+ {/if}
+
- {
- closeCurrentModal();
- onConfirm();
- }}
- />
-
+
+ {
+ closeCurrentModal();
+ onConfirm();
+ }}
+ />
+
+
@@ -39,4 +65,8 @@
height: 30vh;
width: 40vw;
}
+
+ .form-margin {
+ margin: var(--dim-large-form-margin);
+ }
diff --git a/packages/web/src/tabs/TableStructureTab.svelte b/packages/web/src/tabs/TableStructureTab.svelte
index edb376be..572aab2c 100644
--- a/packages/web/src/tabs/TableStructureTab.svelte
+++ b/packages/web/src/tabs/TableStructureTab.svelte
@@ -102,7 +102,7 @@
function doSave(createTableName) {
const driver = findEngineDriver($connection, $extensions);
- const sql = getAlterTableScript(
+ const { sql, recreates } = getAlterTableScript(
$editorValue.base,
fillConstraintNames($editorValue.current, driver.dialect),
{},
@@ -112,6 +112,7 @@
showModal(ConfirmSqlModal, {
sql,
+ recreates,
onConfirm: () => {
handleConfirmSql(sql, createTableName);
},
diff --git a/packages/web/src/utility/alterDatabaseTools.ts b/packages/web/src/utility/alterDatabaseTools.ts
index 7346d012..5eec5455 100644
--- a/packages/web/src/utility/alterDatabaseTools.ts
+++ b/packages/web/src/utility/alterDatabaseTools.ts
@@ -1,4 +1,4 @@
-import _ from 'lodash'
+import _ from 'lodash';
import { findEngineDriver, generateDbPairingId, getAlterDatabaseScript } from 'dbgate-tools';
import InputTextModal from '../modals/InputTextModal.svelte';
import { showModal } from '../modals/modalTools';
@@ -15,10 +15,11 @@ export async function alterDatabaseDialog(conid, database, updateFunc) {
const dbUpdated = _.cloneDeep(db);
updateFunc(dbUpdated);
- const sql = getAlterDatabaseScript(db, dbUpdated, {}, db, driver);
+ const { sql, recreates } = getAlterDatabaseScript(db, dbUpdated, {}, db, driver);
showModal(ConfirmSqlModal, {
sql,
+ recreates,
onConfirm: async () => {
const resp = await axiosInstance.request({
url: 'database-connections/run-script',