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