Use SQL database instead of bolt #71

Merged
mrngm merged 6 commits from sql into master 2021-05-05 21:34:29 +02:00
Showing only changes of commit 3f09c1517d - Show all commits

View File

@ -33,14 +33,15 @@ func main() {
log.Fatalln(err)
}
// Migrate database schema
m := db.Gormigrate(sqlDB)
if err := m.MigrateTo("202010251337"); err != nil {
log.Fatalln(err)
}
// Migrate all files in filestorage
if err := sqlDB.Transaction(func(sqlTx *gorm.DB) error {
return boltDB.Bolt.View(func(boltTx *bolt.Tx) error {
// Migrate database schema
m := db.Gormigrate(sqlTx)
if err := m.MigrateTo("202010251337"); err != nil {
return err
}
// Migrate all the file uploads
allFUs, err := boltdb.AllFileUploads(boltTx)
if err != nil {