Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 2 of 2 for AlterColumn (0.11 sec)

  1. migrator/migrator.go

    			}
    		}
    	}
    
    	// check comment
    	if comment, ok := columnType.Comment(); ok && comment != field.Comment {
    		// not primary key
    		if !field.PrimaryKey {
    			alterColumn = true
    		}
    	}
    
    	if alterColumn {
    		if err := m.DB.Migrator().AlterColumn(value, field.DBName); err != nil {
    			return err
    		}
    	}
    
    Registered: Sun Nov 03 09:35:10 UTC 2024
    - Last Modified: Fri Apr 26 07:15:49 UTC 2024
    - 29K bytes
    - Viewed (0)
  2. tests/migrate_test.go

    	AssertEqual(t, nil, err)
    	AssertEqual(t, "integer[]", ct.DatabaseTypeName())
    }
    
    type mockMigrator struct {
    	gorm.Migrator
    }
    
    func (mm mockMigrator) AlterColumn(dst interface{}, field string) error {
    	err := mm.Migrator.AlterColumn(dst, field)
    	if err != nil {
    		return err
    	}
    	return fmt.Errorf("trigger alter column error, field: %s", field)
    }
    
    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