mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-20 20:35:59 +00:00
feat: add sql generator to triggers and evets context menu
This commit is contained in:
@@ -351,14 +351,31 @@
|
||||
case 'triggers':
|
||||
return [
|
||||
...defaultDatabaseObjectAppObjectActions['triggers'],
|
||||
{
|
||||
divider: true,
|
||||
},
|
||||
hasPermission('dbops/model/edit') && {
|
||||
label: 'Drop trigger',
|
||||
isDrop: true,
|
||||
requiresWriteAccess: true,
|
||||
},
|
||||
{
|
||||
divider: true,
|
||||
},
|
||||
{
|
||||
label: 'SQL generator',
|
||||
submenu: [
|
||||
{
|
||||
label: 'CREATE TRIGGER',
|
||||
sqlGeneratorProps: {
|
||||
createTriggers: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
label: 'DROP TRIGGER',
|
||||
sqlGeneratorProps: {
|
||||
dropTriggers: true,
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
];
|
||||
case 'collections':
|
||||
return [
|
||||
@@ -400,17 +417,11 @@
|
||||
case 'schedulerEvents':
|
||||
const menu: DbObjMenuItem[] = [
|
||||
...defaultDatabaseObjectAppObjectActions['schedulerEvents'],
|
||||
{
|
||||
divider: true,
|
||||
},
|
||||
hasPermission('dbops/model/edit') && {
|
||||
label: 'Drop event',
|
||||
isDrop: true,
|
||||
requiresWriteAccess: true,
|
||||
},
|
||||
{
|
||||
divider: true,
|
||||
},
|
||||
];
|
||||
|
||||
if (data?.status === 'ENABLED') {
|
||||
@@ -425,6 +436,29 @@
|
||||
});
|
||||
}
|
||||
|
||||
menu.push(
|
||||
{
|
||||
divider: true,
|
||||
},
|
||||
{
|
||||
label: 'SQL generator',
|
||||
submenu: [
|
||||
{
|
||||
label: 'CREATE SCHEDULER EVENT',
|
||||
sqlGeneratorProps: {
|
||||
createSchedulerEvents: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
label: 'DROP SCHEDULER EVENT',
|
||||
sqlGeneratorProps: {
|
||||
dropSchedulerEvents: true,
|
||||
},
|
||||
},
|
||||
],
|
||||
}
|
||||
);
|
||||
|
||||
return menu;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user