- Sort Score
- Result 10 results
- Languages All
Results 1 - 4 of 4 for CreateTable (0.14 sec)
-
migrator.go
// AutoMigrate AutoMigrate(dst ...interface{}) error // Database CurrentDatabase() string FullDataTypeOf(*schema.Field) clause.Expr GetTypeAliases(databaseTypeName string) []string // Tables CreateTable(dst ...interface{}) error DropTable(dst ...interface{}) error HasTable(dst interface{}) bool RenameTable(oldName, newName interface{}) error GetTables() (tableList []string, err error)
Go - Registered: Sun May 05 09:35:13 GMT 2024 - Last Modified: Mon Oct 30 09:15:49 GMT 2023 - 3.1K bytes - Viewed (0) -
migrator/migrator.go
err = m.DB.Raw("SELECT TABLE_NAME FROM information_schema.tables where TABLE_SCHEMA=?", m.CurrentDatabase()). Scan(&tableList).Error return } // CreateTable create table in database for values func (m Migrator) CreateTable(values ...interface{}) error { for _, value := range m.ReorderModels(values, false) { tx := m.DB.Session(&gorm.Session{})
Go - Registered: Sun May 05 09:35:13 GMT 2024 - Last Modified: Fri Apr 26 07:15:49 GMT 2024 - 29K bytes - Viewed (0) -
tests/postgres_test.go
t.Skip() } type Thing struct { gorm.Model SomeID string OtherID string Data string } DB.Migrator().DropTable(&Thing{}) DB.Migrator().CreateTable(&Thing{}) if err := DB.Exec("ALTER TABLE things ADD CONSTRAINT some_id_other_id_unique UNIQUE (some_id, other_id)").Error; err != nil { t.Error(err) } thing := Thing{ SomeID: "1234",
Go - Registered: Sun May 05 09:35:13 GMT 2024 - Last Modified: Sat Oct 08 09:16:32 GMT 2022 - 6.4K bytes - Viewed (3) -
tests/migrate_test.go
for _, m := range allModels { if !DB.Migrator().HasTable(m) { t.Fatalf("Failed to create table for %#v", m) } } DB.Scopes(func(db *gorm.DB) *gorm.DB { return db.Table("ccc") }).Migrator().CreateTable(&Company{}) if !DB.Migrator().HasTable("ccc") { t.Errorf("failed to create table ccc") } for _, indexes := range [][2]string{ {"user_speaks", "fk_user_speaks_user"},
Go - Registered: Sun May 05 09:35:13 GMT 2024 - Last Modified: Mon Mar 18 11:24:16 GMT 2024 - 56.2K bytes - Viewed (0)