add score feed
This commit is contained in:
parent
3f43f3d801
commit
c11a1bc110
2 changed files with 12 additions and 0 deletions
|
@ -5,6 +5,7 @@ DROP INDEX IF EXISTS reaction_by_id;
|
|||
DROP TABLE IF EXISTS reaction;
|
||||
DROP INDEX IF EXISTS home_by_id;
|
||||
DROP TABLE IF EXISTS home_timeline;
|
||||
DROP MATERIALIZED VIEW IF EXISTS score_feed;
|
||||
DROP MATERIALIZED VIEW IF EXISTS local_timeline;
|
||||
DROP MATERIALIZED VIEW IF EXISTS global_timeline;
|
||||
DROP MATERIALIZED VIEW IF EXISTS note_by_channel_id;
|
||||
|
|
|
@ -157,6 +157,17 @@ CREATE MATERIALIZED VIEW local_timeline AS
|
|||
PRIMARY KEY ("createdAtDate", "createdAt", "userId", "userHost", "visibility")
|
||||
WITH CLUSTERING ORDER BY ("createdAt" DESC);
|
||||
|
||||
CREATE MATERIALIZED VIEW score_feed AS
|
||||
SELECT * FROM note
|
||||
WHERE "createdAtDate" IS NOT NULL
|
||||
AND "createdAt" IS NOT NULL
|
||||
AND "userId" IS NOT NULL
|
||||
AND "userHost" IS NOT NULL
|
||||
AND "score" IS NOT NULL
|
||||
AND "visibility" = 'public'
|
||||
PRIMARY KEY ("createdAtDate", "score", "createdAt", "userId", "userHost", "visibility")
|
||||
WITH CLUSTERING ORDER BY ("score" DESC, "createdAt" DESC);
|
||||
|
||||
CREATE TABLE home_timeline (
|
||||
"feedUserId" ascii, -- For partitioning
|
||||
"createdAtDate" date, -- For partitioning
|
||||
|
|
Loading…
Reference in a new issue