From f9a562808d1eff8862f3586db8d71109eb1bd76e Mon Sep 17 00:00:00 2001 From: Jan Prochazka Date: Thu, 31 Oct 2024 17:01:02 +0100 Subject: [PATCH] alter view test --- .../__tests__/deploy-database.spec.js | 44 +++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/integration-tests/__tests__/deploy-database.spec.js b/integration-tests/__tests__/deploy-database.spec.js index 67294306..06d6269e 100644 --- a/integration-tests/__tests__/deploy-database.spec.js +++ b/integration-tests/__tests__/deploy-database.spec.js @@ -465,6 +465,11 @@ describe('Deploy database', () => { text: 'create view v1 as select * from t1', }; + const V1_VARIANT2 = { + name: 'v1.view.sql', + text: 'create view v1 as select 1 as c1', + }; + const V1_DELETED = { name: '_deleted_v1.view.sql', text: 'create view _deleted_v1 as select * from t1', @@ -565,4 +570,43 @@ describe('Deploy database', () => { }); }) ); + + test.each(engines.map(engine => [engine.label, engine]))( + 'View redeploy - %s', + testWrapper(async (conn, driver, engine) => { + await testDatabaseDeploy( + engine, + conn, + driver, + [ + [T1, V1], + [T1, V1], + [T1, V1], + ], + { + markDeleted: true, + disallowExtraObjects: true, + } + ); + }) + ); + + test.each(engines.map(engine => [engine.label, engine]))( + 'Change view - %s', + testWrapper(async (conn, driver, engine) => { + await testDatabaseDeploy( + engine, + conn, + driver, + [ + [T1, V1], + [T1, V1_VARIANT2], + ], + { + markDeleted: true, + disallowExtraObjects: true, + } + ); + }) + ); });