- Sort Score
- Result 10 results
- Languages All
Results 1 - 2 of 2 for Migrator (0.07 sec)
-
tests/migrate_test.go
gorm.Model Name string } if err := DB.Migrator().RenameTable(&TableStruct{}, &NewTableStruct{}); err != nil { t.Fatalf("Failed to rename table, got error %v", err) } if !DB.Migrator().HasTable("new_table_structs") { t.Fatal("should found renamed table") } DB.Migrator().DropTable("new_table_structs") if DB.Migrator().HasTable(&NewTableStruct{}) {
Registered: Sun Nov 03 09:35:10 UTC 2024 - Last Modified: Mon Mar 18 11:24:16 UTC 2024 - 56.2K bytes - Viewed (0) -
tests/query_test.go
} } func TestCustomizedTypePrimaryKey(t *testing.T) { type ID uint type CustomizedTypePrimaryKey struct { ID ID Name string } DB.Migrator().DropTable(&CustomizedTypePrimaryKey{}) if err := DB.AutoMigrate(&CustomizedTypePrimaryKey{}); err != nil { t.Fatalf("failed to migrate, got error %v", err) } p1 := CustomizedTypePrimaryKey{Name: "p1"}
Registered: Sun Nov 03 09:35:10 UTC 2024 - Last Modified: Mon Jun 24 09:42:59 UTC 2024 - 50.4K bytes - Viewed (0)