aboutsummaryrefslogtreecommitdiff
path: root/pkg/database/sql/migration.go
blob: 019eb91371ca24ec8f1b55fa1e6b80730c716ac0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
package sql

import "gorm.io/gorm"

func Migrate(db *gorm.DB) error {
	for _, m := range []any{
		&User{},
		&Settings{},
		&Media{},
		&MediaEXIF{},
	} {
		if err := db.AutoMigrate(m); err != nil {
			return err
		}
	}
	return nil
}