robbassi · GitHub

@robbassi

robbassi

, "AND constraint_name=?"
]
let ref = refName tableName' cname
let sql = T.concat ["SELECT DISTINCT "

@robbassi

parsonsmatt

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_)

@robbassi

@robbassi

robbassi

describe "custom constraint used in migration" $ do
it "alter table uses custom constraint name" $ runDb $ do
ms <- getMigration customConstraintMigrate
let alter = find (== alterQuery) ms

@robbassi

parsonsmatt

## 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

parsonsmatt

@robbassi

@robbassi

@parsonsmatt

@robbassi

robbassi deleted the postgres-custom-contraint-names branch

October 31, 2019 20:38

Merged

3 tasks

jkeuhlen

[] -> return Nothing
[[PersistText table, PersistText constraint]] ->
return $ Just (DBName table, DBName constraint)
_ -> error "Postgresql.getColumn: error fetching constraints"

Closed

Read the original on github.com ↗