Ionic 4 mangles table names when using --prod
See original GitHub issueIssue type:
[ ] question [x] bug report [ ] feature request [ ] documentation issue
Database system/driver:
[x] cordova
[ ] mongodb
[ ] mssql
[ ] mysql
/ mariadb
[ ] oracle
[ ] postgres
[ ] sqlite
[ ] sqljs
[ ] react-native
TypeORM version:
[x] latest
[x] @next
[ ] 0.x.x
(or put your version here)
Steps to reproduce or a small repository showing the problem:
Can’t make Ionic work using the --prod flag.
Everything works perfectly when using ionic cordova run android
or ionic cordova run android --release
but as soon as we add the --prod
flag, things start to break.
My SQL queries show that all the Queries running look like FROM TABLE a
irrespective of what model is being used.
I have tried the workaround suggested in Ionic example: https://github.com/typeorm/ionic-example
- Using table name with Entity
@Entity('user')
- Getting the repository using the table name
getRepository('user')
Issue Analytics
- State:
- Created 5 years ago
- Reactions:3
- Comments:22 (9 by maintainers)
Top GitHub Comments
@pleerock Is there a solution/ a tool for checking that cyclic dependency with the
mangle
option? I still want to use the uglify ability.Also confirmed with ionic-example repository that I am able to reproduce the same problem. Observations which are common across both my app and ionic-example.
INSERT
s work when the table does not have any foreign key. In the Ionic-example, if I try to save Category and Author separately they work, but whenever I try to save Post it fails.I believe what is happening is in some queries tables get renamed to “a” and it fails since there’s a cyclic dependency between the Table we are creating data and the FK relation.