postgre, mysql uniques, recreate table WIP, drop index works

This commit is contained in:
Jan Prochazka
2021-09-04 18:43:59 +02:00
parent b3b7d021c5
commit 04a6540890
15 changed files with 113 additions and 27 deletions

View File

@@ -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'];
@@ -69,15 +69,15 @@ describe('Alter processor', () => {
test.each(engines.map(engine => [engine.label, engine]))(
'Add column - %s',
testWrapper(async (conn, driver, engine) => {
await testTableDiff(conn, driver, tbl =>
await testTableDiff(conn, driver, tbl => {
tbl.columns.push({
columnName: 'added',
dataType: 'int',
pairingId: uuidv1(),
notNull: false,
autoIncrement: false,
})
);
});
});
})
);
@@ -109,4 +109,13 @@ describe('Alter processor', () => {
);
})
);
test.each(engines.map(engine => [engine.label, engine]))(
'Drop index - %s',
testWrapper(async (conn, driver, engine) => {
await testTableDiff(conn, driver, tbl => {
tbl.indexes = [];
});
})
);
});