mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-23 23:05:59 +00:00
PK editor iun column editor
This commit is contained in:
@@ -21,6 +21,7 @@ function fillTableExtendedInfo(db: DatabaseInfo): DatabaseInfo {
|
|||||||
columns: (obj.columns || []).map(column => ({
|
columns: (obj.columns || []).map(column => ({
|
||||||
pureName: obj.pureName,
|
pureName: obj.pureName,
|
||||||
schemaName: obj.schemaName,
|
schemaName: obj.schemaName,
|
||||||
|
isPrimaryKey: !!(obj.primaryKey && obj.primaryKey.columns.find(x => x.columnName == column.columnName)),
|
||||||
...column,
|
...column,
|
||||||
})),
|
})),
|
||||||
primaryKey: obj.primaryKey
|
primaryKey: obj.primaryKey
|
||||||
|
|||||||
@@ -22,15 +22,7 @@
|
|||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<FormProvider
|
<FormProvider initialValues={columnInfo}>
|
||||||
initialValues={{
|
|
||||||
...columnInfo,
|
|
||||||
isPrimaryKey:
|
|
||||||
!!columnInfo &&
|
|
||||||
!!tableInfo?.primaryKey &&
|
|
||||||
!!tableInfo.primaryKey.columns.find(x => x.columnName == columnInfo.columnName),
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<ModalBase {...$$restProps}>
|
<ModalBase {...$$restProps}>
|
||||||
<svelte:fragment slot="header"
|
<svelte:fragment slot="header"
|
||||||
>{columnInfo ? 'Edit column' : `Add column ${(tableInfo?.columns || []).length + 1}`}</svelte:fragment
|
>{columnInfo ? 'Edit column' : `Add column ${(tableInfo?.columns || []).length + 1}`}</svelte:fragment
|
||||||
|
|||||||
Reference in New Issue
Block a user