You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
log.Infof("Found foreign key on %s.%s related to %s.%s", sql.EscapeName(fkSchema), sql.EscapeName(fkTable), sql.EscapeName(this.migrationContext.DatabaseName), sql.EscapeName(this.migrationContext.OriginalTableName))
log.Debugf("Validated no foreign keys exist on table")
380
-
returnnil
383
+
ifnumParentForeignKeys>0 {
384
+
returnlog.Errorf("Found %d parent-side foreign keys on %s.%s. Parent-side foreign keys are not supported. Bailing out", numParentForeignKeys, sql.EscapeName(this.migrationContext.DatabaseName), sql.EscapeName(this.migrationContext.OriginalTableName))
381
385
}
382
-
ifthis.migrationContext.DiscardForeignKeys {
383
-
log.Debugf("Foreign keys found and will be dropped, as per given --discard-foreign-keys flag")
384
-
returnnil
386
+
ifnumChildForeignKeys>0 {
387
+
ifallowChildForeignKeys {
388
+
log.Debugf("Foreign keys found and will be dropped, as per given --discard-foreign-keys flag")
389
+
returnnil
390
+
}
391
+
returnlog.Errorf("Found %d child-side foreign keys on %s.%s. Child-side foreign keys are not supported. Bailing out", numChildForeignKeys, sql.EscapeName(this.migrationContext.DatabaseName), sql.EscapeName(this.migrationContext.OriginalTableName))
385
392
}
386
-
returnlog.Errorf("Found %d foreign keys related to %s.%s. Foreign keys are not supported. Bailing out", numForeignKeys, sql.EscapeName(this.migrationContext.DatabaseName), sql.EscapeName(this.migrationContext.OriginalTableName))
393
+
log.Debugf("Validated no foreign keys exist on table")
394
+
returnnil
387
395
}
388
396
389
397
// validateTableTriggers makes sure no triggers exist on the migrated table
0 commit comments