@@ -545,6 +545,10 @@ type family Join xs ys where
545-- `Squeal.PostgreSQL.Definition.addColumn`.
545-- `Squeal.PostgreSQL.Definition.addColumn`.
546type family Create alias x xs where
546type family Create alias x xs where
547 Create alias x '[] = '[alias ::: x]
547 Create alias x '[] = '[alias ::: x]
548+ Create alias x (alias ::: y ': xs) = TypeError
549+ ('Text "Create: alias "
550+ ':<>: 'ShowType alias
551+ ':<>: 'Text "already in use")
548 Create alias y (x ': xs) = x ': Create alias y xs
552 Create alias y (x ': xs) = x ': Create alias y xs
550-- | @Drop alias xs@ removes the type associated with @alias@ in @xs@
554-- | @Drop alias xs@ removes the type associated with @alias@ in @xs@
@@ -631,4 +635,4 @@ type family With
631 :: SchemaType where
635 :: SchemaType where
632 With '[] schema = schema
636 With '[] schema = schema
633 With (alias ::: rel ': rels) schema =
637 With (alias ::: rel ': rels) schema =
634− alias ::: 'Table ('[] :=> RelationToColumns rel) ': With rels schema
638+ alias ::: 'View rel ': With rels schema