|
package ocpmigrations
import (
"github.com/RedHatInsights/insights-results-aggregator/migration"
)
var mig0004ModifyClusterRuleUserFeedback = migration . NewUpdateTableMigration (
clusterRuleUserFeedbackTable ,
`
CREATE TABLE cluster_rule_user_feedback (
cluster_id VARCHAR NOT NULL,
rule_id VARCHAR NOT NULL,
user_id VARCHAR NOT NULL,
message VARCHAR NOT NULL,
user_vote SMALLINT NOT NULL,
added_at TIMESTAMP NOT NULL,
updated_at TIMESTAMP NOT NULL,
PRIMARY KEY(cluster_id, rule_id, user_id)
);
` ,
nil ,
`
CREATE TABLE cluster_rule_user_feedback (
cluster_id VARCHAR NOT NULL,
rule_id VARCHAR NOT NULL,
user_id VARCHAR NOT NULL,
message VARCHAR NOT NULL,
user_vote SMALLINT NOT NULL,
added_at TIMESTAMP NOT NULL,
updated_at TIMESTAMP NOT NULL,
PRIMARY KEY(cluster_id, rule_id, user_id),
CONSTRAINT cluster_rule_user_feedback_cluster_id_fkey
FOREIGN KEY (cluster_id)
REFERENCES report(cluster)
ON DELETE CASCADE,
CONSTRAINT cluster_rule_user_feedback_rule_id_fkey
FOREIGN KEY (rule_id)
REFERENCES rule(module)
ON DELETE CASCADE
);
` ,
)
|