Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

No DEFERRABLE Constraint option #209

Open
Labels
enhancementNew feature or request
@anonymouz4

Description

Currently it isn't possible to declare a constraint, while making it DEFERRABLE or set a initial deferred state.

Workaround 1:

guard let db = database as? PostgresDatabase else {
	throw Abort(.internalServerError)
}
try db.simpleQuery("ALTER TABLE waitlist ADD CONSTRAINT no_duplicate_ranks UNIQUE(waitlist_rank) DEFERRABLE;").wait()

Workaround 2:

// In create migration
.constraint(.custom("CONSTRAINT \"no_duplicate_ranks\" UNIQUE(waitlist_rank) DEFERRABLE"))

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

        AltStyle によって変換されたページ (->オリジナル) /