Example #1
0
func migrate(db *gorm.DB) {
	// Bootsrrap migrations
	if err := migrations.Bootstrap(db); err != nil {
		log.Fatal(err)
	}
	// Run migrations for the oauth service
	if err := oauth.MigrateAll(db); err != nil {
		log.Fatal(err)
	}
}
Example #2
0
// Migrate migrates the database
func Migrate(db *gorm.DB) error {
	// Bootsrrap migrations
	if err := migrations.Bootstrap(db); err != nil {
		return err
	}

	// Run migrations for the oauth service
	if err := oauth.MigrateAll(db); err != nil {
		return err
	}

	return nil
}
Example #3
0
// Migrate runs database migrations
func Migrate() error {
	_, db, err := initConfigDB(true, false)
	if err != nil {
		return err
	}
	defer db.Close()

	// Bootstrap migrations
	if err := migrations.Bootstrap(db); err != nil {
		return err
	}

	// Run migrations for the oauth service
	if err := oauth.MigrateAll(db); err != nil {
		return err
	}

	return nil
}