alter processor fixes

This commit is contained in:
Jan Prochazka
2021-09-04 21:06:42 +02:00
parent 04a6540890
commit e2ce349a30
7 changed files with 63 additions and 8 deletions

View File

@@ -47,7 +47,7 @@ async function testTableDiff(conn, driver, mangle) {
const sql = getAlterTableScript(tget(structure1), tget(structure2), {}, structure2, driver);
console.log('RUNNING ALTER SQL', driver.engine, ':', sql);
await driver.query(conn, sql);
await driver.script(conn, sql);
const structure2Real = extendDatabaseInfo(await driver.analyseFull(conn));
@@ -56,8 +56,8 @@ async function testTableDiff(conn, driver, mangle) {
}
// const TESTED_COLUMNS = ['col_pk', 'col_std', 'col_def', 'col_fk', 'col_ref', 'col_idx', 'col_uq'];
// const TESTED_COLUMNS = ['col_pk'];
const TESTED_COLUMNS = ['col_idx'];
const TESTED_COLUMNS = ['col_pk'];
// const TESTED_COLUMNS = ['col_idx'];
// const TESTED_COLUMNS = ['col_fk'];
// const TESTED_COLUMNS = ['col_std'];

View File

@@ -16,6 +16,7 @@ const matviews = {
const engines = [
{
label: 'MySQL',
skipLocal: true,
connection: {
engine: 'mysql@dbgate-plugin-mysql',
password: 'Pwd2020Db',
@@ -33,6 +34,7 @@ const engines = [
},
{
label: 'PostgreSQL',
skipLocal: true,
connection: {
engine: 'postgres@dbgate-plugin-postgres',
password: 'Pwd2020Db',
@@ -56,8 +58,10 @@ const engines = [
},
{
type: 'functions',
create1: 'CREATE FUNCTION obj1() returns int LANGUAGE plpgsql AS $$ declare res integer; begin select count(*) into res from t1; return res; end; $$',
create2: 'CREATE FUNCTION obj2() returns int LANGUAGE plpgsql AS $$ declare res integer; begin select count(*) into res from t2; return res; end; $$',
create1:
'CREATE FUNCTION obj1() returns int LANGUAGE plpgsql AS $$ declare res integer; begin select count(*) into res from t1; return res; end; $$',
create2:
'CREATE FUNCTION obj2() returns int LANGUAGE plpgsql AS $$ declare res integer; begin select count(*) into res from t2; return res; end; $$',
drop1: 'DROP FUNCTION obj1',
drop2: 'DROP FUNCTION obj2',
},
@@ -65,6 +69,7 @@ const engines = [
},
{
label: 'SQL Server',
skipLocal: true,
connection: {
engine: 'mssql@dbgate-plugin-mssql',
password: 'Pwd2020Db',
@@ -89,6 +94,7 @@ const engines = [
},
{
label: 'SQLite',
skipLocal: true,
generateDbFile: true,
connection: {
engine: 'sqlite@dbgate-plugin-sqlite',
@@ -97,6 +103,7 @@ const engines = [
},
{
label: 'CockroachDB',
// skipLocal: true,
connection: {
engine: 'cockroach@dbgate-plugin-postgres',
user: 'root',
@@ -112,4 +119,4 @@ const engines = [
},
];
module.exports = process.env.CITEST ? engines.filter(x => !x.skipOnCI) : engines;
module.exports = process.env.CITEST ? engines.filter(x => !x.skipOnCI) : engines.filter(x => !x.skipLocal);

View File

@@ -17,6 +17,9 @@
"run:local": "docker-compose down && docker-compose up -d && yarn wait:local && yarn test:local"
},
"jest": {
"testTimeout": 5000
},
"devDependencies": {
"cross-env": "^7.0.3",
"jest": "^27.0.1"