Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 3 of 3 for RenameIndex (0.14 sec)

  1. migrator.go

    	HasConstraint(dst interface{}, name string) bool
    
    	// Indexes
    	CreateIndex(dst interface{}, name string) error
    	DropIndex(dst interface{}, name string) error
    	HasIndex(dst interface{}, name string) bool
    	RenameIndex(dst interface{}, oldName, newName string) error
    	GetIndexes(dst interface{}) ([]Index, error)
    Registered: Sun Nov 03 09:35:10 UTC 2024
    - Last Modified: Mon Oct 30 09:15:49 UTC 2023
    - 3.1K bytes
    - Viewed (0)
  2. migrator/migrator.go

    			currentDatabase, stmt.Table, name,
    		).Row().Scan(&count)
    	})
    
    	return count > 0
    }
    
    // RenameIndex rename index from oldName to newName
    func (m Migrator) RenameIndex(value interface{}, oldName, newName string) error {
    	return m.RunWithValue(value, func(stmt *gorm.Statement) error {
    		return m.DB.Exec(
    			"ALTER TABLE ? RENAME INDEX ? TO ?",
    Registered: Sun Nov 03 09:35:10 UTC 2024
    - Last Modified: Fri Apr 26 07:15:49 UTC 2024
    - 29K bytes
    - Viewed (0)
  3. tests/migrate_test.go

    	}
    
    	if err := DB.Migrator().CreateIndex(&IndexStruct{}, "Name"); err != nil {
    		t.Fatalf("Got error when tried to create index: %+v", err)
    	}
    
    	if err := DB.Migrator().RenameIndex(&IndexStruct{}, "idx_index_structs_name", "idx_users_name_1"); err != nil {
    		t.Fatalf("no error should happen when rename index, but got %v", err)
    	}
    
    	if !DB.Migrator().HasIndex(&IndexStruct{}, "idx_users_name_1") {
    Registered: Sun Nov 03 09:35:10 UTC 2024
    - Last Modified: Mon Mar 18 11:24:16 UTC 2024
    - 56.2K bytes
    - Viewed (0)
Back to top