mirror of
https://github.com/versia-pub/server.git
synced 2026-03-13 05:49:16 +01:00
Remove Prisma once and for all
This commit is contained in:
parent
90d522eaa3
commit
a65249b79d
18 changed files with 112 additions and 563 deletions
|
|
@ -1,10 +1,4 @@
|
|||
// import { Queue } from "bullmq";
|
||||
import { PrismaClient } from "@prisma/client";
|
||||
import { config } from "config-manager";
|
||||
|
||||
const client = new PrismaClient({
|
||||
datasourceUrl: `postgresql://${config.database.username}:${config.database.password}@${config.database.host}:${config.database.port}/${config.database.database}`,
|
||||
});
|
||||
|
||||
/* const federationQueue = new Queue("federation", {
|
||||
connection: {
|
||||
|
|
@ -14,5 +8,3 @@ const client = new PrismaClient({
|
|||
db: config.redis.queue.database || undefined,
|
||||
},
|
||||
}); */
|
||||
|
||||
export { client /* federationQueue */ };
|
||||
|
|
|
|||
|
|
@ -1,111 +0,0 @@
|
|||
import type { Prisma } from "@prisma/client";
|
||||
|
||||
export const userRelations: Prisma.UserInclude = {
|
||||
emojis: true,
|
||||
instance: true,
|
||||
likes: true,
|
||||
relationships: true,
|
||||
relationshipSubjects: true,
|
||||
pinnedNotes: true,
|
||||
_count: {
|
||||
select: {
|
||||
statuses: true,
|
||||
likes: true,
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
export const statusAndUserRelations: Prisma.StatusInclude = {
|
||||
author: {
|
||||
include: userRelations,
|
||||
},
|
||||
application: true,
|
||||
emojis: true,
|
||||
inReplyToPost: {
|
||||
include: {
|
||||
author: {
|
||||
include: userRelations,
|
||||
},
|
||||
application: true,
|
||||
emojis: true,
|
||||
inReplyToPost: {
|
||||
include: {
|
||||
author: true,
|
||||
},
|
||||
},
|
||||
instance: true,
|
||||
mentions: true,
|
||||
pinnedBy: true,
|
||||
_count: {
|
||||
select: {
|
||||
replies: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
reblogs: true,
|
||||
attachments: true,
|
||||
instance: true,
|
||||
mentions: {
|
||||
include: userRelations,
|
||||
},
|
||||
pinnedBy: true,
|
||||
_count: {
|
||||
select: {
|
||||
replies: true,
|
||||
likes: true,
|
||||
reblogs: true,
|
||||
},
|
||||
},
|
||||
reblog: {
|
||||
include: {
|
||||
author: {
|
||||
include: userRelations,
|
||||
},
|
||||
application: true,
|
||||
emojis: true,
|
||||
inReplyToPost: {
|
||||
include: {
|
||||
author: true,
|
||||
},
|
||||
},
|
||||
instance: true,
|
||||
mentions: {
|
||||
include: userRelations,
|
||||
},
|
||||
pinnedBy: true,
|
||||
_count: {
|
||||
select: {
|
||||
replies: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
quotingPost: {
|
||||
include: {
|
||||
author: {
|
||||
include: userRelations,
|
||||
},
|
||||
application: true,
|
||||
emojis: true,
|
||||
inReplyToPost: {
|
||||
include: {
|
||||
author: true,
|
||||
},
|
||||
},
|
||||
instance: true,
|
||||
mentions: true,
|
||||
pinnedBy: true,
|
||||
_count: {
|
||||
select: {
|
||||
replies: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
likes: {
|
||||
include: {
|
||||
liker: true,
|
||||
},
|
||||
},
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue