Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 4 of 4 for GetName (0.29 sec)

  1. migrator/migrator.go

    	return m.RunWithValue(value, func(stmt *gorm.Statement) error {
    		constraint, table := m.GuessConstraintInterfaceAndTable(stmt, name)
    		if constraint != nil {
    			name = constraint.GetName()
    		}
    		return m.DB.Exec("ALTER TABLE ? DROP CONSTRAINT ?", clause.Table{Name: table}, clause.Column{Name: name}).Error
    	})
    }
    
    // HasConstraint check has constraint or not
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Fri Apr 26 07:15:49 GMT 2024
    - 29K bytes
    - Viewed (0)
  2. schema/interfaces.go

    package schema
    
    import (
    	"gorm.io/gorm/clause"
    )
    
    // ConstraintInterface database constraint interface
    type ConstraintInterface interface {
    	GetName() string
    	Build() (sql string, vars []interface{})
    }
    
    // GormDataTypeInterface gorm data type interface
    type GormDataTypeInterface interface {
    	GormDataType() string
    }
    
    // FieldNewValuePool field new scan value pool
    type FieldNewValuePool interface {
    	Get() interface{}
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Sun Feb 04 07:49:19 GMT 2024
    - 980 bytes
    - Viewed (0)
  3. schema/relationship.go

    	Schema          *Schema
    	ForeignKeys     []*Field
    	ReferenceSchema *Schema
    	References      []*Field
    	OnDelete        string
    	OnUpdate        string
    }
    
    func (constraint *Constraint) GetName() string { return constraint.Name }
    
    func (constraint *Constraint) Build() (sql string, vars []interface{}) {
    	sql = "CONSTRAINT ? FOREIGN KEY ? REFERENCES ??"
    	if constraint.OnDelete != "" {
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Mon Apr 15 03:20:20 GMT 2024
    - 22.4K bytes
    - Viewed (0)
  4. schema/constraint.go

    var regEnLetterAndMidline = regexp.MustCompile(`^[\w-]+$`)
    
    type CheckConstraint struct {
    	Name       string
    	Constraint string // length(phone) >= 10
    	*Field
    }
    
    func (chk *CheckConstraint) GetName() string { return chk.Name }
    
    func (chk *CheckConstraint) Build() (sql string, vars []interface{}) {
    	return "CONSTRAINT ? CHECK (?)", []interface{}{clause.Column{Name: chk.Name}, clause.Expr{SQL: chk.Constraint}}
    }
    
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Mon Mar 18 07:33:54 GMT 2024
    - 1.9K bytes
    - Viewed (0)
Back to top