
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.
18 lines
266 B
Go
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
|
|
}
|