Option to disable foreign keys creation
Problem
Issue type: [x] question [ ] bug report [x] feature request [ ] documentation issue Database system/driver: [ ] `cordova` [ ] `mongodb` [ ] `mssql` [x] `mysql` / `mariadb` [ ] `oracle` [ ] `postgres` [ ] `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: Is there a way to disable foreign keys creation? I searched a bit and couldn't find it. If not, is there a chance such option can be implemented? Maybe I can give it a try if you point me in the right direction. (:
Unverified for your environment
Select your OS to check compatibility.
1 Fix
Solution: Option to disable foreign keys creation
Our DBA told us to remove all foreign keys for performance reasons and to ease sharding, clustering and online migrations. It's actually the second company I work for where this was requested, but it's my first time using TypeORM, so I had to fork and get rid of the line that creates the foreign keys. I actually don't see the point of enforcing them. It seems to me like it's up to the application
Trust Score
6 verifications
- 1
Our DBA told us to remove all foreign keys for performance reasons and to ease s
Our DBA told us to remove all foreign keys for performance reasons and to ease sharding, clustering and online migrations. It's actually the second company I work for where this was requested, but it's my first time using TypeORM, so I had to fork and get rid of the line that creates the foreign keys.
- 2
I actually don't see the point of enforcing them. It seems to me like it's up to
I actually don't see the point of enforcing them. It seems to me like it's up to the application to maintain consistency its own way or to use foreign keys where appropriate if desired, right? (The option is there if anyone wants to use them.)
Validation
Resolved in typeorm/typeorm GitHub issue #3120. Community reactions: 18 upvotes.
Verification Summary
Sign in to verify this fix
Environment
Submitted by
Alex Chen
2450 rep