github.com/merlinepedra/gophish1@v0.9.0/db/db_mysql/migrations/20170104231222_0.2_result_statuses.sql (about)

     1  -- +goose Up
     2  -- SQL in section 'Up' is executed when this migration is applied
     3  UPDATE `results`
     4  SET status = "Submitted Data"
     5  WHERE id IN (
     6          SELECT results_tmp.id
     7          FROM (SELECT * FROM results) AS results_tmp, events
     8          WHERE results.status = "Success"
     9                  AND events.message="Submitted Data"
    10                  AND results_tmp.email = events.email
    11                  AND results_tmp.campaign_id = events.campaign_id);
    12  
    13  UPDATE `results`
    14  SET status = "Clicked Link"
    15  WHERE id IN (
    16          SELECT results_tmp.id
    17          FROM (SELECT * FROM results) as results_tmp, events
    18          WHERE results_tmp.status = "Success"
    19                  AND events.message="Clicked Link"
    20                  AND results_tmp.email = events.email
    21                  AND results_tmp.campaign_id = events.campaign_id);
    22  
    23  -- +goose Down
    24  -- SQL section 'Down' is executed when this migration is rolled back