|
package ocpmigrations
import (
"database/sql"
"github.com/RedHatInsights/insights-results-aggregator/migration"
"github.com/RedHatInsights/insights-results-aggregator/types"
)
var mig0001CreateReport = migration . Migration {
StepUp : func ( tx * sql . Tx , _ types . DBDriver ) error {
_ , err := tx . Exec ( `
CREATE TABLE report (
org_id INTEGER NOT NULL,
cluster VARCHAR NOT NULL UNIQUE,
report VARCHAR NOT NULL,
reported_at TIMESTAMP,
last_checked_at TIMESTAMP,
PRIMARY KEY(org_id, cluster)
)` )
return err
} ,
StepDown : func ( tx * sql . Tx , _ types . DBDriver ) error {
_ , err := tx . Exec ( `DROP TABLE report` )
return err
} ,
}
|