mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-18 00:56:02 +00:00
feat: add schedulerEvents to tools
This commit is contained in:
@@ -708,6 +708,8 @@ export class SqlDumper implements AlterProcessor {
|
||||
return 'TRIGGER';
|
||||
case 'matviews':
|
||||
return 'MATERIALIZED VIEW';
|
||||
case 'schedulerEvents':
|
||||
return 'EVENT';
|
||||
}
|
||||
}
|
||||
|
||||
@@ -785,10 +787,7 @@ export class SqlDumper implements AlterProcessor {
|
||||
}
|
||||
|
||||
callableTemplate(func: CallableObjectInfo) {
|
||||
this.put(
|
||||
'^call %f(&>&n',
|
||||
func,
|
||||
);
|
||||
this.put('^call %f(&>&n', func);
|
||||
|
||||
this.putCollection(',&n', func.parameters || [], param => {
|
||||
this.putRaw(param.parameterMode == 'IN' ? ':' + param.parameterName : param.parameterName);
|
||||
|
||||
@@ -155,6 +155,7 @@ export function generateDbPairingId(db: DatabaseInfo): DatabaseInfo {
|
||||
procedures: db.procedures?.map(generateObjectPairingId),
|
||||
functions: db.functions?.map(generateObjectPairingId),
|
||||
triggers: db.triggers?.map(generateObjectPairingId),
|
||||
schedulerEvents: db.schedulerEvents?.map(generateObjectPairingId),
|
||||
matviews: db.matviews?.map(generateObjectPairingId),
|
||||
};
|
||||
}
|
||||
@@ -715,7 +716,15 @@ export function createAlterDatabasePlan(
|
||||
): AlterPlan {
|
||||
const plan = new AlterPlan(wholeOldDb, wholeNewDb, driver.dialect, opts);
|
||||
|
||||
for (const objectTypeField of ['tables', 'views', 'procedures', 'matviews', 'functions', 'triggers']) {
|
||||
for (const objectTypeField of [
|
||||
'tables',
|
||||
'views',
|
||||
'procedures',
|
||||
'matviews',
|
||||
'functions',
|
||||
'triggers',
|
||||
'schedulerEvents',
|
||||
]) {
|
||||
for (const oldobj of oldDb[objectTypeField] || []) {
|
||||
const newobj = (newDb[objectTypeField] || []).find(x => x.pairingId == oldobj.pairingId);
|
||||
if (objectTypeField == 'tables') {
|
||||
|
||||
Reference in New Issue
Block a user