dialect/sql/schema: drop unique constraint on pg migration

Fixes #235
This commit is contained in:
Ariel Mashraki
2019-12-15 18:51:54 +02:00
parent dcb16c4ff6
commit 6bb834612c
24 changed files with 447 additions and 56 deletions

View File

@@ -258,6 +258,12 @@ func (t *TableAlter) AddForeignKey(fk *ForeignKeyBuilder) *TableAlter {
return t
}
// DropConstraint appends the `DROP CONSTRAINT` clause to the given `ALTER TABLE` statement.
func (t *TableAlter) DropConstraint(ident string) *TableAlter {
t.Queries = append(t.Queries, Raw(fmt.Sprintf("DROP CONSTRAINT %s", t.Quote(ident))))
return t
}
// Query returns query representation of the `ALTER TABLE` statement.
//
// ALTER TABLE name