Open feihan opened 5 years ago
Probably the same issue #2782
I think this has nothing to do with typeorm. Mysql doesn't allow to have a table name with an uppercase letter (at least in newer versions).
确实是,因为这个数据表有大写字母的原因。
"strictNullChecks": false,
remove this in tsconfig.js
I am still experiencing this issue. In order to get around this issue, I had to put the class to lower case. Even doing @Entity('user') and @Entity({name: 'user', schema: 'public'}) both failed.
This is a little disappointing, and I'm glad others have found solutions that work for them but I am unable to do so.
The real error is when we try to synchronize, typeorm tries to create the table instead of doing, create table if not exists. They just need to change their internal query. Because Sequelize and other ORMs do things the right way. If not for my team lead, I would have left typeorm a long time.
Same Issue - when creating a table name with capital letters typeorm with sync on it checks the schema with lower case and tries to create it with upper case.
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 i add
@Entity('TableName)
, it does create the table as "tablename" and if i turn on synchronize, it says "tablename" already exists - but doesnt synchronize it. This just works if i name it@Entity('tablename')
. But i'd like to name my tables in camelcase, and still use synchronize on it.In this case, there was some suggestion about allowing custom cases: https://github.com/typeorm/typeorm/issues/458
Thank you