Skip to content

Commit

Permalink
add missing type checks
Browse files Browse the repository at this point in the history
  • Loading branch information
aaqilniz committed Jul 6, 2024
1 parent c86728f commit 53b9e5e
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion lib/migration.js
Original file line number Diff line number Diff line change
Expand Up @@ -629,7 +629,16 @@ function mixinMigration(MySQL, mysql) {
const idName = this.idName(model);
const idProp = this.getModelDefinition(model).properties[idName];
const idColumnType = this.columnDataType(model, idName);
if (idProp.generated && idColumnType === 'INT') {
if (
idProp.generated &&

Check failure on line 633 in lib/migration.js

View workflow job for this annotation

GitHub Actions / Code Lint

Trailing spaces not allowed

Check failure on line 633 in lib/migration.js

View workflow job for this annotation

GitHub Actions / build (18)

Trailing spaces not allowed

Check failure on line 633 in lib/migration.js

View workflow job for this annotation

GitHub Actions / build (20)

Trailing spaces not allowed
(
idColumnType === 'TINYINT' ||
idColumnType === 'SMALLINT' ||
idColumnType === 'MEDIUMINT' ||
idColumnType === 'INT' ||
idColumnType === 'BIGINT'
)
) {

Check failure on line 641 in lib/migration.js

View workflow job for this annotation

GitHub Actions / Code Lint

Expected indentation of 8 spaces but found 10

Check failure on line 641 in lib/migration.js

View workflow job for this annotation

GitHub Actions / build (18)

Expected indentation of 8 spaces but found 10

Check failure on line 641 in lib/migration.js

View workflow job for this annotation

GitHub Actions / build (20)

Expected indentation of 8 spaces but found 10
sql.push(self.columnEscaped(model, idName) + ' ' +
self.buildColumnDefinition(model, idName) + ' AUTO_INCREMENT PRIMARY KEY');
} else {
Expand Down

0 comments on commit 53b9e5e

Please sign in to comment.