mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-23 16:16:02 +00:00
clickhouse + mysql: modify table option
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
import FormArgumentList from '../forms/FormArgumentList.svelte';
|
||||
import { writable } from 'svelte/store';
|
||||
import FormProviderCore from '../forms/FormProviderCore.svelte';
|
||||
import createRef from '../utility/createRef';
|
||||
|
||||
export let title;
|
||||
export let fieldDefinitions;
|
||||
|
||||
@@ -89,6 +89,7 @@
|
||||
export let setTableInfo;
|
||||
export let dbInfo;
|
||||
export let driver;
|
||||
export let resetCounter;
|
||||
|
||||
$: isWritable = !!setTableInfo;
|
||||
|
||||
@@ -161,19 +162,21 @@
|
||||
|
||||
<div class="wrapper">
|
||||
{#if tableFormOptions}
|
||||
<ObjectFieldsEditor
|
||||
title="Table properties"
|
||||
fieldDefinitions={tableFormOptions}
|
||||
values={_.pick(
|
||||
tableInfo,
|
||||
tableFormOptions.map(x => x.name)
|
||||
)}
|
||||
onChangeValues={vals => {
|
||||
if (!_.isEmpty(vals)) {
|
||||
setTableInfo(tbl => ({ ...tbl, ...vals }));
|
||||
}
|
||||
}}
|
||||
/>
|
||||
{#key resetCounter}
|
||||
<ObjectFieldsEditor
|
||||
title="Table properties"
|
||||
fieldDefinitions={tableFormOptions}
|
||||
values={_.pick(
|
||||
tableInfo,
|
||||
tableFormOptions.map(x => x.name)
|
||||
)}
|
||||
onChangeValues={vals => {
|
||||
if (!_.isEmpty(vals)) {
|
||||
setTableInfo(tbl => ({ ...tbl, ...vals }));
|
||||
}
|
||||
}}
|
||||
/>
|
||||
{/key}
|
||||
{/if}
|
||||
|
||||
<ObjectListControl
|
||||
|
||||
@@ -72,6 +72,7 @@
|
||||
let domEditor;
|
||||
|
||||
let savedName;
|
||||
let resetCounter = 0;
|
||||
|
||||
export const activator = createActivator('TableStructureTab', true);
|
||||
|
||||
@@ -157,7 +158,8 @@
|
||||
|
||||
export async function reset() {
|
||||
await apiCall('database-connections/sync-model', { conid, database });
|
||||
clearEditorData();
|
||||
await clearEditorData();
|
||||
resetCounter++;
|
||||
}
|
||||
|
||||
// $: {
|
||||
@@ -172,6 +174,7 @@
|
||||
tableInfo={showTable}
|
||||
dbInfo={$dbInfo}
|
||||
{driver}
|
||||
{resetCounter}
|
||||
setTableInfo={objectTypeField == 'tables' && !$connection?.isReadOnly && hasPermission(`dbops/model/edit`)
|
||||
? tableInfoUpdater =>
|
||||
setEditorData(tbl =>
|
||||
|
||||
Reference in New Issue
Block a user