mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-17 23:45:59 +00:00
deploy db WIP
This commit is contained in:
@@ -5,6 +5,7 @@ const _ = require('lodash');
|
||||
const engines = require('../engines');
|
||||
const deployDb = require('dbgate-api/src/shell/deployDb');
|
||||
const { databaseInfoFromYamlModel } = require('dbgate-tools');
|
||||
const generateDeploySql = require('dbgate-api/src/shell/generateDeploySql');
|
||||
|
||||
function checkStructure(structure, model) {
|
||||
const expected = databaseInfoFromYamlModel(model);
|
||||
@@ -17,6 +18,13 @@ function checkStructure(structure, model) {
|
||||
|
||||
async function testDatabaseDeploy(conn, driver, dbModelsYaml) {
|
||||
for (const loadedDbModel of dbModelsYaml) {
|
||||
const sql = await generateDeploySql({
|
||||
systemConnection: conn,
|
||||
driver,
|
||||
loadedDbModel,
|
||||
});
|
||||
expect(sql.toUpperCase().includes('DROP ')).toBeFalsy();
|
||||
|
||||
await deployDb({
|
||||
systemConnection: conn,
|
||||
driver,
|
||||
|
||||
@@ -116,11 +116,11 @@ const engines = [
|
||||
|
||||
const filterLocal = [
|
||||
// filter local testing
|
||||
'MySQL',
|
||||
'PostgreSQL',
|
||||
'SQL Server',
|
||||
'-MySQL',
|
||||
'-PostgreSQL',
|
||||
'-SQL Server',
|
||||
'SQLite',
|
||||
'CockroachDB',
|
||||
'-CockroachDB',
|
||||
];
|
||||
|
||||
module.exports = process.env.CITEST
|
||||
|
||||
Reference in New Issue
Block a user