MySQL ForeignKey unnecessarily gets baseTableCatalogName, referenceTableCatalogName
Description
Environment
Linux and MySQL
Activity
Show:
Nathan Voxland November 25, 2013 at 10:51 PM
There are includeSchema, includeCatalog, and includeTablespace parameters on the DiffOutputControl object that is passed into the diffChangeLog method.
From the command line, there is an includeSchema and includeCatalog parameter you can use

Former user November 22, 2013 at 4:39 PM
Understood. How do you control if the schema/catalog is included in the generated changelog?
Nathan Voxland November 20, 2013 at 9:19 PM
You can control whether the schema/catalog is included in the generated changelog, but if you have specified to include the schema/catalog in the output I think it should be outputting both the base and referenced names in case they do differ.
If we suppress the inclusion of them, they will cause problems when you are trying to recreate cross-schema foreign key constraints.
When running generateChangeLog on MySQL, LB will grab the baseTableCatalogName and the referenceTableCatalogName for addForeignKey, even if the tables exist in the same schema. This causes a problem when you attempt to deploy to a new schema. It could be disasterous if you deployed to a new schema on the same server, this would create cross schema foreign key relationship when the user does not want that.
These two values should not be captured if they are the same as the schema you are connected to. If and only if they're different, the user has a cross-schema foreign key and LB should capture it.