DropConstraint drop constraint
(value interface{}, name string)
| 776 | |
| 777 | // DropConstraint drop constraint |
| 778 | func (m Migrator) DropConstraint(value interface{}, name string) error { |
| 779 | return m.RunWithValue(value, func(stmt *gorm.Statement) error { |
| 780 | constraint, table := m.GuessConstraintInterfaceAndTable(stmt, name) |
| 781 | if constraint != nil { |
| 782 | name = constraint.GetName() |
| 783 | } |
| 784 | return m.DB.Exec("ALTER TABLE ? DROP CONSTRAINT ?", clause.Table{Name: table}, clause.Column{Name: name}).Error |
| 785 | }) |
| 786 | } |
| 787 | |
| 788 | // HasConstraint check has constraint or not |
| 789 | func (m Migrator) HasConstraint(value interface{}, name string) bool { |
nothing calls this directly
no test coverage detected