diff --git a/integration-tests/__tests__/deploy-database.spec.js b/integration-tests/__tests__/deploy-database.spec.js index 17fc93e32..4ae3cc171 100644 --- a/integration-tests/__tests__/deploy-database.spec.js +++ b/integration-tests/__tests__/deploy-database.spec.js @@ -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);', }, ], ]); diff --git a/integration-tests/__tests__/schema-tests.spec.js b/integration-tests/__tests__/schema-tests.spec.js index 116b15b17..d31fcb13b 100644 --- a/integration-tests/__tests__/schema-tests.spec.js +++ b/integration-tests/__tests__/schema-tests.spec.js @@ -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); diff --git a/integration-tests/engines.js b/integration-tests/engines.js index cb539964e..74e2f7591 100644 --- a/integration-tests/engines.js +++ b/integration-tests/engines.js @@ -417,6 +417,7 @@ end;$$`, skipOnCI: false, dbSnapshotBySeconds: true, setNullDefaultInsteadOfDrop: true, + skipIncrementalAnalysis: true, }, ]; diff --git a/packages/datalib/src/DataDuplicator.ts b/packages/datalib/src/DataDuplicator.ts index a0b5b1dba..55c56984e 100644 --- a/packages/datalib/src/DataDuplicator.ts +++ b/packages/datalib/src/DataDuplicator.ts @@ -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);