You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[X] latest
[ ] @next
[ ] 0.x.x (or put your version here)
Steps to reproduce or a small repository showing the problem:
When using the option default: null for an entity's column, and generating a migration using typeorm migration:generate, the generated migrations get into a loop. The generated migration is always the same, because 'null' default value is being normalized as null instead of NULL. When typeorm checks default value for the column it finds 'NULL' !== 'null'.
/** * Normalizes "default" value of the column. */normalizeDefault(columnMetadata: ColumnMetadata): string |undefined{constdefaultValue=columnMetadata.default;if(defaultValue===null){returnundefined
Issue type:
[ ] question
[X] bug report
[ ] feature request
[ ] documentation issue
Database system/driver:
[ ]
cordova
[ ]
mongodb
[ ]
mssql
[X]
mysql
/mariadb
[ ]
oracle
[ ]
postgres
[ ]
cockroachdb
[ ]
sqlite
[ ]
sqljs
[ ]
react-native
[ ]
expo
TypeORM version:
[X]
latest
[ ]
@next
[ ]
0.x.x
(or put your version here)Steps to reproduce or a small repository showing the problem:
When using the option default: null for an entity's column, and generating a migration using typeorm migration:generate, the generated migrations get into a loop. The generated migration is always the same, because 'null' default value is being normalized as null instead of NULL. When typeorm checks default value for the column it finds 'NULL' !== 'null'.
This bug is related to #3345
In order to reproduce with a simple User entity:
Obtained:
I think modifying MysqlDriver.ts line 593 to:
should fix the problem
The text was updated successfully, but these errors were encountered: