This repository was archived by the owner on Sep 30, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
migrations: add insights_query_runner_jobs table #18265
Merged
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
e3a4e21
insights: store: query metadata & other minor improvements
139e77d
update resolver data
70c85f8
insights: store: add support for recording data points
07b2634
go generate ./enterprise/internal/insights/store/ (regenerate mocks)
c645642
go test -update
03f8a8a
migrations: add insights_query_runner_jobs table
9cf7139
go generate ./internal/database/...
ee76175
add comment link, fix ordering
1684900
Merge remote-tracking branch 'origin/main' into sg/insights-worker-sc…
b5090c3
fix merge conflict
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
6 changes: 6 additions & 0 deletions
6
migrations/frontend/1528395783_insights_query_runner_jobs.down.sql
This file contains hidden or 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,6 @@ | ||
| BEGIN; | ||
|
|
||
| DROP INDEX IF EXISTS insights_query_runner_jobs_state_btree; | ||
| DROP TABLE IF EXISTS insights_query_runner_jobs; | ||
|
|
||
| COMMIT; | ||
20 changes: 20 additions & 0 deletions
20
migrations/frontend/1528395783_insights_query_runner_jobs.up.sql
This file contains hidden or 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,20 @@ | ||
| BEGIN; | ||
|
|
||
| CREATE TABLE IF NOT EXISTS insights_query_runner_jobs( | ||
| id SERIAL PRIMARY KEY, | ||
| series_id text NOT NULL, | ||
| search_query text NOT NULL, | ||
| state text default 'queued', | ||
| failure_message text, | ||
| started_at timestamptz, | ||
| finished_at timestamptz, | ||
| process_after timestamptz, | ||
| num_resets int4 NOT NULL default 0, | ||
| num_failures int4 NOT NULL default 0, | ||
| execution_logs json[] | ||
| ); | ||
| CREATE INDEX insights_query_runner_jobs_state_btree ON insights_query_runner_jobs USING btree (state); | ||
|
|
||
| COMMENT ON TABLE insights_query_runner_jobs IS 'See [enterprise/internal/insights/background/queryrunner/worker.go:Job](https://sourcegraph.com/search?q=repo:%5Egithub%5C.com/sourcegraph/sourcegraph%24+file:enterprise/internal/insights/background/queryrunner/worker.go+type+Job&patternType=literal)'; | ||
|
|
||
| COMMIT; |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.