diff --git a/packages/web/src/icons/FontIcon.svelte b/packages/web/src/icons/FontIcon.svelte
index 704ac4fa1..63a5ca200 100644
--- a/packages/web/src/icons/FontIcon.svelte
+++ b/packages/web/src/icons/FontIcon.svelte
@@ -71,6 +71,7 @@
'icon plugin': 'mdi mdi-toy-brick',
'icon menu': 'mdi mdi-menu',
'icon add-column': 'mdi mdi-table-column-plus-after',
+ 'icon add-key': 'mdi mdi-key-plus',
'img ok': 'mdi mdi-check-circle color-icon-green',
'img ok-inv': 'mdi mdi-check-circle color-icon-inv-green',
@@ -114,6 +115,7 @@
'img filter': 'mdi mdi-filter',
'img group': 'mdi mdi-group',
};
+
diff --git a/packages/web/src/tableeditor/TableEditor.svelte b/packages/web/src/tableeditor/TableEditor.svelte
index 643d6a0d5..97ab657bf 100644
--- a/packages/web/src/tableeditor/TableEditor.svelte
+++ b/packages/web/src/tableeditor/TableEditor.svelte
@@ -12,11 +12,23 @@
onClick: () => getCurrentEditor().addColumn(),
});
+ registerCommand({
+ id: 'tableEditor.addPrimaryKey',
+ category: 'Table editor',
+ name: 'Add primary key',
+ icon: 'icon add-key',
+ toolbar: true,
+ isRelatedToTab: true,
+ testEnabled: () => getCurrentEditor()?.allowAddPrimaryKey(),
+ onClick: () => getCurrentEditor().addPrimaryKey(),
+ });
+
@@ -114,7 +142,6 @@ import PrimaryKeyEditorModal from './PrimaryKeyEditorModal.svelte';
title="Primary key"
clickable={writable()}
on:clickrow={e => showModal(PrimaryKeyEditorModal, { constraintInfo: e.detail, tableInfo, setTableInfo })}
-
columns={[
{
fieldName: 'columns',