IHP Api Reference
Safe HaskellNone

IHP.IDE.SchemaDesigner.Controller.Columns

Synopsis

Documentation

updatePrimaryKeyConstraint :: Column -> Bool -> PrimaryKeyConstraint -> PrimaryKeyConstraint Source #

Add or remove a column from the primary key constraint

nameList :: HasField "name" model b => [model] -> [b] Source #

findIndicesReferencingColumn :: [Statement] -> (Text, Text) -> [Statement] Source #

Returns the list of CreateIndex statements that reference a specific column

E.g. given a schema like this: > CREATE TABLE users ( > email TEXT NOT NULL > ); > > CREATE UNIQUE INDEX users_email_index ON users (LOWER(email)); >

You can find all indices to the email column of the users table like this:

>>> findIndicesReferencingColumn database ("users", "email")
[CreateIndex { indexName = "users_email", unique = True, tableName = "users", expressions = [CallExpression "LOWER" [VarEpression "email"]] }]

Orphan instances