SYNC: compare database in new object modal

This commit is contained in:
SPRINX0\prochazka
2025-07-16 12:34:56 +02:00
committed by Diflow
parent d6eb06cb72
commit d19851fc0c
3 changed files with 43 additions and 1 deletions

View File

@@ -682,6 +682,40 @@ registerCommand({
},
});
if (isProApp()) {
registerCommand({
id: 'database.compare',
category: 'Database',
name: 'Compare databases',
toolbar: true,
icon: 'icon compare',
testEnabled: () =>
getCurrentDatabase() != null &&
findEngineDriver(getCurrentDatabase()?.connection, getExtensions())?.databaseEngineTypes?.includes('sql'),
onClick: () => {
openNewTab(
{
title: 'Compare',
icon: 'img compare',
tabComponent: 'CompareModelTab',
props: {
conid: getCurrentDatabase()?.connection?._id,
database: getCurrentDatabase()?.name,
},
},
{
editor: {
sourceConid: getCurrentDatabase()?.connection?._id,
sourceDatabase: getCurrentDatabase()?.name,
targetConid: getCurrentDatabase()?.connection?._id,
targetDatabase: getCurrentDatabase()?.name,
},
}
);
},
});
}
if (hasPermission('settings/change')) {
registerCommand({
id: 'settings.commands',

View File

@@ -118,7 +118,7 @@
.window.simplefix {
margin: auto;
max-width: 600px;
max-width: 750px;
margin-top: 10vh;
}

View File

@@ -85,6 +85,14 @@
command: 'database.export',
testid: 'NewObjectModal_databaseExport',
},
{
icon: 'icon compare',
colorClass: 'color-icon-red',
title: 'Compare database',
description: 'Compare database schemas',
command: 'database.compare',
testid: 'NewObjectModal_databaseCompare',
},
];
</script>