@@ -145,11 +145,11 @@ func TestSmartMigrateColumn(t *testing.T) {
145
145
fullSupported := map [string ]bool {"mysql" : true , "postgres" : true }[DB .Dialector .Name ()]
146
146
147
147
type UserMigrateColumn struct {
148
- ID uint
149
- Name string
150
- Salary float64
151
- Bonus float64 `gorm:"not null"`
152
- Stock float64
148
+ ID uint
149
+ Name string
150
+ Salary float64
151
+ // Bonus float64 `gorm:"not null"`
152
+ // Stock float64
153
153
Birthday time.Time `gorm:"precision:4"`
154
154
}
155
155
@@ -158,11 +158,11 @@ func TestSmartMigrateColumn(t *testing.T) {
158
158
DB .AutoMigrate (& UserMigrateColumn {})
159
159
160
160
type UserMigrateColumn2 struct {
161
- ID uint
162
- Name string `gorm:"size:128"`
163
- Salary float64 `gorm:"precision:2"`
164
- Bonus float64
165
- Stock float64 `gorm:"not null"`
161
+ ID uint
162
+ Name string `gorm:"size:128"`
163
+ Salary float64 `gorm:"precision:2"`
164
+ // Bonus float64
165
+ // Stock float64 `gorm:"not null"`
166
166
Birthday time.Time `gorm:"precision:2"`
167
167
NameIgnoreMigration string `gorm:"size:100"`
168
168
}
@@ -186,16 +186,16 @@ func TestSmartMigrateColumn(t *testing.T) {
186
186
if precision , o , _ := columnType .DecimalSize (); (fullSupported || precision != 0 ) && precision != 2 {
187
187
t .Fatalf ("salary's precision should be 2, but got %v %v" , precision , o )
188
188
}
189
- case "bonus" :
190
- // allow to change non-nullable to nullable
191
- if nullable , _ := columnType .Nullable (); ! nullable {
192
- t .Fatalf ("bonus's nullable should be true, bug got %t" , nullable )
193
- }
194
- case "stock" :
195
- // do not allow to change nullable to non-nullable
196
- if nullable , _ := columnType .Nullable (); ! nullable {
197
- t .Fatalf ("stock's nullable should be true, bug got %t" , nullable )
198
- }
189
+ // case "bonus":
190
+ // // allow to change non-nullable to nullable
191
+ // if nullable, _ := columnType.Nullable(); !nullable {
192
+ // t.Fatalf("bonus's nullable should be true, bug got %t", nullable)
193
+ // }
194
+ // case "stock":
195
+ // // do not allow to change nullable to non-nullable
196
+ // if nullable, _ := columnType.Nullable(); !nullable {
197
+ // t.Fatalf("stock's nullable should be true, bug got %t", nullable)
198
+ // }
199
199
case "birthday" :
200
200
if precision , _ , _ := columnType .DecimalSize (); (fullSupported || precision != 0 ) && precision != 2 {
201
201
t .Fatalf ("birthday's precision should be 2, but got %v" , precision )
0 commit comments