aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/models/video/sql/comment/video-comment-table-attributes.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/models/video/sql/comment/video-comment-table-attributes.ts')
-rw-r--r--server/models/video/sql/comment/video-comment-table-attributes.ts78
1 files changed, 78 insertions, 0 deletions
diff --git a/server/models/video/sql/comment/video-comment-table-attributes.ts b/server/models/video/sql/comment/video-comment-table-attributes.ts
new file mode 100644
index 000000000..cae3c1683
--- /dev/null
+++ b/server/models/video/sql/comment/video-comment-table-attributes.ts
@@ -0,0 +1,78 @@
1export class VideoCommentTableAttributes {
2
3 getVideoCommentAttributes () {
4 return [
5 '"VideoCommentModel"."id"',
6 '"VideoCommentModel"."url"',
7 '"VideoCommentModel"."deletedAt"',
8 '"VideoCommentModel"."updatedAt"',
9 '"VideoCommentModel"."createdAt"',
10 '"VideoCommentModel"."text"',
11 '"VideoCommentModel"."originCommentId"',
12 '"VideoCommentModel"."inReplyToCommentId"',
13 '"VideoCommentModel"."videoId"',
14 '"VideoCommentModel"."accountId"'
15 ].join(', ')
16 }
17
18 getAccountAttributes () {
19 return [
20 `"Account"."id" AS "Account.id"`,
21 `"Account"."name" AS "Account.name"`,
22 `"Account"."description" AS "Account.description"`,
23 `"Account"."createdAt" AS "Account.createdAt"`,
24 `"Account"."updatedAt" AS "Account.updatedAt"`,
25 `"Account"."actorId" AS "Account.actorId"`,
26 `"Account"."userId" AS "Account.userId"`,
27 `"Account"."applicationId" AS "Account.applicationId"`
28 ].join(', ')
29 }
30
31 getVideoAttributes () {
32 return [
33 `"Video"."id" AS "Video.id"`,
34 `"Video"."uuid" AS "Video.uuid"`,
35 `"Video"."name" AS "Video.name"`
36 ].join(', ')
37 }
38
39 getActorAttributes () {
40 return [
41 `"Account->Actor"."id" AS "Account.Actor.id"`,
42 `"Account->Actor"."type" AS "Account.Actor.type"`,
43 `"Account->Actor"."preferredUsername" AS "Account.Actor.preferredUsername"`,
44 `"Account->Actor"."url" AS "Account.Actor.url"`,
45 `"Account->Actor"."followersCount" AS "Account.Actor.followersCount"`,
46 `"Account->Actor"."followingCount" AS "Account.Actor.followingCount"`,
47 `"Account->Actor"."remoteCreatedAt" AS "Account.Actor.remoteCreatedAt"`,
48 `"Account->Actor"."serverId" AS "Account.Actor.serverId"`,
49 `"Account->Actor"."createdAt" AS "Account.Actor.createdAt"`,
50 `"Account->Actor"."updatedAt" AS "Account.Actor.updatedAt"`
51 ].join(', ')
52 }
53
54 getServerAttributes () {
55 return [
56 `"Account->Actor->Server"."id" AS "Account.Actor.Server.id"`,
57 `"Account->Actor->Server"."host" AS "Account.Actor.Server.host"`,
58 `"Account->Actor->Server"."redundancyAllowed" AS "Account.Actor.Server.redundancyAllowed"`,
59 `"Account->Actor->Server"."createdAt" AS "Account.Actor.Server.createdAt"`,
60 `"Account->Actor->Server"."updatedAt" AS "Account.Actor.Server.updatedAt"`
61 ].join(', ')
62 }
63
64 getAvatarAttributes () {
65 return [
66 `"Account->Actor->Avatars"."id" AS "Account.Actor.Avatars.id"`,
67 `"Account->Actor->Avatars"."filename" AS "Account.Actor.Avatars.filename"`,
68 `"Account->Actor->Avatars"."height" AS "Account.Actor.Avatars.height"`,
69 `"Account->Actor->Avatars"."width" AS "Account.Actor.Avatars.width"`,
70 `"Account->Actor->Avatars"."fileUrl" AS "Account.Actor.Avatars.fileUrl"`,
71 `"Account->Actor->Avatars"."onDisk" AS "Account.Actor.Avatars.onDisk"`,
72 `"Account->Actor->Avatars"."type" AS "Account.Actor.Avatars.type"`,
73 `"Account->Actor->Avatars"."actorId" AS "Account.Actor.Avatars.actorId"`,
74 `"Account->Actor->Avatars"."createdAt" AS "Account.Actor.Avatars.createdAt"`,
75 `"Account->Actor->Avatars"."updatedAt" AS "Account.Actor.Avatars.updatedAt"`
76 ].join(', ')
77 }
78}