-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #388 from onc-healthit/LANTERN-729-create-script-h…
…istory-pruning-algorithm Lantern 729 migration script for history pruning algorithm
- Loading branch information
Showing
2 changed files
with
21 additions
and
0 deletions.
There are no files selected for viewing
5 changes: 5 additions & 0 deletions
5
db/migration/migrations/000029_add_info_history_pruning_metadata.down.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,5 @@ | ||
BEGIN; | ||
|
||
DROP TABLE IF EXISTS info_history_pruning_metadata; | ||
|
||
COMMIT; |
16 changes: 16 additions & 0 deletions
16
db/migration/migrations/000029_add_info_history_pruning_metadata.up.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,16 @@ | ||
BEGIN; | ||
|
||
DROP TABLE IF EXISTS info_history_pruning_metadata; | ||
|
||
CREATE TABLE info_history_pruning_metadata ( | ||
id SERIAL PRIMARY KEY, | ||
started_on timestamp with time zone NOT NULL DEFAULT now(), | ||
ended_on timestamp with time zone, | ||
successful boolean NOT NULL DEFAULT false, | ||
num_rows_processed integer NOT NULL DEFAULT 0, | ||
num_rows_pruned integer NOT NULL DEFAULT 0, | ||
query_int_start_date timestamp with time zone NOT NULL, | ||
query_int_end_date timestamp with time zone NOT NULL | ||
); | ||
|
||
COMMIT; |