potato/migrations/v2.go

24 lines
406 B
Go

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
}