Files
onepanel/db/go/20201028145443_update_vscode_template.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

34 lines
1.1 KiB
Go

package migration
import (
"database/sql"
"github.com/pressly/goose"
"path/filepath"
)
func initialize20201028145443() {
if _, ok := initializedMigrations[20201028145443]; !ok {
goose.AddMigration(Up20201028145443, Down20201028145443)
initializedMigrations[20201028145443] = true
}
}
// Up20201028145443 migration will add lifecycle hooks to VSCode template.
// These hooks will attempt to export the conda, pip, and vscode packages that are installed,
// to a text file.
// On workspace resume / start, the code then tries to install these packages.
func Up20201028145443(tx *sql.Tx) error {
// This code is executed when the migration is applied.
return updateWorkspaceTemplateManifest(
filepath.Join("workspaces", "vscode", "20201028145443.yaml"),
vscodeWorkspaceTemplateName)
}
// Down20201028145443 removes the lifecycle hooks from VSCode workspace template.
func Down20201028145443(tx *sql.Tx) error {
// This code is executed when the migration is rolled back.
return updateWorkspaceTemplateManifest(
filepath.Join("workspaces", "vscode", "20201028145443.yaml"),
vscodeWorkspaceTemplateName)
}