mirror of
https://github.com/ent/ent.git
synced 2026-05-06 01:20:56 +03:00
dialect/sql: add drop-fk command to builder
This commit is contained in:
@@ -264,6 +264,12 @@ func (t *TableAlter) DropConstraint(ident string) *TableAlter {
|
||||
return t
|
||||
}
|
||||
|
||||
// DropForeignKey appends the `DROP FOREIGN KEY` clause to the given `ALTER TABLE` statement.
|
||||
func (t *TableAlter) DropForeignKey(ident string) *TableAlter {
|
||||
t.Queries = append(t.Queries, Raw(fmt.Sprintf("DROP FOREIGN KEY %s", t.Quote(ident))))
|
||||
return t
|
||||
}
|
||||
|
||||
// Query returns query representation of the `ALTER TABLE` statement.
|
||||
//
|
||||
// ALTER TABLE name
|
||||
|
||||
Reference in New Issue
Block a user