|
package ocpmigrations
import (
"database/sql"
"github.com/RedHatInsights/insights-results-aggregator/migration"
"github.com/RedHatInsights/insights-results-aggregator/types"
)
var mig0005CreateConsumerError = migration . Migration {
StepUp : func ( tx * sql . Tx , _ types . DBDriver ) error {
_ , err := tx . Exec ( `
CREATE TABLE consumer_error (
topic VARCHAR NOT NULL,
partition INTEGER NOT NULL,
topic_offset INTEGER NOT NULL,
key VARCHAR,
produced_at TIMESTAMP NOT NULL,
consumed_at TIMESTAMP NOT NULL,
message VARCHAR,
error VARCHAR NOT NULL,
PRIMARY KEY(topic, partition, topic_offset)
)
` )
return err
} ,
StepDown : func ( tx * sql . Tx , _ types . DBDriver ) error {
_ , err := tx . Exec ( `DROP TABLE consumer_error` )
return err
} ,
}
|