potato/migrations/v2.go

24 lines
406 B
Go
Raw Permalink Normal View History

2022-07-15 19:04:33 +08:00
package migrations
import (
"fmt"
"github.com/viletyy/potato/internal/model"
"gorm.io/gorm"
)
func createTableAuths(db *gorm.DB) (err error) {
type Auth struct {
*model.Model
AppKey string `json:"app_key"`
AppSecret string `json:"app_secret"`
}
if err := db.Debug().AutoMigrate(&Auth{}); err != nil {
return fmt.Errorf("migrations: create table auths err: %v", err)
}
return nil
}