Files
onepanel/db/go/20201102104048_update_cvat_reduce_vols.go
Andrey Melnikov ca5f602738 fix: separated workflow templates and workspace templates for yaml resources for migrations.
Also updated migration yamls to the latest based on templates repo.
2020-12-25 16:32:15 -08:00

33 lines
1013 B
Go

package migration
import (
"database/sql"
"github.com/pressly/goose"
"path/filepath"
)
func initialize20201102104048() {
if _, ok := initializedMigrations[20201102104048]; !ok {
goose.AddMigration(Up20201102104048, Down20201102104048)
initializedMigrations[20201102104048] = true
}
}
// Up20201102104048 updates CVAT to use less volumes.
// Through the use of environment variables, various CVAT data directories
// are placed under one path, and that path is on one volume.
func Up20201102104048(tx *sql.Tx) error {
// This code is executed when the migration is applied.
return updateWorkspaceTemplateManifest(
filepath.Join("workspaces", "cvat", "20201102104048.yaml"),
cvatTemplateName)
}
// Down20201102104048 reverts CVAT back to original amount of volumes.
func Down20201102104048(tx *sql.Tx) error {
// This code is executed when the migration is rolled back.
return updateWorkspaceTemplateManifest(
filepath.Join("workspaces", "cvat", "20201016170415.yaml"),
cvatTemplateName)
}