Add cmd for generating code from the new models
Some checks are pending
/ test (push) Waiting to run

This commit is contained in:
Melody Becker 2025-03-27 13:35:24 +01:00
parent 67b507f4bd
commit bf5180559f
Signed by: mstar
SSH key fingerprint: SHA256:9VAo09aaVNTWKzPW7Hq2LW+ox9OdwmTSHRoD4mlz1yI
9 changed files with 401 additions and 132 deletions

View file

@ -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