- Sort Score
- Result 10 results
- Languages All
Results 1 - 2 of 2 for ParseUniqueConstraints (0.19 sec)
-
schema/constraint.go
return "CONSTRAINT ? UNIQUE (?)", []interface{}{clause.Column{Name: uni.Name}, clause.Column{Name: uni.Field.DBName}} } // ParseUniqueConstraints parse schema unique constraints func (schema *Schema) ParseUniqueConstraints() map[string]UniqueConstraint { uniques := make(map[string]UniqueConstraint) for _, field := range schema.Fields { if field.Unique {
Registered: Sun Nov 03 09:35:10 UTC 2024 - Last Modified: Mon Mar 18 07:33:54 UTC 2024 - 1.9K bytes - Viewed (0) -
schema/constraint_test.go
} user, err := schema.Parse(&UserUnique{}, &sync.Map{}, schema.NamingStrategy{}) if err != nil { t.Fatalf("failed to parse user unique, got error %v", err) } constraints := user.ParseUniqueConstraints() results := map[string]schema.UniqueConstraint{ "uni_user_uniques_name1": { Name: "uni_user_uniques_name1", Field: &schema.Field{Name: "Name1", Unique: true}, }, }
Registered: Sun Nov 03 09:35:10 UTC 2024 - Last Modified: Sun Feb 04 07:49:19 UTC 2024 - 2.2K bytes - Viewed (0)