2017-01-05 23:40:45 +00:00
|
|
|
-- +goose Up
|
|
|
|
-- SQL in section 'Up' is executed when this migration is applied
|
2018-12-27 16:23:54 +00:00
|
|
|
UPDATE `results`
|
2017-01-05 23:40:45 +00:00
|
|
|
SET status = "Submitted Data"
|
|
|
|
WHERE id IN (
|
|
|
|
SELECT results_tmp.id
|
|
|
|
FROM (SELECT * FROM results) AS results_tmp, events
|
|
|
|
WHERE results.status = "Success"
|
|
|
|
AND events.message="Submitted Data"
|
|
|
|
AND results_tmp.email = events.email
|
|
|
|
AND results_tmp.campaign_id = events.campaign_id);
|
|
|
|
|
2018-12-27 16:23:54 +00:00
|
|
|
UPDATE `results`
|
2017-01-05 23:40:45 +00:00
|
|
|
SET status = "Clicked Link"
|
|
|
|
WHERE id IN (
|
|
|
|
SELECT results_tmp.id
|
|
|
|
FROM (SELECT * FROM results) as results_tmp, events
|
|
|
|
WHERE results_tmp.status = "Success"
|
|
|
|
AND events.message="Clicked Link"
|
|
|
|
AND results_tmp.email = events.email
|
|
|
|
AND results_tmp.campaign_id = events.campaign_id);
|
|
|
|
|
|
|
|
-- +goose Down
|
|
|
|
-- SQL section 'Down' is executed when this migration is rolled back
|