mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-19 20:06:00 +00:00
fk editor
This commit is contained in:
@@ -22,6 +22,17 @@
|
||||
testEnabled: () => getCurrentEditor()?.allowAddPrimaryKey(),
|
||||
onClick: () => getCurrentEditor().addPrimaryKey(),
|
||||
});
|
||||
|
||||
registerCommand({
|
||||
id: 'tableEditor.addForeignKey',
|
||||
category: 'Table editor',
|
||||
name: 'Add foreign key',
|
||||
icon: 'icon add-key',
|
||||
toolbar: true,
|
||||
isRelatedToTab: true,
|
||||
testEnabled: () => getCurrentEditor()?.writable(),
|
||||
onClick: () => getCurrentEditor().addForeignKey(),
|
||||
});
|
||||
</script>
|
||||
|
||||
<script lang="ts">
|
||||
@@ -76,6 +87,14 @@
|
||||
});
|
||||
}
|
||||
|
||||
export function addForeignKey() {
|
||||
showModal(ForeignKeyEditorModal, {
|
||||
setTableInfo,
|
||||
tableInfo,
|
||||
dbInfo,
|
||||
});
|
||||
}
|
||||
|
||||
$: columns = tableInfo?.columns;
|
||||
$: primaryKey = tableInfo?.primaryKey;
|
||||
$: foreignKeys = tableInfo?.foreignKeys;
|
||||
|
||||
Reference in New Issue
Block a user