| , "AND constraint_name=?" | ||
| ] | ||
| let ref = refName tableName' cname | ||
| let sql = T.concat ["SELECT DISTINCT " |
| case find (\f -> fk == foreignConstraintNameDBName f) fdefs of | ||
| Just _ -> c { cReference = Nothing } | ||
| Nothing -> c | ||
| Nothing -> c) xs,ys) |
| case ref of | ||
| Nothing -> Nothing | ||
| Just (s, _) -> Just $ AlterColumn table (s, AddReference (refName table cname) [cname] id_) | ||
| Just (s, constraintName) -> Just $ AlterColumn table (s, AddReference constraintName [cname] id_) |
| describe "custom constraint used in migration" $ do | ||
| it "alter table uses custom constraint name" $ runDb $ do | ||
| ms <- getMigration customConstraintMigrate | ||
| let alter = find (== alterQuery) ms |
| ## 2.10.5 | ||
|
|
||
| * Added support for the `constraint=` attribute to the Postgresql backend. [#979](https://github.com/yesodweb/persistent/pull/979) | ||
|
|
| @@ -1,5 +1,5 @@ | |||
| name: persistent | |||
| version: 2.10.4 | |||
| version: 2.10.5 | |||
| [] -> return Nothing | ||
| [[PersistText table, PersistText constraint]] -> | ||
| return $ Just (DBName table, DBName constraint) | ||
| _ -> error "Postgresql.getColumn: error fetching constraints" |
Closed