From 51956f409ec7ebea8b6790b0c5d4f0b51513d683 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Sun, 15 Sep 2013 12:46:09 +0200 Subject: Cleanup polymorphic base tables when dropping derived one --- odb/relational/pgsql/schema.cxx | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'odb/relational/pgsql') diff --git a/odb/relational/pgsql/schema.cxx b/odb/relational/pgsql/schema.cxx index f127b95..1cf57f1 100644 --- a/odb/relational/pgsql/schema.cxx +++ b/odb/relational/pgsql/schema.cxx @@ -29,7 +29,16 @@ namespace relational virtual void traverse (sema_rel::table& t, bool migration) { - // For PostgreSQL we use the CASCADE clause to drop foreign keys. + // For migration drop foreign keys explicitly in pre-migration. + // + if (migration) + { + base::traverse (t, migration); + return; + } + + // For schema creation we use the CASCADE clause to drop foreign + // keys. // if (pass_ != 2) return; -- cgit v1.1