forked from gophish/gophish
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactored result updating to be in result.go.
Added the modified_date field to results so it's easy to keep track of the last results that were modified without having to parse every event. Updated the tests to reflect the changes.
- Loading branch information
1 parent
222399c
commit 420410b
Showing
10 changed files
with
230 additions
and
147 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,4 +26,5 @@ gophish_admin.crt | |
gophish_admin.key | ||
|
||
*.exe | ||
*.db | ||
gophish.db* | ||
gophish |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
db/db_mysql/migrations/20180524203752_0.7.0_result_last_modified.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
|
||
-- +goose Up | ||
-- SQL in section 'Up' is executed when this migration is applied | ||
ALTER TABLE results ADD COLUMN modified_date DATETIME; | ||
|
||
UPDATE results | ||
SET `modified_date`= ( | ||
SELECT max(events.time) FROM events | ||
WHERE events.email=results.email | ||
AND events.campaign_id=results.campaign_id | ||
); | ||
|
||
|
||
|
||
-- +goose Down | ||
-- SQL section 'Down' is executed when this migration is rolled back | ||
|
17 changes: 17 additions & 0 deletions
17
db/db_sqlite3/migrations/20180524203752_0.7.0_result_last_modified.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
|
||
-- +goose Up | ||
-- SQL in section 'Up' is executed when this migration is applied | ||
ALTER TABLE results ADD COLUMN modified_date DATETIME; | ||
|
||
UPDATE results | ||
SET `modified_date`= ( | ||
SELECT max(events.time) FROM events | ||
WHERE events.email=results.email | ||
AND events.campaign_id=results.campaign_id | ||
); | ||
|
||
|
||
|
||
-- +goose Down | ||
-- SQL section 'Down' is executed when this migration is rolled back | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.