[odb-users] Error trying to create schema with polymorphic pragma
Boris Kolpackov
boris at codesynthesis.com
Wed Sep 26 14:16:05 EDT 2012
Hi Sean,
Stroud, Sean T <ststrou at sandia.gov> writes:
> I get the following runtime error trying to create schema via the
> schema_catalog:
>
> Error: 1005 (HY000): Can't create table 'TEST_DB.Sensor_Product' (errno: 150)
I tried your test and I get the same error. It appears we don't account
for the order of table creation when adding a foreign key constraint. So
this is a bug in ODB.
If you would like, I can build you a binary with the fix.
Alternatively, there is a fairly easy workaround. The idea is to assign
different names to product and sensor_product schemas and then create
them in the correct order:
odb ... --schema-name base product.h
odb ... --schema-name derived sensor_product.h
And then in main():
schema_catalog::create_schema (*db, "base");
schema_catalog::create_schema (*db, "derived");
Thanks for reporting this and providing the test case!
Boris
More information about the odb-users
mailing list