mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-29 23:53:57 +00:00
oracle fixes
This commit is contained in:
@@ -69,6 +69,22 @@ function checkStructure(
|
||||
}
|
||||
}
|
||||
|
||||
// function convertObjectText(text, driver) {
|
||||
// if (!text) return undefined;
|
||||
// text = formatQueryWithoutParams(driver, text);
|
||||
// if (driver.dialect.requireFromDual && text.startsWith('create view ') && !text.includes('from')) {
|
||||
// text = text + ' from dual';
|
||||
// }
|
||||
// return text;
|
||||
// }
|
||||
|
||||
// function convertModelToEngine(model, driver) {
|
||||
// return model.map(x => ({
|
||||
// ...x,
|
||||
// text: convertObjectText(x.text, driver),
|
||||
// }));
|
||||
// }
|
||||
|
||||
function convertModelToEngine(model, driver) {
|
||||
return model.map(x => ({
|
||||
...x,
|
||||
@@ -542,7 +558,7 @@ describe('Deploy database', () => {
|
||||
|
||||
const V1_VARIANT2 = {
|
||||
name: 'v1.view.sql',
|
||||
text: 'create view ~v1 as select 1 as c1',
|
||||
text: 'create view ~v1 as select ~id + ~id from ~t1',
|
||||
};
|
||||
|
||||
const V1_DELETED = {
|
||||
@@ -694,7 +710,7 @@ describe('Deploy database', () => {
|
||||
[
|
||||
{
|
||||
name: '1.predeploy.sql',
|
||||
text: 'create table ~t1 (~id int primary key); insert into ~t1 (id) values (1);',
|
||||
text: 'create table ~t1 (~id int primary key); insert into ~t1 (~id) values (1);',
|
||||
},
|
||||
],
|
||||
]);
|
||||
|
||||
@@ -76,7 +76,7 @@ describe('Schema tests', () => {
|
||||
});
|
||||
|
||||
describe('Base analyser test', () => {
|
||||
test.each(engines.map(engine => [engine.label, engine]))(
|
||||
test.each(engines.filter(x => !x.skipIncrementalAnalysis).map(engine => [engine.label, engine]))(
|
||||
'Structure without change - %s',
|
||||
testWrapper(async (conn, driver, engine) => {
|
||||
await baseStructure(conn, driver);
|
||||
|
||||
@@ -417,6 +417,7 @@ end;$$`,
|
||||
skipOnCI: false,
|
||||
dbSnapshotBySeconds: true,
|
||||
setNullDefaultInsteadOfDrop: true,
|
||||
skipIncrementalAnalysis: true,
|
||||
},
|
||||
];
|
||||
|
||||
|
||||
@@ -140,6 +140,9 @@ class DuplicatorItemHolder {
|
||||
weakref.foreignKey.columns[0].columnName
|
||||
);
|
||||
});
|
||||
if (this.duplicator.driver.dialect.requireFromDual) {
|
||||
dmp.put(' ^from ^dual');
|
||||
}
|
||||
});
|
||||
const qrow = qres.rows[0];
|
||||
return this.weakReferences.filter(x => qrow[x.columnName] == 0).map(x => x.columnName);
|
||||
|
||||
Reference in New Issue
Block a user