alter table WIP

This commit is contained in:
Jan Prochazka
2021-09-16 09:31:10 +02:00
parent ce85f8f94d
commit 185699cb51
8 changed files with 48 additions and 15 deletions

View File

@@ -538,11 +538,14 @@ export class SqlDumper implements AlterProcessor {
}
recreateTable(oldTable: TableInfo, newTable: TableInfo) {
if (oldTable.pairingId != newTable.pairingId) {
if (!oldTable.pairingId || !newTable.pairingId || oldTable.pairingId != newTable.pairingId) {
throw new Error('Recreate is not possible: oldTable.paringId != newTable.paringId');
}
const tmpTable = `temp_${uuidv1()}`;
// console.log('oldTable', oldTable);
// console.log('newTable', newTable);
const columnPairs = oldTable.columns
.map(oldcol => ({
oldcol,