Here's an interesting you can try with the H2 database web console. Launch into your web console and login to your database. Click on the "INFORMATION_SCHEMA" tree and click the tables in that tree to navigate your tables' metadata and information.
Clicking around the "INFORMATION_SCHEMA" tree would also generate SQL statements for you to use. If you are looking for "REFERENTIAL" type constraints which effective means foreign key constraints, you can click on the "CONSTRAINTS" node inside the "INFORMATION_SCHEMA" tree. Essentially the automated web console would generate the following statement " SELECT * FROM INFORMATION_SCHEMA.CONSTRAINTS WHERE CONSTRAINT_TYPE = 'REFERENTIAL' " if you are looking for foreign key indexes. Please try your hands on the wonderful web console which Thomas Mueller have made. It is simply amazing how a tiny jar file database engine could package in by default a beautiful and amazingly powerful web console which makes life so much easier for users. H2 database is truely an impressive work. On Saturday, June 23, 2012 5:07:13 AM UTC+8, toolforger wrote: > > Hi all, > > what's the best practice to test the existence of a > - table > - field in a table > - foreign key constraint? > > Use case: Incremental database schema evolution. > I.e. rows in old and new format are in existence at the same time. > Which means columns from old and new format coexist; old-format columns > will get dropped once the last old-format row is gone. > (Yeah, I like doing crazy stuff :-D ) > -- You received this message because you are subscribed to the Google Groups "H2 Database" group. To view this discussion on the web visit https://groups.google.com/d/msg/h2-database/-/Mzg_oBA1TnYJ. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/h2-database?hl=en.
