- Sort Score
- Result 10 results
- Languages All
Results 1 - 5 of 5 for HasColumn (0.14 sec)
-
tests/customize_field_test.go
if err := DB.AutoMigrate(&CustomizeFieldStruct{}); err != nil { t.Errorf("Failed to migrate, got error: %v", err) } if DB.Migrator().HasColumn(&CustomizeFieldStruct{}, "FieldIgnore") { t.Errorf("FieldIgnore should not be created") } if DB.Migrator().HasColumn(&CustomizeFieldStruct{}, "field_ignore") { t.Errorf("FieldIgnore should not be created") } generateStruct := func(name string) *CustomizeFieldStruct {
Registered: Sun Nov 03 09:35:10 UTC 2024 - Last Modified: Fri Sep 11 09:33:31 UTC 2020 - 6.9K bytes - Viewed (0) -
migrator.go
// MigrateColumnUnique migrate column's UNIQUE constraint, it's part of MigrateColumn. MigrateColumnUnique(dst interface{}, field *schema.Field, columnType ColumnType) error 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
Registered: Sun Nov 03 09:35:10 UTC 2024 - Last Modified: Mon Oct 30 09:15:49 UTC 2023 - 3.1K bytes - Viewed (0) -
tests/embedded_struct_test.go
t.Fatalf("failed to auto migrate, got error: %v", err) } for _, name := range []string{"author_id", "author_name", "author_email"} { if !DB.Migrator().HasColumn(&EngadgetPost{}, name) { t.Errorf("should has prefixed column %v", name) } } stmt := gorm.Statement{DB: DB} if err := stmt.Parse(&EngadgetPost{}); err != nil { t.Fatalf("failed to parse embedded struct")
Registered: Sun Nov 03 09:35:10 UTC 2024 - Last Modified: Wed May 08 04:07:58 UTC 2024 - 7.3K bytes - Viewed (0) -
tests/migrate_test.go
} if !DB.Table("column_structs").Migrator().HasColumn(&NewColumnStruct{}, "NewName") { t.Fatalf("Failed to find added column") } if err := DB.Table("column_structs").Migrator().DropColumn(&NewColumnStruct{}, "NewName"); err != nil { t.Fatalf("Failed to add column, got %v", err) } if DB.Table("column_structs").Migrator().HasColumn(&NewColumnStruct{}, "NewName") { t.Fatalf("Found deleted column") }
Registered: Sun Nov 03 09:35:10 UTC 2024 - Last Modified: Mon Mar 18 11:24:16 UTC 2024 - 56.2K bytes - Viewed (0) -
migrator/migrator.go
).Error } } return fmt.Errorf("failed to look up field with name: %s", field) }) } // HasColumn check has column `field` for value or not func (m Migrator) HasColumn(value interface{}, field string) bool { var count int64 m.RunWithValue(value, func(stmt *gorm.Statement) error { currentDatabase := m.DB.Migrator().CurrentDatabase() name := field
Registered: Sun Nov 03 09:35:10 UTC 2024 - Last Modified: Fri Apr 26 07:15:49 UTC 2024 - 29K bytes - Viewed (0)