forked from vmware-archive/atc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
146_clean_up_container_columns.go
37 lines (34 loc) · 1.15 KB
/
146_clean_up_container_columns.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
package migrations
import "github.com/concourse/atc/db/migration"
func CleanUpContainerColumns(tx migration.LimitedTx) error {
_, err := tx.Exec(`
ALTER TABLE containers
ADD COLUMN meta_type text NOT NULL DEFAULT '',
ADD COLUMN meta_step_name text NOT NULL DEFAULT '',
ADD COLUMN meta_attempt text NOT NULL DEFAULT '',
ADD COLUMN meta_working_directory text NOT NULL DEFAULT '',
ADD COLUMN meta_process_user text NOT NULL DEFAULT '',
ADD COLUMN meta_pipeline_id integer NOT NULL DEFAULT 0,
ADD COLUMN meta_job_id integer NOT NULL DEFAULT 0,
ADD COLUMN meta_build_id integer NOT NULL DEFAULT 0,
ADD COLUMN meta_pipeline_name text NOT NULL DEFAULT '',
ADD COLUMN meta_job_name text NOT NULL DEFAULT '',
ADD COLUMN meta_build_name text NOT NULL DEFAULT '',
DROP COLUMN type,
DROP COLUMN step_name,
DROP COLUMN check_type,
DROP COLUMN check_source,
DROP COLUMN working_directory,
DROP COLUMN env_variables,
DROP COLUMN attempts,
DROP COLUMN stage,
DROP COLUMN image_resource_type,
DROP COLUMN image_resource_source,
DROP COLUMN process_user,
DROP COLUMN resource_type_version
`)
if err != nil {
return err
}
return nil
}