
If Shaman is used to submit the job files, store the job's checkout ID (i.e. the path relative to the checkout root) in the database. This will make it possible in the future to remove the Shaman checkout along with the job itself.
25 lines
376 B
Go
25 lines
376 B
Go
package persistence
|
|
|
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
import (
|
|
"fmt"
|
|
)
|
|
|
|
func (db *DB) migrate() error {
|
|
err := db.gormDB.AutoMigrate(
|
|
&Job{},
|
|
&JobBlock{},
|
|
&JobStorageInfo{},
|
|
&LastRendered{},
|
|
&SleepSchedule{},
|
|
&Task{},
|
|
&TaskFailure{},
|
|
&Worker{},
|
|
)
|
|
if err != nil {
|
|
return fmt.Errorf("failed to automigrate database: %v", err)
|
|
}
|
|
return nil
|
|
}
|