Add cmd for generating code from the new models
Some checks are pending
/ test (push) Waiting to run
Some checks are pending
/ test (push) Waiting to run
This commit is contained in:
parent
67b507f4bd
commit
bf5180559f
9 changed files with 401 additions and 132 deletions
|
@ -32,26 +32,7 @@ func Migrate(db *gorm.DB) error {
|
|||
|
||||
// Returns the raw error created by gorm, with no wrapping
|
||||
func migrateTypes(db *gorm.DB) error {
|
||||
if err := db.AutoMigrate(
|
||||
&models.Emote{},
|
||||
&models.MediaMetadata{},
|
||||
&models.Note{},
|
||||
&models.NoteToAttachment{},
|
||||
&models.NoteToEmote{},
|
||||
&models.NoteToPing{},
|
||||
&models.NoteTag{},
|
||||
&models.Reaction{},
|
||||
&models.RemoteServer{},
|
||||
&models.Role{},
|
||||
&models.User{},
|
||||
&models.UserAuthMethod{},
|
||||
&models.UserToBeing{},
|
||||
&models.UserInfoField{},
|
||||
&models.UserToUserRelation{},
|
||||
&models.UserRemoteLinks{},
|
||||
&models.UserToRole{},
|
||||
&models.UserToTag{},
|
||||
); err != nil {
|
||||
if err := db.AutoMigrate(models.AllTypes...); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue