-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
FS-1289: create a table to hold event history for servers (#77)
* add an event history and generate ORM * api, client, and tests for managing event history * add validator tags, use errors.Is()
- Loading branch information
Showing
18 changed files
with
2,922 additions
and
46 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 |
---|---|---|
@@ -0,0 +1,22 @@ | ||
-- +goose Up | ||
-- +goose StatementBegin | ||
CREATE TABLE public.event_history ( | ||
event_id UUID NOT NULL PRIMARY KEY, | ||
event_type STRING NOT NULL, | ||
event_start TIMESTAMPTZ NOT NULL, | ||
event_end TIMESTAMPTZ NOT NULL, | ||
target_server UUID NOT NULL REFERENCES public.servers(id) ON DELETE CASCADE, | ||
parameters JSON, | ||
final_state STRING NOT NULL, | ||
final_status JSON | ||
); | ||
|
||
CREATE INDEX evt_history_target ON public.event_history (target_server ASC) INCLUDE (event_type, event_start, event_end); | ||
|
||
-- +goose StatementEnd | ||
|
||
-- +goose Down | ||
-- +goose StatementBegin | ||
DROP TABLE public.event_history; | ||
DROP INDEX evt_history_target; | ||
-- +goose StatementEnd |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.