mirror of
https://github.com/versia-pub/server.git
synced 2026-03-13 05:49:16 +01:00
perf(api): ⚡ Store user and post metrics directly in database instead of recalculating them on-the-fly
Some checks failed
CodeQL Scan / Analyze (javascript-typescript) (push) Failing after 0s
Build Docker Images / lint (push) Failing after 6s
Build Docker Images / check (push) Failing after 6s
Build Docker Images / tests (push) Failing after 6s
Deploy Docs to GitHub Pages / build (push) Failing after 1s
Build Docker Images / build (server, Dockerfile, ${{ github.repository_owner }}/server) (push) Has been skipped
Build Docker Images / build (worker, Worker.Dockerfile, ${{ github.repository_owner }}/worker) (push) Has been skipped
Deploy Docs to GitHub Pages / Deploy (push) Has been skipped
Mirror to Codeberg / Mirror (push) Failing after 1s
Nix Build / check (push) Failing after 1s
Some checks failed
CodeQL Scan / Analyze (javascript-typescript) (push) Failing after 0s
Build Docker Images / lint (push) Failing after 6s
Build Docker Images / check (push) Failing after 6s
Build Docker Images / tests (push) Failing after 6s
Deploy Docs to GitHub Pages / build (push) Failing after 1s
Build Docker Images / build (server, Dockerfile, ${{ github.repository_owner }}/server) (push) Has been skipped
Build Docker Images / build (worker, Worker.Dockerfile, ${{ github.repository_owner }}/worker) (push) Has been skipped
Deploy Docs to GitHub Pages / Deploy (push) Has been skipped
Mirror to Codeberg / Mirror (push) Failing after 1s
Nix Build / check (push) Failing after 1s
This commit is contained in:
parent
cd12ccd6c1
commit
ddb3cfc978
16 changed files with 2676 additions and 106 deletions
6
drizzle/migrations/0050_thick_lester.sql
Normal file
6
drizzle/migrations/0050_thick_lester.sql
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
ALTER TABLE "Notes" ADD COLUMN "reblog_count" integer DEFAULT 0 NOT NULL;--> statement-breakpoint
|
||||
ALTER TABLE "Notes" ADD COLUMN "like_count" integer DEFAULT 0 NOT NULL;--> statement-breakpoint
|
||||
ALTER TABLE "Notes" ADD COLUMN "reply_count" integer DEFAULT 0 NOT NULL;--> statement-breakpoint
|
||||
ALTER TABLE "Users" ADD COLUMN "follower_count" integer DEFAULT 0 NOT NULL;--> statement-breakpoint
|
||||
ALTER TABLE "Users" ADD COLUMN "following_count" integer DEFAULT 0 NOT NULL;--> statement-breakpoint
|
||||
ALTER TABLE "Users" ADD COLUMN "status_count" integer DEFAULT 0 NOT NULL;
|
||||
2384
drizzle/migrations/meta/0050_snapshot.json
Normal file
2384
drizzle/migrations/meta/0050_snapshot.json
Normal file
File diff suppressed because it is too large
Load diff
|
|
@ -351,6 +351,13 @@
|
|||
"when": 1744979203068,
|
||||
"tag": "0049_graceful_iron_man",
|
||||
"breakpoints": true
|
||||
},
|
||||
{
|
||||
"idx": 50,
|
||||
"version": "7",
|
||||
"when": 1746368175263,
|
||||
"tag": "0050_thick_lester",
|
||||
"breakpoints": true
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
|
|||
|
|
@ -446,6 +446,9 @@ export const Notes = pgTable("Notes", {
|
|||
visibility: text("visibility")
|
||||
.$type<z.infer<typeof StatusSchema.shape.visibility>>()
|
||||
.notNull(),
|
||||
reblogCount: integer("reblog_count").default(0).notNull(),
|
||||
likeCount: integer("like_count").default(0).notNull(),
|
||||
replyCount: integer("reply_count").default(0).notNull(),
|
||||
replyId: uuid("replyId").references((): AnyPgColumn => Notes.id, {
|
||||
onDelete: "cascade",
|
||||
onUpdate: "cascade",
|
||||
|
|
@ -583,6 +586,9 @@ export const Users = pgTable(
|
|||
onDelete: "set null",
|
||||
onUpdate: "cascade",
|
||||
}),
|
||||
followerCount: integer("follower_count").default(0).notNull(),
|
||||
followingCount: integer("following_count").default(0).notNull(),
|
||||
statusCount: integer("status_count").default(0).notNull(),
|
||||
createdAt: createdAt(),
|
||||
updatedAt: updatedAt(),
|
||||
isBot: boolean("is_bot").default(false).notNull(),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue