hpqtypes-extras-1.16.3.1: Extra utilities for hpqtypes library
Safe HaskellSafe-Inferred
LanguageHaskell2010

Database.PostgreSQL.PQTypes.Model.ForeignKey

Synopsis

Documentation

fkOnColumns :: [RawSQL ()] -> RawSQL () -> [RawSQL ()] -> ForeignKey Source #

sqlAddValidFKMaybeDowntime :: RawSQL () -> ForeignKey -> RawSQL () Source #

Add valid foreign key. Warning: PostgreSQL acquires SHARE ROW EXCLUSIVE lock (that prevents data updates) on both modified and referenced table for the duration of the creation. If this is not acceptable, use sqlAddNotValidFK and sqlValidateFK.

sqlAddNotValidFK :: RawSQL () -> ForeignKey -> RawSQL () Source #

Add foreign key marked as NOT VALID. This avoids potentially long validation blocking updates to both modified and referenced table for its duration. However, keys created as such need to be validated later using sqlValidateFK.

sqlValidateFK :: RawSQL () -> ForeignKey -> RawSQL () Source #

Validate foreign key previously created as NOT VALID.