package migrations

import (
	"github.com/forgeo/forgebucket/internal/models"
	"xorm.io/xorm"
)

func Run(engine *xorm.Engine) error {
	if err := engine.Sync2(
		&models.User{},
		&models.Repository{},
		&models.PullRequest{},
		&models.FederationActor{},
		&models.Issue{},
		&models.SSHKey{},
	); err != nil {
		return err
	}
	if err := Run002(engine); err != nil {
		return err
	}
	if err := Run003(engine); err != nil {
		return err
	}
	if err := Run004(engine); err != nil {
		return err
	}
	if err := Run005(engine); err != nil {
		return err
	}
	if err := Run006(engine); err != nil {
		return err
	}
	if err := Run007(engine); err != nil {
		return err
	}
	if err := Run008(engine); err != nil {
		return err
	}
	if err := Run009(engine); err != nil {
		return err
	}
	return Run010(engine)
}
