mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-22 05:16:00 +00:00
deploy: ignoreNameRegex
This commit is contained in:
@@ -10,6 +10,7 @@ async function deployDb({
|
||||
loadedDbModel,
|
||||
modelTransforms,
|
||||
dbdiffOptionsExtra,
|
||||
ignoreNameRegex = '',
|
||||
}) {
|
||||
const { sql } = await generateDeploySql({
|
||||
connection,
|
||||
@@ -20,6 +21,7 @@ async function deployDb({
|
||||
loadedDbModel,
|
||||
modelTransforms,
|
||||
dbdiffOptionsExtra,
|
||||
ignoreNameRegex,
|
||||
});
|
||||
// console.log('RUNNING DEPLOY SCRIPT:', sql);
|
||||
await executeQuery({ connection, systemConnection, driver, sql, logScriptItems: true });
|
||||
|
||||
@@ -6,6 +6,7 @@ const {
|
||||
extendDatabaseInfo,
|
||||
modelCompareDbDiffOptions,
|
||||
enrichWithPreloadedRows,
|
||||
skipNamesInStructureByRegex,
|
||||
} = require('dbgate-tools');
|
||||
const importDbModel = require('../utility/importDbModel');
|
||||
const requireEngineDriver = require('../utility/requireEngineDriver');
|
||||
@@ -20,6 +21,7 @@ async function generateDeploySql({
|
||||
loadedDbModel = undefined,
|
||||
modelTransforms = undefined,
|
||||
dbdiffOptionsExtra = {},
|
||||
ignoreNameRegex = '',
|
||||
}) {
|
||||
if (!driver) driver = requireEngineDriver(connection);
|
||||
|
||||
@@ -30,6 +32,10 @@ async function generateDeploySql({
|
||||
analysedStructure = await driver.analyseFull(dbhan);
|
||||
}
|
||||
|
||||
if (ignoreNameRegex) {
|
||||
analysedStructure = skipNamesInStructureByRegex(analysedStructure, new RegExp(ignoreNameRegex, 'i'));
|
||||
}
|
||||
|
||||
let deployedModelSource = loadedDbModel
|
||||
? databaseInfoFromYamlModel(loadedDbModel)
|
||||
: await importDbModel(modelFolder);
|
||||
|
||||
Reference in New Issue
Block a user