Sybren A. Stüvel 350f4f60cb Worker: convert database interface to GORM
Convert the database interface from the stdlib `database/sql` package to
the GORM object relational mapper.

GORM is also used by the Manager, and thus with this change both Worker
and Manager have a uniform way of accessing their databases.
2022-08-01 14:29:14 +02:00

18 lines
266 B
Go

package persistence
// SPDX-License-Identifier: GPL-3.0-or-later
import (
"fmt"
)
func (db *DB) migrate() error {
err := db.gormDB.AutoMigrate(
&TaskUpdate{},
)
if err != nil {
return fmt.Errorf("failed to automigrate database: %v", err)
}
return nil
}