@@ -16,7 +16,6 @@ import qualified Data.Set as S
1616import qualified Data.List as L
1717import qualified Data.Text as T
1818import Data.Monoid
19−--import Debug.Trace
2019-- isomorphic schemas offer bi-directional functors between two schemas
2120
2221--TODO: note that renaming a relvar should alter any stored isomorphisms as well
@@ -304,11 +303,11 @@ validate morph underlyingRvNames = if S.size invalidRvNames > 0 then
304303
305304-- | Create inclusion dependencies mainly for IsoRestrict because the predicate should hold in the base schema.
306305createIncDepsForIsomorph :: SchemaName -> SchemaIsomorph -> InclusionDependencies
307−createIncDepsForIsomorph sname (IsoRestrict _ predi (rvTrue, rvFalse)) = let
306+createIncDepsForIsomorph sname (IsoRestrict origRv predi (rvTrue, rvFalse)) = let
308307 newIncDep predicate rv = InclusionDependency (Project AN.empty (Restrict predicate (RelationVariable rv ()))) (ExistingRelation relationTrue)
309− incDepName b = "schema" <> "_" <> sname <> "_" <> T.pack (show b) in
310− M.fromList [(incDepName True, newIncDep predi rvTrue),
311− (incDepName False, newIncDep (NotPredicate predi) rvFalse)]
308+ incDepName b = "schema" <> "_" <> sname <> "_" <> b in
309+ M.fromList [(incDepName (origRv <> "_true"), newIncDep predi rvTrue),
310+ (incDepName (origRv <> "_false"), newIncDep (NotPredicate predi) rvFalse)]
312311createIncDepsForIsomorph _ _ = M.empty
313312
314313-- in the case of IsoRestrict, the database context should be updated with the restriction so that if the restriction does not hold, then the schema cannot be created