forked from sourcegraph/sourcegraph-public-snapshot
-
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.
a8n: Introduce Threads in Store (sourcegraph#5509)
* a8n: Add threads table migration * a8n: Implement Store.{Create,Count,List}Thread(s) * Update schema.md * a8n: Implement filtering by Campaign in Store.ListThreads * a8n: Implement filtering support in Store.CountThreads
- Loading branch information
Showing
7 changed files
with
449 additions
and
49 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
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,6 @@ | ||
BEGIN; | ||
|
||
DROP TABLE IF EXISTS threads; | ||
|
||
COMMIT; | ||
|
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,14 @@ | ||
BEGIN; | ||
|
||
CREATE TABLE IF NOT EXISTS threads ( | ||
id bigserial PRIMARY KEY, | ||
campaign_id integer NOT NULL REFERENCES campaigns(id) | ||
ON DELETE CASCADE DEFERRABLE INITIALLY IMMEDIATE, | ||
repo_id integer NOT NULL REFERENCES repo(id) | ||
ON DELETE CASCADE DEFERRABLE INITIALLY IMMEDIATE, | ||
created_at timestamp with time zone NOT NULL DEFAULT now(), | ||
updated_at timestamp with time zone NOT NULL DEFAULT now(), | ||
metadata jsonb NOT NULL DEFAULT '{}' CHECK (jsonb_typeof(metadata) = 'object') | ||
); | ||
|
||
COMMIT; |
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.