Review Board 1.5.4

Schemifier's FK support fixed to properly discover existing constraints

Updated 1 year, 6 months ago

Derek Chen-Becker Reviewers
597 dchenbecker, dpp, marius, charles, heiko, joni, atsuhiko, jorge, naftoli, kris, indrajit, alexb, dlouwers, mstarzyk, rmellgren, jhoffman, probinett, jmadsen, mhartmann, jstrachan, jgoday
None LiftWeb-archive
Schemifier.ensureConstraints was using DatabaseMetaData.getExportedKeys to get FK constraints on the PK-referring table, when it's intended for use on the PK-owning table. This was causing the FK constraint to get recreated each time Schemifier ran. Changing to getImportedKeys still results in the proper FK constraint getting created, but on second and subsequent runs Schemifier properly locates the existing constraint and avoids re-creating it.
On my local Lift test app. Tested against H2, PostgreSQL, and Oracle XE 10.2.0.1. Interestingly, the MS SQL Server driver is set to not support FKs, obviating my need to test it. Still, I've opened ticket #607 to look into that because I'm fairly certain that SQL Server *does* support FK constraints.
Ship it!
Posted 1 year, 6 months ago (July 29th, 2010, 2:41 p.m.)
Coolio