- Sort Score
- Result 10 results
- Languages All
Results 1 - 3 of 3 for DropConstraint (0.16 sec)
-
migrator.go
// Views CreateView(name string, option ViewOption) error DropView(name string) error // Constraints CreateConstraint(dst interface{}, name string) error DropConstraint(dst interface{}, name string) error HasConstraint(dst interface{}, name string) bool // Indexes CreateIndex(dst interface{}, name string) error DropIndex(dst interface{}, name string) error
Registered: Sun Sep 07 09:35:13 UTC 2025 - Last Modified: Mon Oct 30 09:15:49 UTC 2023 - 3.1K bytes - Viewed (0) -
migrator/migrator.go
} sql, values := constraint.Build() return m.DB.Exec("ALTER TABLE ? ADD "+sql, append(vars, values...)...).Error } return nil }) } // DropConstraint drop constraint func (m Migrator) DropConstraint(value interface{}, name string) error { return m.RunWithValue(value, func(stmt *gorm.Statement) error { constraint, table := m.GuessConstraintInterfaceAndTable(stmt, name) if constraint != nil {
Registered: Sun Sep 07 09:35:13 UTC 2025 - Last Modified: Fri Jun 06 02:35:01 UTC 2025 - 29.5K bytes - Viewed (0) -
tests/migrate_test.go
for _, name := range names { if !DB.Migrator().HasConstraint(&User{}, name) { DB.Migrator().CreateConstraint(&User{}, name) } if err := DB.Migrator().DropConstraint(&User{}, name); err != nil { t.Fatalf("failed to drop constraint %v, got error %v", name, err) } if DB.Migrator().HasConstraint(&User{}, name) { t.Fatalf("constraint %v should been deleted", name) }
Registered: Sun Sep 07 09:35:13 UTC 2025 - Last Modified: Wed Aug 20 04:51:17 UTC 2025 - 65.2K bytes - Viewed (0)