Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 3 of 3 for uni (0.12 sec)

  1. schema/constraint.go

    	}
    	return checks
    }
    
    type UniqueConstraint struct {
    	Name  string
    	Field *Field
    }
    
    func (uni *UniqueConstraint) GetName() string { return uni.Name }
    
    func (uni *UniqueConstraint) Build() (sql string, vars []interface{}) {
    	return "CONSTRAINT ? UNIQUE (?)", []interface{}{clause.Column{Name: uni.Name}, clause.Column{Name: uni.Field.DBName}}
    }
    
    // ParseUniqueConstraints parse schema unique constraints
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Mon Mar 18 07:33:54 GMT 2024
    - 1.9K bytes
    - Viewed (0)
  2. migrator/migrator.go

    							createTableSQL += sql + ","
    							values = append(values, vars...)
    						}
    					}
    				}
    			}
    
    			for _, uni := range stmt.Schema.ParseUniqueConstraints() {
    				createTableSQL += "CONSTRAINT ? UNIQUE (?),"
    				values = append(values, clause.Column{Name: uni.Name}, clause.Expr{SQL: stmt.Quote(uni.Field.DBName)})
    			}
    
    			for _, chk := range stmt.Schema.ParseCheckConstraints() {
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Fri Apr 26 07:15:49 GMT 2024
    - 29K bytes
    - Viewed (0)
  3. tests/migrate_test.go

    	}
    
    	err = DB.AutoMigrate(&CurrentTimestampTest{})
    	if err != nil {
    		t.Fatalf("AutoMigrate err:%v", err)
    	}
    	AssertEqual(t, true, DB.Migrator().HasConstraint(&CurrentTimestampTest{}, "uni_current_timestamp_tests_time_at"))
    	AssertEqual(t, false, DB.Migrator().HasIndex(&CurrentTimestampTest{}, "time_at"))
    	AssertEqual(t, false, DB.Migrator().HasIndex(&CurrentTimestampTest{}, "time_at_2"))
    }
    
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Mon Mar 18 11:24:16 GMT 2024
    - 56.2K bytes
    - Viewed (0)
Back to top