Skip to content

Commit

Permalink
fix: remove useless block on dropColumn
Browse files Browse the repository at this point in the history
  • Loading branch information
mateusppereira committed Jun 14, 2021
1 parent 29071ef commit 816582d
Showing 1 changed file with 0 additions and 12 deletions.
12 changes: 0 additions & 12 deletions src/driver/sqlite-abstract/AbstractSqliteQueryRunner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -473,18 +473,6 @@ export abstract class AbstractSqliteQueryRunner extends BaseQueryRunner implemen
});

await this.recreateTable(changedTable, table);

// remove column and its constraints from original table.
columns.forEach((column: TableColumn|string) => {
const columnInstance = column instanceof TableColumn ? column : table.findColumnByName(column);
if (!columnInstance)
throw new Error(`Column "${column}" was not found in table "${table.name}"`);

table.removeColumn(columnInstance);
table.findColumnUniques(columnInstance).forEach(unique => table.removeUniqueConstraint(unique));
table.findColumnIndices(columnInstance).forEach(index => table.removeIndex(index));
table.findColumnForeignKeys(columnInstance).forEach(fk => table.removeForeignKey(fk));
});
}

/**
Expand Down

0 comments on commit 816582d

Please sign in to comment.