Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 1 of 1 for unique_name (0.17 sec)

  1. migrator/migrator.go

    	return m.RunWithValue(value, func(stmt *gorm.Statement) error {
    		// We're currently only receiving boolean values on `Unique` tag,
    		// so the UniqueConstraint name is fixed
    		constraint := m.DB.NamingStrategy.UniqueName(stmt.Table, field.DBName)
    		if unique && !field.Unique {
    			return m.DB.Migrator().DropConstraint(value, constraint)
    		}
    		if !unique && field.Unique {
    			return m.DB.Migrator().CreateConstraint(value, constraint)
    Go
    - Registered: Sun Apr 21 09:35:09 GMT 2024
    - Last Modified: Mon Mar 18 11:24:16 GMT 2024
    - 28.5K bytes
    - Viewed (0)
Back to top