From bb2d76ffa362dd0fb032d5faf975661b1c9a26f7 Mon Sep 17 00:00:00 2001 From: syuilo Date: Sat, 29 Jun 2019 23:12:00 +0900 Subject: Fix #4926 --- src/db/postgre.ts | 90 ++++++++++++++++++++++++++++--------------------------- 1 file changed, 46 insertions(+), 44 deletions(-) (limited to 'src/db') diff --git a/src/db/postgre.ts b/src/db/postgre.ts index c91cd8e1d7..925e3fcbfc 100644 --- a/src/db/postgre.ts +++ b/src/db/postgre.ts @@ -80,6 +80,51 @@ class MyCustomLogger implements Logger { } } +export const entities = [ + Meta, + Instance, + App, + AuthSession, + AccessToken, + User, + UserProfile, + UserKeypair, + UserPublickey, + UserList, + UserListJoining, + UserGroup, + UserGroupJoining, + UserGroupInvite, + UserNotePining, + Following, + FollowRequest, + Muting, + Blocking, + Note, + NoteFavorite, + NoteReaction, + NoteWatching, + NoteUnread, + Page, + PageLike, + Log, + DriveFile, + DriveFolder, + Poll, + PollVote, + Notification, + Emoji, + Hashtag, + SwSubscription, + AbuseUserReport, + RegistrationTicket, + MessagingMessage, + Signin, + ReversiGame, + ReversiMatching, + ...charts as any +]; + export function initDb(justBorrow = false, sync = false, log = false) { try { const conn = getConnection(); @@ -110,49 +155,6 @@ export function initDb(justBorrow = false, sync = false, log = false) { } : false, logging: log, logger: log ? new MyCustomLogger() : undefined, - entities: [ - Meta, - Instance, - App, - AuthSession, - AccessToken, - User, - UserProfile, - UserKeypair, - UserPublickey, - UserList, - UserListJoining, - UserGroup, - UserGroupJoining, - UserGroupInvite, - UserNotePining, - Following, - FollowRequest, - Muting, - Blocking, - Note, - NoteFavorite, - NoteReaction, - NoteWatching, - NoteUnread, - Page, - PageLike, - Log, - DriveFile, - DriveFolder, - Poll, - PollVote, - Notification, - Emoji, - Hashtag, - SwSubscription, - AbuseUserReport, - RegistrationTicket, - MessagingMessage, - Signin, - ReversiGame, - ReversiMatching, - ...charts as any - ] + entities: entities }); } -- cgit v1.2.3-freya