mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-18 23:06:00 +00:00
db alter plan improvements
This commit is contained in:
@@ -11,6 +11,7 @@ async function deployDb({
|
||||
modelTransforms,
|
||||
dbdiffOptionsExtra,
|
||||
ignoreNameRegex = '',
|
||||
targetSchema = null,
|
||||
}) {
|
||||
const { sql } = await generateDeploySql({
|
||||
connection,
|
||||
@@ -22,6 +23,7 @@ async function deployDb({
|
||||
modelTransforms,
|
||||
dbdiffOptionsExtra,
|
||||
ignoreNameRegex,
|
||||
targetSchema,
|
||||
});
|
||||
// console.log('RUNNING DEPLOY SCRIPT:', sql);
|
||||
await executeQuery({ connection, systemConnection, driver, sql, logScriptItems: true });
|
||||
|
||||
@@ -7,6 +7,8 @@ const {
|
||||
modelCompareDbDiffOptions,
|
||||
enrichWithPreloadedRows,
|
||||
skipNamesInStructureByRegex,
|
||||
replaceSchemaInStructure,
|
||||
filterStructureBySchema,
|
||||
} = require('dbgate-tools');
|
||||
const importDbModel = require('../utility/importDbModel');
|
||||
const requireEngineDriver = require('../utility/requireEngineDriver');
|
||||
@@ -22,6 +24,7 @@ async function generateDeploySql({
|
||||
modelTransforms = undefined,
|
||||
dbdiffOptionsExtra = {},
|
||||
ignoreNameRegex = '',
|
||||
targetSchema = null,
|
||||
}) {
|
||||
if (!driver) driver = requireEngineDriver(connection);
|
||||
|
||||
@@ -44,6 +47,11 @@ async function generateDeploySql({
|
||||
deployedModelSource = transform(deployedModelSource);
|
||||
}
|
||||
|
||||
if (targetSchema) {
|
||||
deployedModelSource = replaceSchemaInStructure(deployedModelSource, targetSchema);
|
||||
analysedStructure = filterStructureBySchema(analysedStructure, targetSchema);
|
||||
}
|
||||
|
||||
const deployedModel = generateDbPairingId(extendDatabaseInfo(deployedModelSource));
|
||||
const currentModel = generateDbPairingId(extendDatabaseInfo(analysedStructure));
|
||||
const opts = {
|
||||
|
||||
Reference in New Issue
Block a user