File tree Expand file tree Collapse file tree 2 files changed +3
-6
lines changed Expand file tree Collapse file tree 2 files changed +3
-6
lines changed Original file line number Diff line number Diff line change @@ -92,16 +92,13 @@ func TestSetAndGet(t *testing.T) {
92
92
}
93
93
}
94
94
95
- func TestInsertScenarios (t * testing.T ) {
95
+ func TesUserInsertScenarios (t * testing.T ) {
96
96
type UserWithAge struct {
97
97
ID uint `gorm:"column:ID;primaryKey"`
98
98
Name string `gorm:"column:NAME"`
99
99
Age int `gorm:"column:AGE"`
100
100
}
101
101
102
- if err := DB .Migrator ().DropTable (& UserWithAge {}); err != nil {
103
- t .Fatalf ("Failed to drop table: %v" , err )
104
- }
105
102
if err := DB .AutoMigrate (& UserWithAge {}); err != nil {
106
103
t .Fatalf ("Failed to migrate table: %v" , err )
107
104
}
@@ -126,7 +123,7 @@ func TestInsertScenarios(t *testing.T) {
126
123
Name string `gorm:"column:NAME"`
127
124
CreatedAt time.Time `gorm:"column:CREATED_AT"`
128
125
}
129
-
126
+
130
127
if err := DB .AutoMigrate (& UserWithTime {}); err != nil {
131
128
t .Fatalf ("Failed to migrate UserWithTime table: %v" , err )
132
129
}
Original file line number Diff line number Diff line change @@ -379,4 +379,4 @@ BenchmarkScanSlice
379
379
BenchmarkScanSlicePointer
380
380
BenchmarkUpdate
381
381
BenchmarkDelete
382
- TestInsertScenarios
382
+ TesUserInsertScenarios
You can’t perform that action at this time.
0 commit comments