-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
Closed
Description
Issue type:
[x] question
[x] bug report
[ ] feature request
[ ] documentation issue
Database system/driver:
[x] cordova
[ ] mongodb
[ ] mssql
[ ] mysql / mariadb
[ ] oracle
[ ] postgres
[ ] sqlite
[ ] sqljs
[ ] react-native
[ ] expo
TypeORM version:
[x] latest
[ ] @next
[ ] 0.x.x (or put your version here)
I have a tableA which has ON CASCADE DELETE foreign key contstraint on tableB.
Now I add a column to tableB during a migration, and all data of tableA is gone, as the migration drops and recreates tableB:
await queryRunner.addColumn("Project", new TableColumn({
name: "CustomVersion",
type: "varchar",
isNullable: true
}));
query: CREATE TABLE "temporary_Project" (...)
query: INSERT INTO "temporary_Project"...
query: DROP TABLE "Project"
Shouldn't the foreign key constraints be handled/disabled before dropping the table? Or am I doing it wrong?