mirror of
https://github.com/onepanelio/onepanel.git
synced 2025-09-26 17:51:13 +08:00
41 lines
1.1 KiB
Go
41 lines
1.1 KiB
Go
package migration
|
|
|
|
import (
|
|
"database/sql"
|
|
"github.com/pressly/goose"
|
|
"path/filepath"
|
|
)
|
|
|
|
func initialize20201221195937() {
|
|
if _, ok := initializedMigrations[20201221195937]; !ok {
|
|
goose.AddMigration(Up20201221195937, Down20201221195937)
|
|
initializedMigrations[20201221195937] = true
|
|
}
|
|
}
|
|
|
|
// Up20201221195937 updates maskrcnn with sys.nodepool changes
|
|
func Up20201221195937(tx *sql.Tx) error {
|
|
// This code is executed when the migration is applied.
|
|
return updateWorkflowTemplateManifest(
|
|
filepath.Join("workflows", "maskrcnn-training", "20201221195937.yaml"),
|
|
maskRCNNWorkflowTemplateName,
|
|
map[string]string{
|
|
"created-by": "system",
|
|
"used-by": "cvat",
|
|
},
|
|
)
|
|
}
|
|
|
|
// Down20201221195937 undoes the sys.nodepool changes
|
|
func Down20201221195937(tx *sql.Tx) error {
|
|
// This code is executed when the migration is rolled back.
|
|
return updateWorkflowTemplateManifest(
|
|
filepath.Join("workflows", "maskrcnn-training", "20201208155115.yaml"),
|
|
maskRCNNWorkflowTemplateName,
|
|
map[string]string{
|
|
"created-by": "system",
|
|
"used-by": "cvat",
|
|
},
|
|
)
|
|
}
|