Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 3 of 3 for DropView (0.28 sec)

  1. migrator.go

    	HasColumn(dst interface{}, field string) bool
    	RenameColumn(dst interface{}, oldName, field string) error
    	ColumnTypes(dst interface{}) ([]ColumnType, error)
    
    	// 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
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Mon Oct 30 09:15:49 GMT 2023
    - 3.1K bytes
    - Viewed (0)
  2. migrator/migrator.go

    	if option.CheckOption != "" {
    		sql.WriteString(" ")
    		sql.WriteString(option.CheckOption)
    	}
    	return m.DB.Exec(m.Explain(sql.String(), m.DB.Statement.Vars...)).Error
    }
    
    // DropView drop view
    func (m Migrator) DropView(name string) error {
    	return m.DB.Exec("DROP VIEW IF EXISTS ?", clause.Table{Name: name}).Error
    }
    
    // GuessConstraintAndTable guess statement's constraint and it's table based on name
    //
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Fri Apr 26 07:15:49 GMT 2024
    - 29K bytes
    - Viewed (0)
  3. tests/migrate_test.go

    	}
    
    	if err := DB.Migrator().DropView("users_pets"); err != nil {
    		t.Fatalf("Failed to drop view, got %v", err)
    	}
    
    	query = DB.Model(&User{}).Where("age > ?", 20)
    	if err := DB.Migrator().CreateView("users_view", gorm.ViewOption{Query: query}); err != nil {
    		t.Fatalf("Failed to crate view, got %v", err)
    	}
    	if err := DB.Migrator().DropView("users_view"); err != nil {
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Mon Mar 18 11:24:16 GMT 2024
    - 56.2K bytes
    - Viewed (0)
Back to top