-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
Closed
GulajavaMinistudio/typeorm
#344Description
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
[x] 0.2.5
Steps to reproduce or a small repository showing the problem:
When using MySQL/MariaDB if you have an entity with a foreign key and it is created in two different schemas (i.e. a development schema and a staging schema) on the same server, the information loaded from the schema is non-deterministic, as it can come from either schema, due to a missing clause in the query used to load the data from MySQL's information schema.
A simple way to test this is:
- Create an entity with a
ManyToOnerelation to another entity - Generate the migration and synchronize to the database
- Change the schema for the entity
- Change the
ManyToOnerelationonUpdateand/oronDeletevalues - Generate the migration for the new schema
- Apply the migration
- Generate a new migration. Due to the wrong information loaded the
onUpdateoronDeletevalues might come from the wrong schema and generate an unnecessary foreign key recreation
Reactions are currently unavailable