From 534655c66d7b95c0312c46e683cd6fe4a3908525 Mon Sep 17 00:00:00 2001 From: Natty Date: Sun, 9 Jul 2023 19:40:13 +0200 Subject: [PATCH] Not gonna need the migrations anymore either --- CALCKEY.md | 169 -- CONTRIBUTING.md | 276 ---- Dockerfile | 2 +- README.md | 197 +-- SECURITY.md | 16 - docs/api-doc.md | 5 - docs/development.md | 108 -- docs/docker.md | 48 - docs/migrate.md | 103 -- docs/mkv13.patch | 45 - docs/mkv13_restore.patch | 127 -- docs/renote_muting.patch | 23 - package.json | 4 - .../backend/migration/1000000000000-Init.js | 1068 ------------ .../backend/migration/1556348509290-Pages.js | 50 - .../migration/1556746559567-UserProfile.js | 21 - .../migration/1557476068003-PinnedUsers.js | 10 - .../migration/1557761316509-AddSomeUrls.js | 18 - .../1557932705754-ObjectStorageSetting.js | 66 - .../migration/1558072954435-PageLike.js | 34 - .../migration/1558103093633-UserGroup.js | 82 - .../1558257926829-UserGroupInvite.js | 38 - .../1558266512381-UserListJoining.js | 10 - .../migration/1561706992953-webauthn.js | 48 - .../migration/1561873850023-ChartIndexes.js | 376 ----- .../1562422242907-PasswordLessLogin.js | 12 - .../migration/1562444565093-PinnedPage.js | 24 - .../1562448332510-PageTitleHideOption.js | 12 - .../migration/1562869971568-ModerationLog.js | 20 - .../migration/1563757595828-UsedUsername.js | 10 - .../backend/migration/1565634203341-room.js | 10 - .../1571220798684-CustomEmojiCategory.js | 14 - .../migration/1572760203493-nodeinfo.js | 78 - .../1576269851876-TalkFederationId.js | 17 - .../1576869585998-ProxyRemoteFiles.js | 17 - .../backend/migration/1579267006611-v12.js | 91 - .../backend/migration/1579270193251-v12-2.js | 17 - .../backend/migration/1579282808087-v12-3.js | 17 - .../backend/migration/1579544426412-v12-4.js | 25 - .../backend/migration/1579977526288-v12-5.js | 156 -- .../backend/migration/1579993013959-v12-6.js | 33 - .../backend/migration/1580069531114-v12-7.js | 51 - .../backend/migration/1580148575182-v12-8.js | 25 - .../backend/migration/1580154400017-v12-9.js | 17 - .../backend/migration/1580276619901-v12-10.js | 31 - .../backend/migration/1580331224276-v12-11.js | 33 - .../backend/migration/1580508795118-v12-12.js | 145 -- .../backend/migration/1580543501339-v12-13.js | 14 - .../backend/migration/1580864313253-v12-14.js | 41 - .../1581526429287-user-group-invitation.js | 107 -- .../1581695816408-user-group-antenna.js | 67 - ...581708415836-drive-user-folder-id-index.js | 17 - .../backend/migration/1581979837262-promo.js | 67 - .../1582019042083-featured-injecttion.js | 17 - .../1582210532752-antenna-exclude.js | 17 - .../1582875306439-note-reaction-length.js | 17 - .../backend/migration/1585361548360-miauth.js | 105 -- .../1585385921215-custom-notification.js | 150 -- .../backend/migration/1585772678853-ap-url.js | 14 - .../1586624197029-AddObjectStorageUseProxy.js | 17 - .../1586641139527-remote-reaction.js | 17 - .../migration/1586708940386-pageAiScript.js | 17 - .../migration/1588044505511-hCaptcha.js | 33 - .../migration/1589023282116-pubRelay.js | 27 - .../migration/1595075960584-blurhash.js | 13 - ...595077605646-blurhash-for-avatar-banner.js | 25 - .../1595676934834-instance-icon-url.js | 13 - .../migration/1595771249699-word-mute.js | 53 - .../migration/1595782306083-word-mute2.js | 21 - .../migration/1596548170836-channel.js | 115 -- .../migration/1596786425167-channel2.js | 15 - ...597230137744-objectStorageSetPublicRead.js | 15 - ...597236229720-IncludingNotificationTypes.js | 21 - .../1597385880794-add-sensitive-index.js | 13 - .../migration/1597459042300-channel-unread.js | 44 - .../1597893996136-ChannelNoteIdDescIndex.js | 17 - .../1600353287890-mutingNotificationTypes.js | 33 - .../1603094348345-refine-abuse-user-report.js | 63 - ...1603095701770-refine-abuse-user-report2.js | 29 - .../1603776877564-instance-theme-color.js | 13 - .../1603781553011-instance-favicon.js | 13 - .../1604821689616-delete-auto-watch.js | 15 - .../1605408848373-clip-description.js | 13 - .../migration/1605408971051-comments.js | 1067 ------------ .../1605585339718-instance-pinned-pages.js | 13 - .../1605965516823-instance-images.js | 19 - .../migration/1606191203881-no-crawle.js | 21 - .../1607151207216-instance-pinned-clip.js | 13 - .../migration/1607353487793-isExplorable.js | 23 - .../migration/1610277136869-registry.js | 31 - .../migration/1610277585759-registry2.js | 19 - .../migration/1610283021566-registry3.js | 15 - .../migration/1611354329133-followersUri.js | 19 - .../migration/1611397665007-gallery.js | 71 - ...547387175-objectStorageS3ForcePathStyle.js | 15 - .../1612619156584-announcement-email.js | 15 - .../1613155914446-emailNotificationTypes.js | 15 - .../migration/1613181457597-user-lang.js | 13 - ...1613503367223-use-bigint-for-driveUsage.js | 16 - .../migration/1615965918224-chart-v2.js | 508 ------ .../migration/1615966519402-chart-v2-2.js | 39 - .../1618637372000-user-last-active-date.js | 17 - .../1618639857000-user-hide-online-status.js | 15 - .../migration/1619942102890-password-reset.js | 27 - .../backend/migration/1620019354680-ad.js | 21 - .../backend/migration/1620364649428-ad2.js | 13 - .../1621479946000-add-note-indexes.js | 22 - ...9304522-user-profile-description-length.js | 17 - .../1622681548499-log-message-length.js | 17 - .../1626509500668-fix-remote-file-proxy.js | 31 - .../1626733991004-allowlist-secure-mode.js | 20 - .../migration/1629004542760-chart-reindex.js | 357 ---- .../1629024377804-deepl-integration.js | 13 - .../1629288472000-fix-channel-userId.js | 15 - .../1629512953000-user-is-deleted.js | 16 - .../1629778475000-deepl-integration2.js | 13 - .../1629833361000-AddShowTLReplies.js | 18 - .../1629968054000_userInstanceBlocks.js | 18 - ...1633068642000-email-required-for-signup.js | 15 - .../migration/1633071909016-user-pending.js | 17 - .../1634486652000-user-public-reactions.js | 15 - .../migration/1634902659689-delete-log.js | 9 - .../1635500777168-note-thread-mute.js | 47 - .../migration/1636197624383-ff-visibility.js | 21 - .../1636697408073-remove-via-mobile.js | 13 - .../1637320813000-forwarded-report.js | 15 - .../migration/1639325650583-chart-v3.js | 511 ------ .../migration/1642611822809-emoji-url.js | 19 - ...1642613870898-drive-file-webpublic-type.js | 15 - .../migration/1643963705770-chart-v4.js | 165 -- .../migration/1643966656277-chart-v5.js | 57 - .../migration/1643967331284-chart-v6.js | 1005 ----------- .../1644010796173-convert-hard-mutes.js | 70 - .../migration/1644058404077-chart-v7.js | 1470 ----------------- .../migration/1644059847460-chart-v8.js | 46 - .../migration/1644060125705-chart-v9.js | 46 - .../migration/1644073149413-chart-v10.js | 77 - .../migration/1644095659741-chart-v11.js | 249 --- .../migration/1644328606241-chart-v12.js | 57 - .../migration/1644331238153-chart-v13.js | 33 - .../migration/1644344266289-chart-v14.js | 117 -- .../1644395759931-instance-theme-color.js | 13 - .../migration/1644481657998-chart-v15.js | 69 - .../1644551208096-following-indexes.js | 21 - ...45340161439-remove-max-note-text-length.js | 15 - .../1645599900873-federation-chart-pubsub.js | 21 - .../1646143552768-instance-default-theme.js | 21 - .../1646387162108-mute-expires-at.js | 19 - .../1646549089451-poll-ended-notification.js | 29 - .../1646633030285-chart-federation-active.js | 21 - ...655454495-remove-instance-drive-columns.js | 17 - ...2390560-chart-federation-active-sub-pub.js | 45 - .../migration/1648548247382-webhook.js | 37 - .../migration/1648816172177-webhook-2.js | 15 - .../migration/1651224615271-foreign-key.js | 187 --- .../1652859567549-uniform-themecolor.js | 51 - .../migration/1655368940105-nsfw-detection.js | 51 - .../1655371960534-nsfw-detection-2.js | 27 - .../1655388169582-nsfw-detection-3.js | 45 - .../1655393015659-nsfw-detection-4.js | 57 - .../1655813815729-driveCapacityOverrideMb.js | 21 - .../migration/1655918165614-user-ip.js | 31 - .../migration/1656122560740-file-ip.js | 19 - .../1656251734807-nsfw-detection-5.js | 79 - .../backend/migration/1656328812281-ip-2.js | 19 - .../1656408772602-nsfw-detection-6.js | 15 - .../1656772790599-user-moderation-note.js | 15 - .../1657346559800-active-email-validation.js | 15 - .../backend/migration/1658203170545calckey.js | 27 - .../1658656633972-note-replies-function.js | 52 - .../migration/1658939464003CustomMOTD.js | 10 - .../1658941974648CustomSplashIcons.js | 12 - .../migration/1658981842728FixCalckey.js | 27 - .../1659042130648RecommendedTimeline.js | 19 - .../migration/1660068273737GuestTimeline.js | 13 - .../1665091090561-add-renote-muting.js | 22 - .../migration/1668828368510PageDraft.js | 10 - .../migration/1668831378728FixCalckeyAgain.js | 15 - ...6634-whetherPushNotifyToSendReadMessage.js | 15 - .../1669288094000-AddMovedToAndKnownAs.js | 21 - ...ddFkAbuseUserReportTargetUserIdToUserId.js | 18 - .../1671388343000-CalckeyRepoMove.js | 23 - .../1672882664294-DefaultReaction.js | 16 - .../1673336077243-PollChoiceLength.js | 15 - .../1676093997212-AntennaInstances.js | 27 - .../migration/1677935903517-DriveComment.js | 15 - ...678945242650-add-props-for-custom-emoji.js | 13 - .../migration/1679269929000-fix-repo.js | 21 - .../migration/1680375641101-clean-charts.js | 25 - .../migration/1680426269172-SpeakAsCat.js | 20 - .../migration/1682753227899-NoteEdit.js | 53 - .../migration/1682777547198-LibreTranslate.js | 23 - .../1682891890317-InstanceSilence.js | 13 - .../migration/1682891891317-AddHiddenPosts.js | 15 - .../1683682889948-PreventAiLearning.js | 15 - .../1683980686995-ExperimentalFeatures.js | 16 - ...684206886988-remove-showTimelineReplies.js | 15 - .../migration/1684494870830-EmojiSize.js | 19 - packages/backend/ormconfig.js | 6 +- packages/backend/package.json | 2 - packages/backend/src/db/postgre.ts | 161 +- 201 files changed, 104 insertions(+), 13403 deletions(-) delete mode 100644 CALCKEY.md delete mode 100644 CONTRIBUTING.md delete mode 100644 SECURITY.md delete mode 100644 docs/api-doc.md delete mode 100644 docs/development.md delete mode 100644 docs/docker.md delete mode 100644 docs/migrate.md delete mode 100644 docs/mkv13.patch delete mode 100644 docs/mkv13_restore.patch delete mode 100644 docs/renote_muting.patch delete mode 100644 packages/backend/migration/1000000000000-Init.js delete mode 100644 packages/backend/migration/1556348509290-Pages.js delete mode 100644 packages/backend/migration/1556746559567-UserProfile.js delete mode 100644 packages/backend/migration/1557476068003-PinnedUsers.js delete mode 100644 packages/backend/migration/1557761316509-AddSomeUrls.js delete mode 100644 packages/backend/migration/1557932705754-ObjectStorageSetting.js delete mode 100644 packages/backend/migration/1558072954435-PageLike.js delete mode 100644 packages/backend/migration/1558103093633-UserGroup.js delete mode 100644 packages/backend/migration/1558257926829-UserGroupInvite.js delete mode 100644 packages/backend/migration/1558266512381-UserListJoining.js delete mode 100644 packages/backend/migration/1561706992953-webauthn.js delete mode 100644 packages/backend/migration/1561873850023-ChartIndexes.js delete mode 100644 packages/backend/migration/1562422242907-PasswordLessLogin.js delete mode 100644 packages/backend/migration/1562444565093-PinnedPage.js delete mode 100644 packages/backend/migration/1562448332510-PageTitleHideOption.js delete mode 100644 packages/backend/migration/1562869971568-ModerationLog.js delete mode 100644 packages/backend/migration/1563757595828-UsedUsername.js delete mode 100644 packages/backend/migration/1565634203341-room.js delete mode 100644 packages/backend/migration/1571220798684-CustomEmojiCategory.js delete mode 100644 packages/backend/migration/1572760203493-nodeinfo.js delete mode 100644 packages/backend/migration/1576269851876-TalkFederationId.js delete mode 100644 packages/backend/migration/1576869585998-ProxyRemoteFiles.js delete mode 100644 packages/backend/migration/1579267006611-v12.js delete mode 100644 packages/backend/migration/1579270193251-v12-2.js delete mode 100644 packages/backend/migration/1579282808087-v12-3.js delete mode 100644 packages/backend/migration/1579544426412-v12-4.js delete mode 100644 packages/backend/migration/1579977526288-v12-5.js delete mode 100644 packages/backend/migration/1579993013959-v12-6.js delete mode 100644 packages/backend/migration/1580069531114-v12-7.js delete mode 100644 packages/backend/migration/1580148575182-v12-8.js delete mode 100644 packages/backend/migration/1580154400017-v12-9.js delete mode 100644 packages/backend/migration/1580276619901-v12-10.js delete mode 100644 packages/backend/migration/1580331224276-v12-11.js delete mode 100644 packages/backend/migration/1580508795118-v12-12.js delete mode 100644 packages/backend/migration/1580543501339-v12-13.js delete mode 100644 packages/backend/migration/1580864313253-v12-14.js delete mode 100644 packages/backend/migration/1581526429287-user-group-invitation.js delete mode 100644 packages/backend/migration/1581695816408-user-group-antenna.js delete mode 100644 packages/backend/migration/1581708415836-drive-user-folder-id-index.js delete mode 100644 packages/backend/migration/1581979837262-promo.js delete mode 100644 packages/backend/migration/1582019042083-featured-injecttion.js delete mode 100644 packages/backend/migration/1582210532752-antenna-exclude.js delete mode 100644 packages/backend/migration/1582875306439-note-reaction-length.js delete mode 100644 packages/backend/migration/1585361548360-miauth.js delete mode 100644 packages/backend/migration/1585385921215-custom-notification.js delete mode 100644 packages/backend/migration/1585772678853-ap-url.js delete mode 100644 packages/backend/migration/1586624197029-AddObjectStorageUseProxy.js delete mode 100644 packages/backend/migration/1586641139527-remote-reaction.js delete mode 100644 packages/backend/migration/1586708940386-pageAiScript.js delete mode 100644 packages/backend/migration/1588044505511-hCaptcha.js delete mode 100644 packages/backend/migration/1589023282116-pubRelay.js delete mode 100644 packages/backend/migration/1595075960584-blurhash.js delete mode 100644 packages/backend/migration/1595077605646-blurhash-for-avatar-banner.js delete mode 100644 packages/backend/migration/1595676934834-instance-icon-url.js delete mode 100644 packages/backend/migration/1595771249699-word-mute.js delete mode 100644 packages/backend/migration/1595782306083-word-mute2.js delete mode 100644 packages/backend/migration/1596548170836-channel.js delete mode 100644 packages/backend/migration/1596786425167-channel2.js delete mode 100644 packages/backend/migration/1597230137744-objectStorageSetPublicRead.js delete mode 100644 packages/backend/migration/1597236229720-IncludingNotificationTypes.js delete mode 100644 packages/backend/migration/1597385880794-add-sensitive-index.js delete mode 100644 packages/backend/migration/1597459042300-channel-unread.js delete mode 100644 packages/backend/migration/1597893996136-ChannelNoteIdDescIndex.js delete mode 100644 packages/backend/migration/1600353287890-mutingNotificationTypes.js delete mode 100644 packages/backend/migration/1603094348345-refine-abuse-user-report.js delete mode 100644 packages/backend/migration/1603095701770-refine-abuse-user-report2.js delete mode 100644 packages/backend/migration/1603776877564-instance-theme-color.js delete mode 100644 packages/backend/migration/1603781553011-instance-favicon.js delete mode 100644 packages/backend/migration/1604821689616-delete-auto-watch.js delete mode 100644 packages/backend/migration/1605408848373-clip-description.js delete mode 100644 packages/backend/migration/1605408971051-comments.js delete mode 100644 packages/backend/migration/1605585339718-instance-pinned-pages.js delete mode 100644 packages/backend/migration/1605965516823-instance-images.js delete mode 100644 packages/backend/migration/1606191203881-no-crawle.js delete mode 100644 packages/backend/migration/1607151207216-instance-pinned-clip.js delete mode 100644 packages/backend/migration/1607353487793-isExplorable.js delete mode 100644 packages/backend/migration/1610277136869-registry.js delete mode 100644 packages/backend/migration/1610277585759-registry2.js delete mode 100644 packages/backend/migration/1610283021566-registry3.js delete mode 100644 packages/backend/migration/1611354329133-followersUri.js delete mode 100644 packages/backend/migration/1611397665007-gallery.js delete mode 100644 packages/backend/migration/1611547387175-objectStorageS3ForcePathStyle.js delete mode 100644 packages/backend/migration/1612619156584-announcement-email.js delete mode 100644 packages/backend/migration/1613155914446-emailNotificationTypes.js delete mode 100644 packages/backend/migration/1613181457597-user-lang.js delete mode 100644 packages/backend/migration/1613503367223-use-bigint-for-driveUsage.js delete mode 100644 packages/backend/migration/1615965918224-chart-v2.js delete mode 100644 packages/backend/migration/1615966519402-chart-v2-2.js delete mode 100644 packages/backend/migration/1618637372000-user-last-active-date.js delete mode 100644 packages/backend/migration/1618639857000-user-hide-online-status.js delete mode 100644 packages/backend/migration/1619942102890-password-reset.js delete mode 100644 packages/backend/migration/1620019354680-ad.js delete mode 100644 packages/backend/migration/1620364649428-ad2.js delete mode 100644 packages/backend/migration/1621479946000-add-note-indexes.js delete mode 100644 packages/backend/migration/1622679304522-user-profile-description-length.js delete mode 100644 packages/backend/migration/1622681548499-log-message-length.js delete mode 100644 packages/backend/migration/1626509500668-fix-remote-file-proxy.js delete mode 100644 packages/backend/migration/1626733991004-allowlist-secure-mode.js delete mode 100644 packages/backend/migration/1629004542760-chart-reindex.js delete mode 100644 packages/backend/migration/1629024377804-deepl-integration.js delete mode 100644 packages/backend/migration/1629288472000-fix-channel-userId.js delete mode 100644 packages/backend/migration/1629512953000-user-is-deleted.js delete mode 100644 packages/backend/migration/1629778475000-deepl-integration2.js delete mode 100644 packages/backend/migration/1629833361000-AddShowTLReplies.js delete mode 100644 packages/backend/migration/1629968054000_userInstanceBlocks.js delete mode 100644 packages/backend/migration/1633068642000-email-required-for-signup.js delete mode 100644 packages/backend/migration/1633071909016-user-pending.js delete mode 100644 packages/backend/migration/1634486652000-user-public-reactions.js delete mode 100644 packages/backend/migration/1634902659689-delete-log.js delete mode 100644 packages/backend/migration/1635500777168-note-thread-mute.js delete mode 100644 packages/backend/migration/1636197624383-ff-visibility.js delete mode 100644 packages/backend/migration/1636697408073-remove-via-mobile.js delete mode 100644 packages/backend/migration/1637320813000-forwarded-report.js delete mode 100644 packages/backend/migration/1639325650583-chart-v3.js delete mode 100644 packages/backend/migration/1642611822809-emoji-url.js delete mode 100644 packages/backend/migration/1642613870898-drive-file-webpublic-type.js delete mode 100644 packages/backend/migration/1643963705770-chart-v4.js delete mode 100644 packages/backend/migration/1643966656277-chart-v5.js delete mode 100644 packages/backend/migration/1643967331284-chart-v6.js delete mode 100644 packages/backend/migration/1644010796173-convert-hard-mutes.js delete mode 100644 packages/backend/migration/1644058404077-chart-v7.js delete mode 100644 packages/backend/migration/1644059847460-chart-v8.js delete mode 100644 packages/backend/migration/1644060125705-chart-v9.js delete mode 100644 packages/backend/migration/1644073149413-chart-v10.js delete mode 100644 packages/backend/migration/1644095659741-chart-v11.js delete mode 100644 packages/backend/migration/1644328606241-chart-v12.js delete mode 100644 packages/backend/migration/1644331238153-chart-v13.js delete mode 100644 packages/backend/migration/1644344266289-chart-v14.js delete mode 100644 packages/backend/migration/1644395759931-instance-theme-color.js delete mode 100644 packages/backend/migration/1644481657998-chart-v15.js delete mode 100644 packages/backend/migration/1644551208096-following-indexes.js delete mode 100644 packages/backend/migration/1645340161439-remove-max-note-text-length.js delete mode 100644 packages/backend/migration/1645599900873-federation-chart-pubsub.js delete mode 100644 packages/backend/migration/1646143552768-instance-default-theme.js delete mode 100644 packages/backend/migration/1646387162108-mute-expires-at.js delete mode 100644 packages/backend/migration/1646549089451-poll-ended-notification.js delete mode 100644 packages/backend/migration/1646633030285-chart-federation-active.js delete mode 100644 packages/backend/migration/1646655454495-remove-instance-drive-columns.js delete mode 100644 packages/backend/migration/1646732390560-chart-federation-active-sub-pub.js delete mode 100644 packages/backend/migration/1648548247382-webhook.js delete mode 100644 packages/backend/migration/1648816172177-webhook-2.js delete mode 100644 packages/backend/migration/1651224615271-foreign-key.js delete mode 100644 packages/backend/migration/1652859567549-uniform-themecolor.js delete mode 100644 packages/backend/migration/1655368940105-nsfw-detection.js delete mode 100644 packages/backend/migration/1655371960534-nsfw-detection-2.js delete mode 100644 packages/backend/migration/1655388169582-nsfw-detection-3.js delete mode 100644 packages/backend/migration/1655393015659-nsfw-detection-4.js delete mode 100644 packages/backend/migration/1655813815729-driveCapacityOverrideMb.js delete mode 100644 packages/backend/migration/1655918165614-user-ip.js delete mode 100644 packages/backend/migration/1656122560740-file-ip.js delete mode 100644 packages/backend/migration/1656251734807-nsfw-detection-5.js delete mode 100644 packages/backend/migration/1656328812281-ip-2.js delete mode 100644 packages/backend/migration/1656408772602-nsfw-detection-6.js delete mode 100644 packages/backend/migration/1656772790599-user-moderation-note.js delete mode 100644 packages/backend/migration/1657346559800-active-email-validation.js delete mode 100644 packages/backend/migration/1658203170545calckey.js delete mode 100644 packages/backend/migration/1658656633972-note-replies-function.js delete mode 100644 packages/backend/migration/1658939464003CustomMOTD.js delete mode 100644 packages/backend/migration/1658941974648CustomSplashIcons.js delete mode 100644 packages/backend/migration/1658981842728FixCalckey.js delete mode 100644 packages/backend/migration/1659042130648RecommendedTimeline.js delete mode 100644 packages/backend/migration/1660068273737GuestTimeline.js delete mode 100644 packages/backend/migration/1665091090561-add-renote-muting.js delete mode 100644 packages/backend/migration/1668828368510PageDraft.js delete mode 100644 packages/backend/migration/1668831378728FixCalckeyAgain.js delete mode 100644 packages/backend/migration/1669138716634-whetherPushNotifyToSendReadMessage.js delete mode 100644 packages/backend/migration/1669288094000-AddMovedToAndKnownAs.js delete mode 100644 packages/backend/migration/1671199573000-AddFkAbuseUserReportTargetUserIdToUserId.js delete mode 100644 packages/backend/migration/1671388343000-CalckeyRepoMove.js delete mode 100644 packages/backend/migration/1672882664294-DefaultReaction.js delete mode 100644 packages/backend/migration/1673336077243-PollChoiceLength.js delete mode 100644 packages/backend/migration/1676093997212-AntennaInstances.js delete mode 100644 packages/backend/migration/1677935903517-DriveComment.js delete mode 100644 packages/backend/migration/1678945242650-add-props-for-custom-emoji.js delete mode 100644 packages/backend/migration/1679269929000-fix-repo.js delete mode 100644 packages/backend/migration/1680375641101-clean-charts.js delete mode 100644 packages/backend/migration/1680426269172-SpeakAsCat.js delete mode 100644 packages/backend/migration/1682753227899-NoteEdit.js delete mode 100644 packages/backend/migration/1682777547198-LibreTranslate.js delete mode 100644 packages/backend/migration/1682891890317-InstanceSilence.js delete mode 100644 packages/backend/migration/1682891891317-AddHiddenPosts.js delete mode 100644 packages/backend/migration/1683682889948-PreventAiLearning.js delete mode 100644 packages/backend/migration/1683980686995-ExperimentalFeatures.js delete mode 100644 packages/backend/migration/1684206886988-remove-showTimelineReplies.js delete mode 100644 packages/backend/migration/1684494870830-EmojiSize.js diff --git a/CALCKEY.md b/CALCKEY.md deleted file mode 100644 index 5a8bbd8ff7..0000000000 --- a/CALCKEY.md +++ /dev/null @@ -1,169 +0,0 @@ -# All the changes to Calckey from stock Misskey - -> **Warning** -> This list is incomplete. Please check the [Releases](https://codeberg.org/calckey/calckey/releases) and [Changelog](https://codeberg.org/calckey/calckey/src/branch/develop/CHANGELOG.md) for a more complete list of changes. There have been [>4000 commits (laggy link)](https://codeberg.org/calckey/calckey/compare/700a7110f7e34f314b070987aa761c451ec34efc...develop) since we forked Misskey! - -## Planned - -- Stucture - - [DragonflyDB](https://dragonflydb.io/) support as a Redis alternative - - Optionally use [ScyllaDB](https://www.scylladb.com/open-source-nosql-database/) for storing notes - - Rewrite backend in Rust and [Rocket](https://rocket.rs/) - - Use [Magic RegExP](https://regexp.dev/) for RegEx 🦄 -- Function - - User "choices" (recommended users) and featured hashtags like Mastodon and Soapbox - - Join Reason system like Mastodon/Pleroma - - Option to publicize server blocks - - More antenna options - - Groups -- Form - - Lookup/details for post/file/server - - [Rat mode?](https://stop.voring.me/notes/933fx97bmd) - -## Work in progress - -- Link verification -- Better Messaging UI -- Better API Documentation -- Remote follow button -- Improve accesibility -- Timeline filters -- Events -- Fully revamp non-logged-in screen - -## Implemented - -- A lot of general bugfixes -- pnpm instead of yarn - - Fix Dockerfile @hanna - - Upgrade packages with security vunrabilities -- Saner defaults -- Fediverse account migration -- Recommended servers timeline -- OCR image captioning -- Improve mobile UX - - Swipe through pages on mobile - - Redesigned mobile bottom nav bar - - Post button on TL -- Star as default reaction -- Like/star button -- Rosé Pine by default (+ non-themable elements made Rosé Pine) -- Better sidebar/navbar -- Better intro tutorial/onboarding -- Add back groups - - Integrate groups UI into chats UI -- MOTD (customizable by admins!) -- Custom randomized splash icons -- Self hosted, newly designed error images - - Illustrated by [Henki](https://www.youtube.com/c/Henkiwashere)! - - Licensed under the CC-BY-SA 4.0. -- Better timeline top bar -- Improved note style - - Make more of the post clickable like every other SNS - - No more details tag for reply attachments - - Better CW button -- Mark as read from notifications widget -- Less cluttered notification summary -- Better welcome screen (not logged in) -- vue-plyr as video/audio player -- Ability to turn off "Connection lost" message -- Raw server info only for moderators -- New spinner animation -- Spinner instead of "Loading..." -- Always signToActivityPubGet -- Spacing on group items -- Quotes have solid border -- Reply limit bug fixed -- Make showing the update popup optional -- Improve PWA manifest -- Fix incoming chat scrolling globally -- Update notifier -- Allow admins to set logo URL via admin settings -- Allow importing follows from Pixelfed -- Phosphor icons instead of FontAwesome -- Fully deprecate MkEmojiPickerWindow in favor of MkEmojiPickerDialog -- Link hover effect -- Replace all `$ts` with i18n -- AVIF support -- Page drafts -- Patron list -- Animations respect reduced motion -- Undo renote button inside original note -- Custom locales -- Obliteration of Ai-chan -- Switch to [Calckey.js](https://codeberg.org/calckey/calckey.js) -- Woozy mode 🥴 -- Improve blocking servers -- Release notes -- New post style -- Admins set default reaction emoji - - Allows custom emoji -- Fix lint errors -- Use Rome instead of ESLint -- Mastodon API support -- More antenna options -- New dashboard -- Backfill follower counts -- Compile time compression -- Sonic search -- Popular color schemes, including Nord, Gruvbox, and Catppuccin -- Non-nyaify cat mode -- Post imports from other Calckey/Misskey/Mastodon/Pleroma/Akkoma servers -- Improve Classic mode -- Proper Helm/Kubernetes config -- Multiple boost visibilities -- Improve system emails -- Mod mail -- Focus trapping and button labels -- Meilisearch with filters -- Post editing -- Display remaining time on rate-limits -- Proper 2FA input dialog -- Let moderators see moderation nodes -- Non-mangled unicode emojis - - Skin tone selection support - -## Implemented (remote) - -- MissV: [fix Misskey Forkbomb](https://code.vtopia.live/Vtopia/MissV/commit/40b23c070bd4adbb3188c73546c6c625138fb3c1) -- [Make showing ads optional](https://github.com/misskey-dev/misskey/pull/8996) -- [Tapping avatar in mobile opens account modal](https://github.com/misskey-dev/misskey/pull/9056) -- [OAuth bearer token authentication](https://github.com/misskey-dev/misskey/pull/9021) -- [Styled Repair Tools](https://github.com/misskey-dev/misskey/pull/8956) -- [Option to make enter send message](https://github.com/misskey-dev/misskey/pull/8954) -- [Autocomplete in messaging](https://github.com/misskey-dev/misskey/pull/8955) -- [Profile background as banner](https://codeberg.org/Freeplay/Misskey-Tweaks/src/branch/main/snippets/profile-background.styl) -- [Star is generic like/favorite](https://github.com/JakeMBauer/Misskey-Extras/blob/master/patches/star-is-like.patch) - - 👍 also triggers generic like/favorite -- [Add additional background for acrylic popups if backdrop-filter is unsupported](https://github.com/misskey-dev/misskey/pull/8671) -- [Add parameters to MFM rotate](https://github.com/misskey-dev/misskey/pull/8549) -- Many changes from [Foundkey](https://akkoma.dev/FoundKeyGang/Foundkey) - - https://akkoma.dev/FoundKeyGang/FoundKey/commit/0ece67b04c3f0365057624c1068808276ccab981: refactor pages/auth.form.vue to composition API - - https://akkoma.dev/FoundKeyGang/FoundKey/commit/4bc9610d8bf5af736b5e89e4782395705de45d7d: remove unnecessary joins - - https://akkoma.dev/FoundKeyGang/FoundKey/commit/9ee609d70082f7a6dc119a5d83c0e7c5e1208676: enhance privacy of notes - - https://akkoma.dev/FoundKeyGang/FoundKey/commit/0fec6e10477b1c1b95d9469fbaf4e249a3722f12: remove ms dependency - - https://akkoma.dev/FoundKeyGang/FoundKey/commit/46fff77accbe8bf0fd3cc88170d67b997bf2bdc3: client uses new API for child notes depth - - https://akkoma.dev/FoundKeyGang/FoundKey/commit/c35372a20d22cddb75e93a0b407f2b652cd7faf0: pack children without detail - - https://akkoma.dev/FoundKeyGang/FoundKey/commit/aca724e0bfff3e58b4d273f3ee744e3f3aa9c39b: enable to fetch replies recursively - - https://akkoma.dev/FoundKeyGang/FoundKey/commit/2fe64c11502fd8d89c126558cd715e095c83754e: Refactor components/page/page.textarea.vue to composition API - - https://akkoma.dev/FoundKeyGang/FoundKey/commit/6d3181f9835955e5b79bde5484c74bd70e7f9535: Refactor components/page/page.text.vue to composition API - - https://akkoma.dev/FoundKeyGang/FoundKey/commit/b630cd7eacd695bb705e6748c87f38425ec4ed45: refactor: add NoteReactions.packMany - - https://akkoma.dev/FoundKeyGang/FoundKey/commit/3fe351df6d4e21f7748c46adfa6ca165abd030c0: fix: catch errors from packing with detail - - https://akkoma.dev/FoundKeyGang/FoundKey/commit/63591da33e233b2ed0ab331ae6bb3c9eff5020ae: refactor: colours in queue chart - - https://akkoma.dev/FoundKeyGang/FoundKey/commit/0f6d94f1e7e1f58cfbf8d07e5f835f8de626842e: backend: improve mutes and blocks - - https://akkoma.dev/FoundKeyGang/FoundKey/commit/e2bf2715a6462ed377b033956d65260157f042ea: fix spelling error - - https://akkoma.dev/FoundKeyGang/FoundKey/commit/09a7eabda137e77f81ab31f65d69329670693c8d: backend: fix lint "no-throw-literal" - - https://akkoma.dev/FoundKeyGang/FoundKey/commit/4fbe2e065e75ed3e5b4dfdfd4be3baa03cc447c3: client: fix lint "quotes" - - https://akkoma.dev/FoundKeyGang/FoundKey/commit/585e4f5c42cfafb6cdf7eb601ab435d6a4d85a96: fix textarea not updating properly - - https://akkoma.dev/FoundKeyGang/FoundKey/commit/30d8bc9259cb6b72ed76d67b21dbb4cdceca8327: refactor: welcome.setup.vue to composition api - - https://akkoma.dev/FoundKeyGang/FoundKey/commit/751921e24f37ed707fe44a40d88eebb1299efa35: make emoji picker case insensitive - - https://akkoma.dev/FoundKeyGang/FoundKey/commit/298febeb9c9501e3e3df16982c08657d1da474e0: enhance: add re-collapsing to quoted notes - - https://akkoma.dev/FoundKeyGang/FoundKey/commit/b0fdedb264db87575063abed45e52ad71ce4a6af: fix lints in folder.vue - - https://akkoma.dev/FoundKeyGang/FoundKey/commit/6fed87f85d132304eb84b0a59b84dce299a1822f: fix pagination.vue lints - - https://akkoma.dev/FoundKeyGang/FoundKey/commit/384e8c49b738f576ba8843296de6cebf01c1b247: server: allow to like own gallery posts - - https://akkoma.dev/FoundKeyGang/FoundKey/commit/4c5aa9e53887cca5561fcec6ab0754e018f589a5: server: allow to like own pages - - https://akkoma.dev/FoundKeyGang/FoundKey/commit/923c93da1228458dd65be47483c198a1a9191bcf: use await for notes.countBy - - https://akkoma.dev/FoundKeyGang/FoundKey/commit/ca90cedba0a0704b503c2778694230f5a7dfbace: server: reduce dead instance detection to 7 days - - https://akkoma.dev/FoundKeyGang/FoundKey/commit/e9ab42c10afb4e27516c2d2b5e3e06630efe9edd: Alt text in image viewer - - https://akkoma.dev/FoundKeyGang/FoundKey/commit/ed9d4023d41bba7c4ac53a1a3422246feed37de2: add argon2 support - - https://akkoma.dev/FoundKeyGang/FoundKey/commit/c414f24a2c123774246c7eca65edda4d3afaf8b3: feat: per-user renote muting diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md deleted file mode 100644 index b75dc9f35f..0000000000 --- a/CONTRIBUTING.md +++ /dev/null @@ -1,276 +0,0 @@ -# Contribution guide -We're glad you're interested in contributing Calckey! In this document you will find the information you need to contribute to the project. - -## Translation (i18n) -Calckey uses [Weblate](hhttps://hosted.weblate.org/engage/calckey/) for translation and internationalization management. - -If your language is not listed in Weblate, please open an issue. - -You can contribute without knowing how to code by helping translate here: - -[![Translation status](https://hosted.weblate.org/widgets/calckey/-/287x66-grey.png)](https://hosted.weblate.org/engage/calckey/) - -[![Translation bars](https://hosted.weblate.org/widgets/calckey/-/multi-auto.svg)](https://hosted.weblate.org/engage/calckey/) - -## Roadmap -See [CALCKEY.md](./CALCKEY.md) - -## Issues -Before creating an issue, please check the following: -- To avoid duplication, please search for similar issues before creating a new issue. -- Do not use Issues to ask questions or troubleshooting. - - Issues should only be used to feature requests, suggestions, and bug tracking. - - Please ask questions or troubleshooting in the [Matrix room](https://matrix.to/#/#calckey:matrix.fedibird.com). - -> **Warning** -> Do not close issues that are about to be resolved. It should remain open until a commit that actually resolves it is merged. - -## Before implementation -When you want to add a feature or fix a bug, **first have the design and policy reviewed in an Issue** (if it is not there, please make one). Without this step, there is a high possibility that the PR will not be merged even if it is implemented. - -At this point, you also need to clarify the goals of the PR you will create, and make sure that the other members of the team are aware of them. -PRs that do not have a clear set of do's and don'ts tend to be bloated and difficult to review. - -Also, when you start implementation, assign yourself to the Issue (if you cannot do it yourself, ask another member to assign you). By expressing your intention to work the Issue, you can prevent conflicts in the work. - -## Well-known branches -- The **`main`** branch is tracking the latest release and used for production purposes. -- The **`develop`** branch is where we work for the next release. - - When you create a PR, basically target it to this branch. **But create a different branch** -- The **`l10n_develop`** branch is reserved for localization management. -- **`feature/*`** branches are reserved for the development of a specific feature - -## Creating a PR -Thank you for your PR! Before creating a PR, please check the following: -- If possible, prefix the title with a keyword that identifies the type of this PR, as shown below. - - `fix` / `refactor` / `feat` / `enhance` / `perf` / `chore` etc. You are also welcome to use gitmoji. This is important as we use these to A) easier read the git history and B) generate our changelog. Without propper prefixing it is possible that your PR is rejected. - - Also, make sure that the granularity of this PR is appropriate. Please do not include more than one type of change or interest in a single PR. -- If there is an Issue which will be resolved by this PR, please include a reference to the Issue in the text. Good examples include `Closing: #21` or `Resolves: #21` -- Check if there are any documents that need to be created or updated due to this change. -- If you have added a feature or fixed a bug, please add a test case if possible. -- Please make sure that formatting, tests and Lint are passed in advance. - - You can run it with `pnpm run format`, `pnpm run test` and `pnpm run lint`. [See more info](#testing) -- If this PR includes UI changes, please attach a screenshot in the text. - -Thanks for your cooperation 🤗 - -## Reviewers guide -Be willing to comment on the good points and not just the things you want fixed 💯 - -### Review perspective -- Scope - - Are the goals of the PR clear? - - Is the granularity of the PR appropriate? -- Security - - Does merging this PR create a vulnerability? -- Performance - - Will merging this PR cause unexpected performance degradation? - - Is there a more efficient way? -- Testing - - Does the test ensure the expected behavior? - - Are there any omissions or gaps? - - Does it check for anomalies? - -## Deploy (SOON) -The `/deploy` command by issue comment can be used to deploy the contents of a PR to the preview environment. -``` -/deploy sha= -``` -An actual domain will be assigned so you can test the federation. - -## Merge - -## Release -### Release Instructions -1. Commit version changes in the `develop` branch ([package.json](https://github.com/misskey-dev/misskey/blob/develop/package.json)) -2. Create a release PR. - - Into `master` from `develop` branch. - - The title must be in the format `Release: x.y.z`. - - `x.y.z` is the new version you are trying to release. -3. Deploy and perform a simple QA check. Also verify that the tests passed. -4. Merge it. -5. Create a [release of GitHub](https://github.com/misskey-dev/misskey/releases) - - The target branch must be `master` - - The tag name must be the version - -## Development -During development, it is useful to use the `yarn dev` command. -This command monitors the server-side and client-side source files and automatically builds them if they are modified. -In addition, it will also automatically start the Misskey server process. - - -# THE FOLLOWING IS OUTDATED: - -## Testing -- Test codes are located in [`/test`](/test). - -### Run test -Create a config file. -``` -cp test/test.yml .config/ -``` -Prepare DB/Redis for testing. -``` -docker-compose -f test/docker-compose.yml up -``` -Alternatively, prepare an empty (data can be erased) DB and edit `.config/test.yml`. - -Run all test. -``` -yarn test -``` - -#### Run specify test -``` -TS_NODE_FILES=true TS_NODE_TRANSPILE_ONLY=true TS_NODE_PROJECT="./test/tsconfig.json" yarn dlx mocha test/foo.ts --require ts-node/register -``` - -### e2e tests -TODO - -## Continuous integration -Misskey uses GitHub Actions for executing automated tests. -Configuration files are located in [`/.github/workflows`](/.github/workflows). - -## Vue -Misskey uses Vue(v3) as its front-end framework. -- Use TypeScript. -- **When creating a new component, please use the Composition API (with [setup sugar](https://v3.vuejs.org/api/sfc-script-setup.html) and [ref sugar](https://github.com/vuejs/rfcs/discussions/369)) instead of the Options API.** - - Some of the existing components are implemented in the Options API, but it is an old implementation. Refactors that migrate those components to the Composition API are also welcome. - -## nirax -niraxは、Misskeyで使用しているオリジナルのフロントエンドルーティングシステムです。 -**vue-routerから影響を多大に受けているので、まずはvue-routerについて学ぶことをお勧めします。** - -### ルート定義 -ルート定義は、以下の形式のオブジェクトの配列です。 - -``` ts -{ - name?: string; - path: string; - component: Component; - query?: Record; - loginRequired?: boolean; - hash?: string; - globalCacheKey?: string; - children?: RouteDef[]; -} -``` - -> **Warning** -> 現状、ルートは定義された順に評価されます。 -> たとえば、`/foo/:id`ルート定義の次に`/foo/bar`ルート定義がされていた場合、後者がマッチすることはありません。 - -### 複数のルーター -vue-routerとの最大の違いは、niraxは複数のルーターが存在することを許可している点です。 -これにより、アプリ内ウィンドウでブラウザとは個別にルーティングすることなどが可能になります。 - -## Notes -### How to resolve conflictions occurred at yarn.lock? - -Just execute `yarn` to fix it. - -### INSERTするときにはsaveではなくinsertを使用する -#6441 - -### placeholder -SQLをクエリビルダで組み立てる際、使用するプレースホルダは重複してはならない -例えば -``` ts -query.andWhere(new Brackets(qb => { - for (const type of ps.fileType) { - qb.orWhere(`:type = ANY(note.attachedFileTypes)`, { type: type }); - } -})); -``` -と書くと、ループ中で`type`というプレースホルダが複数回使われてしまいおかしくなる -だから次のようにする必要がある -```ts -query.andWhere(new Brackets(qb => { - for (const type of ps.fileType) { - const i = ps.fileType.indexOf(type); - qb.orWhere(`:type${i} = ANY(note.attachedFileTypes)`, { [`type${i}`]: type }); - } -})); -``` - -### Not `null` in TypeORM -```ts -const foo = await Foos.findOne({ - bar: Not(null) -}); -``` -のようなクエリ(`bar`が`null`ではない)は期待通りに動作しない。 -次のようにします: -```ts -const foo = await Foos.findOne({ - bar: Not(IsNull()) -}); -``` - -### `null` in SQL -SQLを発行する際、パラメータが`null`になる可能性のある場合はSQL文を出し分けなければならない -例えば -``` ts -query.where('file.folderId = :folderId', { folderId: ps.folderId }); -``` -という処理で、`ps.folderId`が`null`だと結果的に`file.folderId = null`のようなクエリが発行されてしまい、これは正しいSQLではないので期待した結果が得られない -だから次のようにする必要がある -``` ts -if (ps.folderId) { - query.where('file.folderId = :folderId', { folderId: ps.folderId }); -} else { - query.where('file.folderId IS NULL'); -} -``` - -### `[]` in SQL -SQLを発行する際、`IN`のパラメータが`[]`(空の配列)になる可能性のある場合はSQL文を出し分けなければならない -例えば -``` ts -const users = await Users.find({ - id: In(userIds) -}); -``` -という処理で、`userIds`が`[]`だと結果的に`user.id IN ()`のようなクエリが発行されてしまい、これは正しいSQLではないので期待した結果が得られない -だから次のようにする必要がある -``` ts -const users = userIds.length > 0 ? await Users.find({ - id: In(userIds) -}) : []; -``` - -### 配列のインデックス in SQL -SQLでは配列のインデックスは**1始まり**。 -`[a, b, c]`の `a`にアクセスしたいなら`[0]`ではなく`[1]`と書く - -### null IN -nullが含まれる可能性のあるカラムにINするときは、そのままだとおかしくなるのでORなどでnullのハンドリングをしよう。 - -### `undefined`にご用心 -MongoDBの時とは違い、findOneでレコードを取得する時に対象レコードが存在しない場合 **`undefined`** が返ってくるので注意。 -MongoDBは`null`で返してきてたので、その感覚で`if (x === null)`とか書くとバグる。代わりに`if (x == null)`と書いてください - -### Migration作成方法 -packages/backendで: -```sh -pnpm dlx typeorm migration:generate -d ormconfig.js -o -``` - -- 生成後、ファイルをmigration下に移してください -- 作成されたスクリプトは不必要な変更を含むため除去してください - -### コネクションには`markRaw`せよ -**Vueのコンポーネントのdataオプションとして**misskey.jsのコネクションを設定するとき、必ず`markRaw`でラップしてください。インスタンスが不必要にリアクティブ化されることで、misskey.js内の処理で不具合が発生するとともに、パフォーマンス上の問題にも繋がる。なお、Composition APIを使う場合はこの限りではない(リアクティブ化はマニュアルなため)。 - -### JSONのimportに気を付けよう -TypeScriptでjsonをimportすると、tscでコンパイルするときにそのjsonファイルも一緒にdistディレクトリに吐き出されてしまう。この挙動により、意図せずファイルの書き換えが発生することがあるので、jsonをimportするときは書き換えられても良いものかどうか確認すること。書き換えされて欲しくない場合は、importで読み込むのではなく、`fs.readFileSync`などの関数を使って読み込むようにすればよい。 - -### コンポーネントのスタイル定義でmarginを持たせない -コンポーネント自身がmarginを設定するのは問題の元となることはよく知られている -marginはそのコンポーネントを使う側が設定する - -## その他 -### HTMLのクラス名で follow という単語は使わない -広告ブロッカーで誤ってブロックされる diff --git a/Dockerfile b/Dockerfile index 73067f0550..40565b8244 100644 --- a/Dockerfile +++ b/Dockerfile @@ -41,4 +41,4 @@ RUN corepack enable && corepack prepare pnpm@latest --activate ENV NODE_ENV=production VOLUME "/calckey/files" ENTRYPOINT [ "/sbin/tini", "--" ] -CMD [ "pnpm", "run", "migrateandstart" ] +CMD [ "pnpm", "run", "start" ] diff --git a/README.md b/README.md index dd1f92836c..96b6754279 100644 --- a/README.md +++ b/README.md @@ -6,13 +6,7 @@ This is a horribly broken fork of Calckey not intended to be run on its own. [![no github badge](https://nogithub.codeberg.page/badge.svg)](https://nogithub.codeberg.page/) -[![status badge](https://ci.codeberg.org/api/badges/calckey/calckey/status.svg)](https://ci.codeberg.org/calckey/calckey) -[![opencollective badge](https://opencollective.com/calckey/tiers/badge.svg)](https://opencollective.com/Calckey) -[![liberapay badge](https://img.shields.io/liberapay/receives/ThatOneCalculator?logo=liberapay)](https://liberapay.com/ThatOneCalculator) -[![translate-badge](https://hosted.weblate.org/widgets/calckey/-/svg-badge.svg)](https://hosted.weblate.org/engage/calckey/) -[![docker badge](https://img.shields.io/docker/pulls/thatonecalculator/calckey?logo=docker)](https://hub.docker.com/r/thatonecalculator/calckey) -[![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-2.1-4baaaa.svg)](./CODE_OF_CONDUCT.md) -[![Codeberg badge](https://custom-icon-badges.demolab.com/badge/hosted%20on-codeberg-4793CC.svg?logo=codeberg&logoColor=white)](https://codeberg.org/calckey/calckey/) +[![status badge](https://ci.astolfo.cool/api/badges/natty/calckey/status.svg)](https://ci.astolfo.cool/natty/calckey) @@ -22,68 +16,17 @@ # ✨ About Calckey -- Calckey is based off of Misskey, a powerful microblogging server on ActivityPub with features such as emoji reactions, a customizable web UI, rich chatting, and much more! -- Calckey adds many quality of life changes and bug fixes for users and server admins alike. -- Read **[this document](./CALCKEY.md)** all for current and future differences. -- Notable differences: - - Improved UI/UX (especially on mobile) - - Post editing - - Content importing - - Improved notifications - - Improved server security - - Improved accessibility - - Improved threads - - Recommended Servers timeline - - OCR image captioning - - New and improved Groups - - Better intro tutorial - - Compatibility with Mastodon clients/apps - - Backfill user information - - Advanced search - - Many more user and admin settings - - [So much more!](./CALCKEY.md) +Please see the [upstream version](https://codeberg.org/calckey/calckey) if you seriously intend to run this project. - +# 🌠 I wanna build this mess anyway -
+My primary way to build this project is using Podman and deploy as a container: -# 🥂 Links +```sh +docker build -t calckey . +``` -### Want to get involved? Great! - -- If you have the means to, [donations](https://opencollective.com/Calckey) are a great way to keep us going. -- If you know how to program in TypeScript, Vue, or Rust, read the [contributing](./CONTRIBUTING.md) document. -- If you know a non-English language, translating Calckey on [Weblate](https://hosted.weblate.org/engage/calckey/) help bring Calckey to more people. No technical experience needed! -- Want to write/report about us, have any professional inquiries, or just have questions to ask? Contact us [here!](https://calckey.org/contact/) - -### All links - -- 🌐 Homepage: -- 💸 Donations: - - OpenCollective: - - Liberapay: - - Donate publicly to get your name on the Patron list! -- 🚢 Flagship server: -- 💁 Matrix support room: -- 📣 Official account: -- 📜 Server list: -- ✍️ Weblate: -- ️️📬 Contact: - -# 🌠 Getting started - -This guide will work for both **starting from scratch** and **migrating from Misskey**. - -## 🔰 Easy installers - -If you have access to a server that supports one of the sources below, I recommend you use it! Note that these methods *won't* allow you to migrate from Misskey without manual intervention. - -[![Install on Ubuntu](https://pool.jortage.com/voringme/misskey/3b62a443-1b44-45cf-8f9e-f1c588f803ed.png)](https://codeberg.org/calckey/ubuntu-bash-install)  [![Install on the Arch User Repository](https://pool.jortage.com/voringme/misskey/ba2a5c07-f078-43f1-8483-2e01acca9c40.png)](https://aur.archlinux.org/packages/calckey)  [![Install Calckey with YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=calckey) - -## 🛳️ Containerization - -- [🐳 How to run Calckey with Docker](https://codeberg.org/calckey/calckey/src/branch/develop/docs/docker.md) -- [🛞 How to run Calckey with Kubernetes/Helm](https://codeberg.org/calckey/calckey/src/branch/develop/docs/kubernetes.md) +Continue reading if you want to build it natively. ## 🧑‍💻 Dependencies @@ -116,7 +59,7 @@ If you have access to a server that supports one of the sources below, I recomme ## 👀 Get folder ready ```sh -git clone https://codeberg.org/calckey/calckey.git +git clone https://git.astolfo.cool/natty/calckey.git cd calckey/ ``` @@ -129,92 +72,29 @@ cd calckey/ # nvm install 19 && nvm use 19 corepack enable corepack prepare pnpm@latest --activate -# To build without TensorFlow, append --no-optional -pnpm i # --no-optional +pnpm i ``` -### pm2 +## Database -To install pm2 run: +This setup assumes you already have a valid PostgreSQL database with +a model corresponding to the Calckey version 14.0.0-RC3. -``` -npm i -g pm2 -pm2 install pm2-logrotate -``` - -> **Note** -> [`pm2-logrotate`](https://github.com/keymetrics/pm2-logrotate/blob/master/README.md) ensures that log files don't infinitely gather size, as Calckey produces a lot of logs. - -## 🐘 Create database - -In PostgreSQL (`psql`), run the following command: - -```sql -CREATE DATABASE calckey WITH encoding = 'UTF8'; -``` - -or run the following from the command line: - -```sh -psql postgres -c "create database calckey with encoding = 'UTF8';" -``` - -In Calckey's directory, fill out the `db` section of `.config/default.yml` with the correct information, where the `db` key is `calckey`. - -## 🔎 Set up search - -### 🦔 Sonic - -Sonic is better suited for self hosters with smaller deployments. It uses almost no resources, barely any any disk space, and is relatively fast. - -Follow sonic's [installation guide](https://github.com/valeriansaliou/sonic#installation) - -> **Note** -> If you use IPv4: in Sonic's directory, edit the `config.cfg` file to change `inet` to `"0.0.0.0:1491"`. - -In Calckey's directory, fill out the `sonic` section of `.config/default.yml` with the correct information. - -### Meilisearch - -Meilisearch is better suited for larger deployments. It's faster but uses far more resources and disk space. - -Follow Meilisearch's [quick start guide](https://www.meilisearch.com/docs/learn/getting_started/quick_start) - -In Calckey's directory, fill out the `meilisearch` section of `.config/default.yml` with the correct information. - -### ElasticSearch - -Please don't use ElasticSearch unless you already have an ElasticSearch setup and want to continue using it for Calckey. ElasticSearch is slow, heavy, and offers very few benefits over Sonic/Meilisearch. - -## 💅 Customize - -- To add custom CSS for all users, edit `./custom/assets/instance.css`. -- To add static assets (such as images for the splash screen), place them in the `./custom/assets/` directory. They'll then be available on `https://yourserver.tld/static-assets/filename.ext`. -- To add custom locales, place them in the `./custom/locales/` directory. If you name your custom locale the same as an existing locale, it will overwrite it. If you give it a unique name, it will be added to the list. Also make sure that the first part of the filename matches the locale you're basing it on. (Example: `en-FOO.yml`) -- To add custom error images, place them in the `./custom/assets/badges` directory, replacing the files already there. -- To add custom sounds, place only mp3 files in the `./custom/assets/sounds` directory. -- To update custom assets without rebuilding, just run `pnpm run gulp`. - -## 🧑‍🔬 Configuring a new server +## Configuring a new server - Run `cp .config/example.yml .config/default.yml` - Edit `.config/default.yml`, making sure to fill out required fields. - Also copy and edit `.config/docker_example.env` to `.config/docker.env` if you're using Docker. -## 🚚 Migrating from Misskey to Calckey +## Running the server -For migrating from Misskey v13, Misskey v12, and Foundkey, read [this document](https://codeberg.org/calckey/calckey/src/branch/develop/docs/migrate.md). +```sh +pnpm run start +``` -## 🌐 Web proxy +## Web proxy -### 🍀 Nginx (recommended) - -- Run `sudo cp ./calckey.nginx.conf /etc/nginx/sites-available/ && cd /etc/nginx/sites-available/` -- Edit `calckey.nginx.conf` to reflect your server properly -- Run `sudo ln -s ./calckey.nginx.conf ../sites-enabled/calckey.nginx.conf` -- Run `sudo nginx -t` to validate that the config is valid, then restart the NGINX service. - -### 🦦 Caddy +### Caddy - Add the following block to your `Caddyfile`, replacing `example.tld` with your own domain: ```caddy @@ -223,40 +103,3 @@ example.tld { } ``` - Reload your caddy configuration - -### 🪶 Apache - -> **Warning** -> Apache has some known problems with Calckey. Only use it if you have to. - -- Run `sudo cp ./calckey.apache.conf /etc/apache2/sites-available/ && cd /etc/apache2/sites-available/` -- Edit `calckey.apache.conf` to reflect your server properly -- Run `sudo a2ensite calckey.apache` to enable the site -- Run `sudo service apache2 restart` to reload apache2 configuration -## 🚀 Build and launch! - -### 🐢 NodeJS + pm2 - -#### `git pull` and run these steps to update Calckey in the future! - -```sh -# git pull -pnpm install -NODE_ENV=production pnpm run build && pnpm run migrate -pm2 start "NODE_ENV=production pnpm run start" --name Calckey -``` - -## 😉 Tips & Tricks - -- When editing the config file, please don't fill out the settings at the bottom. They're designed *only* for managed hosting, not self hosting. Those settings are much better off being set in Calckey's control panel. -- Port 3000 (used in the default config) might be already used on your server for something else. To find an open port for Calckey, run `for p in {3000..4000}; do ss -tlnH | tr -s ' ' | cut -d" " -sf4 | grep -q "${p}$" || echo "${p}"; done | head -n 1`. Replace 3000 with the minimum port and 4000 with the maximum port if you need it. -- I'd recommend you use a S3 Bucket/CDN for Object Storage, especially if you use Docker. -- I'd ***strongly*** recommend against using CloudFlare, but if you do, make sure to turn code minification off. -- For push notifications, run `npx web-push generate-vapid-keys`, then put the public and private keys into Control Panel > General > ServiceWorker. -- For translations, make a [DeepL](https://deepl.com) account and generate an API key, then put it into Control Panel > General > DeepL Translation. -- To add another admin account: - - Go to the user's page > 3 Dots > About > Moderation > turn on "Moderator" - - Go back to Overview > click the clipboard icon next to the ID - - Run `psql -d calckey` (or whatever the database name is) - - Run `UPDATE "user" SET "isAdmin" = true WHERE id='999999';` (replace `999999` with the copied ID) - - Restart your Calckey server diff --git a/SECURITY.md b/SECURITY.md deleted file mode 100644 index 848fa7cb7c..0000000000 --- a/SECURITY.md +++ /dev/null @@ -1,16 +0,0 @@ -# Reporting Security Issues - -## Minor Security Issues - -If you discover a minor security issue in Calckey, please report it by sending an -email to [kainoa@t1c.dev](mailto:kainoa@t1c.dev). - -## High Security Issues - -If you discover a security issue, which is so high risk, that too much is affected by it, please dont send it over unencrypted communication. You can share your PGP keys with us using kainoa@t1c.dev and after we established a secure communication, send it over E-Mail, or message us using matrix' encrypted private messages at @t1c:matrix.fedibird.com or @cleo:tchncs.de - - -This will allow us to assess the risk, and make a fix available before we add a -bug report to the Codeberg repository. - -Thanks for helping make Calckey safe for everyone. diff --git a/docs/api-doc.md b/docs/api-doc.md deleted file mode 100644 index 4051144de1..0000000000 --- a/docs/api-doc.md +++ /dev/null @@ -1,5 +0,0 @@ -# API Documentation - -You can find interactive API documentation at any Calckey instance. https://calckey.social/api-doc - -You can also find auto-generated documentation for calckey-js [here](../packages/calckey-js/markdown/calckey-js.md). diff --git a/docs/development.md b/docs/development.md deleted file mode 100644 index 6d6c0ea8d2..0000000000 --- a/docs/development.md +++ /dev/null @@ -1,108 +0,0 @@ -# 🌎 Calckey Developer Docs - -## Nix Dev Environment -The Calckey repo comes with a Nix-based shell environment to help make development as easy as possible! - -Please note, however, that this environment will not work on Windows outside of a WSL2 environment. - -### Prerequisites - -- Installed the [Nix Package Manager](https://nixos.org/download.html) (use the comman on their website) -- Installed [direnv](https://direnv.net/docs/installation.html) and added its hook to your shell. (package manager) - -Once the repo is cloned to your computer, follow these next few steps inside the Calckey folder: - -- Run `direnv allow`. This will build the environment and install all needed tools. -- Run `install-deps`, then `prepare-config`, to install the node dependencies and prepare the needed config files. -- In a second terminal, run `devenv up`. This will spawn a **Redis** server, a **Postgres** server, and the **Calckey** server in dev mode. -- Once you see the Calckey banner printed in your second terminal, run `migrate` in the first. -- Once migrations finish, open http://localhost:3000 in your web browser. -- You should now see the admin user creation screen! - -Note: When you want to restart a dev server, all you need to do is run `devenv up`, no other steps are necessary. - -# Possible Troubles with the dev enviroment -(this doesn't have to be done under normal conditions, this is for future reference) - -### direnv -If you have any trouble with `direnv allow` -Check that the contents of `.envrc` have the same version of nix-direnv that is specified here: -> nix-direnv under -> installation -> using direnv source url -> https://github.com/nix-community/nix-direnv#direnv-source_url - -there should be no errors during `direnv allow` - -### outdated nix packages -if `install-deps` or any subsequent command doesn't run due to versioning problems -`flake.nix` and `flake.lock` may be outdated - -delete `flake.lock`, or better, run `nix flake update --extra-experimental-features flakes --extra-experimental-features nix-command` -after that, run `direnv rebuild` - -if there are any errors, you might have to change `flake.nix` -(because the available options can change between versions - consider getting support in [the matrix channel](https://matrix.to/#/#calckey:matrix.fedibird.com)) - -### after changing a node version -in my case, i had to change the node version from 19, to 18 - -! before proceeding, make sure to delete all build artifacts! -remove `node_modules` and `built` folders, and maybe `.devenv` and `.direnv` as well -manually, or run `npm cache clean --force` and `pnpm cleanall` - -### Windows Subsystem for Linux -if `devenv up` terminates because of wrong folder permissions, - -create the file `/etc/wsl.conf` in your distro and add -```shell -[automount] -options = "metadata" -``` - -this allows `chmod` calls to actually have an effect. -the build scripts DO actually set the permissions, it just needs to work in wsl. - -### devenv up -devenv up may take a looong time. (some say this is fake news, maybe it was bad luck in my case) - -do not get spooked by this error: -``` -> calckey@14.0.0-dev32 start /mnt/.../calckey -> pnpm --filter backend run start - - -> backend@ start /mnt/.../calckey/packages/backend -> pnpm node ./built/index.js - -node:internal/modules/cjs/loader:1078 - throw err; - ^ - -Error: Cannot find module '/mnt/.../calckey/packages/backend/built/index.js' - at Module._resolveFilename (node:internal/modules/cjs/loader:1075:15) - at Module._load (node:internal/modules/cjs/loader:920:27) - at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12) - at node:internal/main/run_main_module:23:47 { - code: 'MODULE_NOT_FOUND', - requireStack: [] -} - -Node.js v18.16.0 -undefined -/mnt/.../calckey/packages/backend: - ERR_PNPM_RECURSIVE_RUN_FIRST_FAIL  backend@ start: `pnpm node ./built/index.js` -Exit status 1 - ELIFECYCLE  Command failed with exit code 1. -``` - -the script is designed to constantly try to start the server, while the build is still running. -this just means that the build isn't finished yet. - -at some point you should see a banner that says "Calckey" in big letters - -then you're good to go and can run `migrate` (in another terminal)! - -if you don't see the banner, -and it's for some reason stuck on `Finished 'build' after 917 ms` for a view minutes, - -just leave devenv running and open another terminal in the folder -run `migrate` and then `pnpm --filter backend run start` by yourself -the server should start diff --git a/docs/docker.md b/docs/docker.md deleted file mode 100644 index 0c625a4b3d..0000000000 --- a/docs/docker.md +++ /dev/null @@ -1,48 +0,0 @@ -# 🐳 Running a Calckey server with Docker - -## Pre-built docker container -[thatonecalculator/calckey](https://hub.docker.com/r/thatonecalculator/calckey) - -## `docker-compose` - -There is a `docker-compose.yml` in the root of the project that you can use to build the container from source - -- .config/docker.env (**db config settings**) -- .config/default.yml (**calckey server settings**) - -## Configuring - -Rename the files: - -`cp .config/example.yml .config/default.yml` - -`cp .config/example.env .config/docker.env` - -then edit them according to your environment. -You can configure `docker.env` with anything you like, but you will have to pay attention to the `default.yml` file: -- `url` should be set to the URL you will be hosting the web interface for the server at. -- `host`, `db`, `user`, `pass` will have to be configured in the `PostgreSQL configuration` section - `host` is the name of the postgres container (eg: *calckey_db_1*), and the others should match your `docker.env`. -- `host`will need to be configured in the *Redis configuration* section - it is the name of the redis container (eg: *calckey_redis_1*) -- `auth` will need to be configured in the *Sonic* section - cannot be the default `SecretPassword` - -Everything else can be left as-is. - -## Running docker-compose - -The [prebuilt container for calckey](https://hub.docker.com/r/thatonecalculator/calckey) is fairly large, and may take a few minutes to download and extract using docker. - -Copy `docker-compose.yml` and the `config/` to a directory, then run the **docker-compose** command: -`docker-compose up -d`. - -NOTE: This will take some time to come fully online, even after download and extracting the container images, and it may emit some error messages before completing successfully. Specifically, the `db` container needs to initialize and so isn't available to the `web` container right away. Only once the `db` container comes online does the `web` container start building and initializing the calckey tables. - -Once the server is up you can use a web browser to access the web interface at `http://serverip:3000` (where `serverip` is the IP of the server you are running the calckey server on). - -## Docker for development - -```sh -cd dev/ -docker-compose build -docker-compose run --rm web pnpm run init -docker-compose up -d -``` diff --git a/docs/migrate.md b/docs/migrate.md deleted file mode 100644 index 7e9653e70f..0000000000 --- a/docs/migrate.md +++ /dev/null @@ -1,103 +0,0 @@ -# 🚚 Migrating from Misskey to Calckey - -The following procedure may not work depending on your environment and version of Misskey. - -**Make sure you** -- **stopped all master and worker processes of Misskey.** -- **have backups of the database before performing any commands.** - -## Misskey v13 and above - -Tested with Misskey v13.11.3. - -If your Misskey v13 is older, we recommend updating your Misskey to v13.11.3. - -```sh -wget -O mkv13.patch https://codeberg.org/calckey/calckey/raw/branch/develop/docs/mkv13.patch -wget -O mkv13_restore.patch https://codeberg.org/calckey/calckey/raw/branch/develop/docs/mkv13_restore.patch -git apply mkv13.patch mkv13_restore.patch - -cd packages/backend - -LINE_NUM="$(pnpm typeorm migration:show -d ormconfig.js | grep -n activeEmailValidation1657346559800 | cut -d ':' -f 1)" -NUM_MIGRATIONS="$(pnpm typeorm migration:show -d ormconfig.js | tail -n+"$LINE_NUM" | grep '\[X\]' | wc -l)" - -for i in $(seq 1 $NUM_MIGRATIONS); do pnpm typeorm migration:revert -d ormconfig.js; done - -cd ../../ - -git remote set-url origin https://codeberg.org/calckey/calckey.git -git fetch origin -git stash push -rm -rf fluent-emojis misskey-assets -git switch main # or beta or develop -git pull --ff -wget -O renote_muting.patch https://codeberg.org/calckey/calckey/raw/branch/develop/docs/renote_muting.patch -git apply renote_muting.patch - -pnpm install -NODE_ENV=production pnpm run build -pnpm run migrate -git stash push -``` - -Depending on the version you're migrating from, you may have to open Postgres with `psql -d your_database` and run the following commands: - -```sql -ALTER TABLE "meta" ADD COLUMN "disableLocalTimeline" boolean DEFAULT false; -ALTER TABLE "meta" ADD COLUMN "disableGlobalTimeline" boolean DEFAULT false; -ALTER TABLE "meta" ADD COLUMN "localDriveCapacityMb" integer DEFAULT 512; -ALTER TABLE "meta" ADD COLUMN "remoteDriveCapacityMb" integer DEFAULT 128; -ALTER TABLE "user" ADD COLUMN "isSilenced" boolean DEFAULT false; -ALTER TABLE "user" ADD COLUMN "isAdmin" boolean DEFAULT false; -ALTER TABLE "user" ADD COLUMN "isModerator" boolean DEFAULT false; -ALTER TABLE "user" ADD COLUMN "remoteDriveCapacityMb" integer DEFAULT 128; -ALTER TABLE "user" ADD COLUMN "driveCapacityOverrideMb" integer DEFAULT 128; -ALTER TABLE "instance" ADD COLUMN "caughtAt" date; -ALTER TABLE "instance" ADD COLUMN "latestRequestSentAt" date; -ALTER TABLE "instance" ADD COLUMN "latestStatus" character varying(512); -ALTER TABLE "instance" ADD COLUMN "lastCommunicatedAt" date; -``` - -then quit with `\q`, and restart Calckey. - -Note: Ignore errors of `column "xxx" of relation "xxx" already exists`. - -If no other errors happened, your Calckey is ready to launch! - -## Misskey v12.119 and before - -```sh -git remote set-url origin https://codeberg.org/calckey/calckey.git -git fetch -git checkout main # or beta or develop -git pull --ff - -NODE_ENV=production pnpm run migrate -# build using prefered method -``` - -## Foundkey - -```sh -cd packages/backend - -LINE_NUM="$(npx typeorm migration:show -d ormconfig.js | grep -n uniformThemecolor1652859567549 | cut -d ':' -f 1)" -NUM_MIGRATIONS="$(npx typeorm migration:show -d ormconfig.js | tail -n+"$LINE_NUM" | grep '\[X\]' | nl)" - -for i in $(seq 1 $NUM_MIGRAIONS); do - npx typeorm migration:revert -d ormconfig.js -done - -git remote set-url origin https://codeberg.org/calckey/calckey.git -git fetch -git checkout main # or beta or develop -git pull --ff - -NODE_ENV=production pnpm run migrate -# build using prefered method -``` - -## Reverse - -You ***cannot*** migrate back to Misskey from Calckey due to re-hashing passwords on signin with argon2. You can migrate from Calckey to Foundkey, though. diff --git a/docs/mkv13.patch b/docs/mkv13.patch deleted file mode 100644 index e6106b16f2..0000000000 --- a/docs/mkv13.patch +++ /dev/null @@ -1,45 +0,0 @@ -diff --git a/packages/backend/migration/1672704017999-remove-lastCommunicatedAt.js b/packages/backend/migration/1672704017999-remove-lastCommunicatedAt.js -index 38a676985..c4ae690e0 100644 ---- a/packages/backend/migration/1672704017999-remove-lastCommunicatedAt.js -+++ b/packages/backend/migration/1672704017999-remove-lastCommunicatedAt.js -@@ -6,6 +6,8 @@ export class removeLastCommunicatedAt1672704017999 { - } - - async down(queryRunner) { -- await queryRunner.query(`ALTER TABLE "instance" ADD "lastCommunicatedAt" TIMESTAMP WITH TIME ZONE NOT NULL`); -+ await queryRunner.query(`ALTER TABLE "instance" ADD "lastCommunicatedAt" TIMESTAMP WITH TIME ZONE`); -+ await queryRunner.query(`UPDATE "instance" SET "lastCommunicatedAt" = COALESCE("infoUpdatedAt", "caughtAt")`); -+ await queryRunner.query(`ALTER TABLE "instance" ALTER COLUMN "lastCommunicatedAt" SET NOT NULL`); - } - } -diff --git a/packages/backend/migration/1673336077243-PollChoiceLength.js b/packages/backend/migration/1673336077243-PollChoiceLength.js -index 810c626e0..5809528cb 100644 ---- a/packages/backend/migration/1673336077243-PollChoiceLength.js -+++ b/packages/backend/migration/1673336077243-PollChoiceLength.js -@@ -6,6 +6,6 @@ export class PollChoiceLength1673336077243 { - } - - async down(queryRunner) { -- await queryRunner.query(`ALTER TABLE "poll" ALTER COLUMN "choices" TYPE character varying(128) array`); -+ //await queryRunner.query(`ALTER TABLE "poll" ALTER COLUMN "choices" TYPE character varying(128) array`); - } - } -diff --git a/packages/backend/migration/1674118260469-achievement.js b/packages/backend/migration/1674118260469-achievement.js -index 131ab96f8..57a922f83 100644 ---- a/packages/backend/migration/1674118260469-achievement.js -+++ b/packages/backend/migration/1674118260469-achievement.js -@@ -18,12 +18,13 @@ export class achievement1674118260469 { - - async down(queryRunner) { - await queryRunner.query(`CREATE TYPE "public"."user_profile_mutingnotificationtypes_enum_old" AS ENUM('follow', 'mention', 'reply', 'renote', 'quote', 'reaction', 'pollVote', 'receiveFollowRequest', 'followRequestAccepted', 'groupInvited', 'app', 'pollEnded')`); -+ await queryRunner.query(`CREATE TYPE "public"."notification_type_enum_old" AS ENUM('follow', 'mention', 'reply', 'renote', 'quote', 'reaction', 'pollVote', 'pollEnded', 'receiveFollowRequest', 'followRequestAccepted', 'groupInvited', 'app')`); - await queryRunner.query(`ALTER TABLE "user_profile" ALTER COLUMN "mutingNotificationTypes" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "user_profile" ALTER COLUMN "mutingNotificationTypes" TYPE "public"."user_profile_mutingnotificationtypes_enum_old"[] USING "mutingNotificationTypes"::"text"::"public"."user_profile_mutingnotificationtypes_enum_old"[]`); - await queryRunner.query(`ALTER TABLE "user_profile" ALTER COLUMN "mutingNotificationTypes" SET DEFAULT '{}'`); - await queryRunner.query(`DROP TYPE "public"."user_profile_mutingnotificationtypes_enum"`); - await queryRunner.query(`ALTER TYPE "public"."user_profile_mutingnotificationtypes_enum_old" RENAME TO "user_profile_mutingnotificationtypes_enum"`); -- await queryRunner.query(`CREATE TYPE "public"."notification_type_enum_old" AS ENUM('follow', 'mention', 'reply', 'renote', 'quote', 'reaction', 'pollVote', 'pollEnded', 'receiveFollowRequest', 'followRequestAccepted', 'groupInvited', 'app')`); -+ await queryRunner.query(`DELETE FROM "public"."notification" WHERE "type" = 'achievementEarned'`); - await queryRunner.query(`ALTER TABLE "notification" ALTER COLUMN "type" TYPE "public"."notification_type_enum_old" USING "type"::"text"::"public"."notification_type_enum_old"`); - await queryRunner.query(`DROP TYPE "public"."notification_type_enum"`); - await queryRunner.query(`ALTER TYPE "public"."notification_type_enum_old" RENAME TO "notification_type_enum"`); diff --git a/docs/mkv13_restore.patch b/docs/mkv13_restore.patch deleted file mode 100644 index 9ef9934edc..0000000000 --- a/docs/mkv13_restore.patch +++ /dev/null @@ -1,127 +0,0 @@ -diff --git a/packages/backend/migration/1680491187535-cleanup.js b/packages/backend/migration/1680491187535-cleanup.js -index 1e609ca06..0e6accf3e 100644 ---- a/packages/backend/migration/1680491187535-cleanup.js -+++ b/packages/backend/migration/1680491187535-cleanup.js -@@ -1,10 +1,40 @@ - export class cleanup1680491187535 { -- name = 'cleanup1680491187535' -+ name = "cleanup1680491187535"; - -- async up(queryRunner) { -- await queryRunner.query(`DROP TABLE "antenna_note" `); -- } -+ async up(queryRunner) { -+ await queryRunner.query(`DROP TABLE "antenna_note" `); -+ } - -- async down(queryRunner) { -- } -+ async down(queryRunner) { -+ await queryRunner.query( -+ `CREATE TABLE antenna_note ( id character varying(32) NOT NULL, "noteId" character varying(32) NOT NULL, "antennaId" character varying(32) NOT NULL, read boolean DEFAULT false NOT NULL)`, -+ ); -+ await queryRunner.query( -+ `COMMENT ON COLUMN antenna_note."noteId" IS 'The note ID.'`, -+ ); -+ await queryRunner.query( -+ `COMMENT ON COLUMN antenna_note."antennaId" IS 'The antenna ID.'`, -+ ); -+ await queryRunner.query( -+ `ALTER TABLE ONLY antenna_note ADD CONSTRAINT "PK_fb28d94d0989a3872df19fd6ef8" PRIMARY KEY (id)`, -+ ); -+ await queryRunner.query( -+ `CREATE INDEX "IDX_0d775946662d2575dfd2068a5f" ON antenna_note USING btree ("antennaId")`, -+ ); -+ await queryRunner.query( -+ `CREATE UNIQUE INDEX "IDX_335a0bf3f904406f9ef3dd51c2" ON antenna_note USING btree ("noteId", "antennaId")`, -+ ); -+ await queryRunner.query( -+ `CREATE INDEX "IDX_9937ea48d7ae97ffb4f3f063a4" ON antenna_note USING btree (read)`, -+ ); -+ await queryRunner.query( -+ `CREATE INDEX "IDX_bd0397be22147e17210940e125" ON antenna_note USING btree ("noteId")`, -+ ); -+ await queryRunner.query( -+ `ALTER TABLE ONLY antenna_note ADD CONSTRAINT "FK_0d775946662d2575dfd2068a5f5" FOREIGN KEY ("antennaId") REFERENCES antenna(id) ON DELETE CASCADE`, -+ ); -+ await queryRunner.query( -+ `ALTER TABLE ONLY antenna_note ADD CONSTRAINT "FK_bd0397be22147e17210940e125b" FOREIGN KEY ("noteId") REFERENCES note(id) ON DELETE CASCADE`, -+ ); -+ } - } -diff --git a/packages/backend/migration/1680582195041-cleanup.js b/packages/backend/migration/1680582195041-cleanup.js -index c587e456a..a91d6ff3c 100644 ---- a/packages/backend/migration/1680582195041-cleanup.js -+++ b/packages/backend/migration/1680582195041-cleanup.js -@@ -1,11 +1,64 @@ - export class cleanup1680582195041 { -- name = 'cleanup1680582195041' -+ name = "cleanup1680582195041"; - -- async up(queryRunner) { -- await queryRunner.query(`DROP TABLE "notification" `); -- } -+ async up(queryRunner) { -+ await queryRunner.query(`DROP TABLE "notification"`); -+ } - -- async down(queryRunner) { -- -- } -+ async down(queryRunner) { -+ await queryRunner.query( -+ `CREATE TABLE notification ( id character varying(32) NOT NULL, "createdAt" timestamp with time zone NOT NULL, "notifieeId" character varying(32) NOT NULL, "notifierId" character varying(32), "isRead" boolean DEFAULT false NOT NULL, "noteId" character varying(32), reaction character varying(128), choice integer, "followRequestId" character varying(32), type notification_type_enum NOT NULL, "customBody" character varying(2048), "customHeader" character varying(256), "customIcon" character varying(1024), "appAccessTokenId" character varying(32), achievement character varying(128))`, -+ ); -+ await queryRunner.query( -+ `COMMENT ON COLUMN notification."createdAt" IS 'The created date of the Notification.'`, -+ ); -+ await queryRunner.query( -+ `COMMENT ON COLUMN notification."notifieeId" IS 'The ID of recipient user of the Notification.'`, -+ ); -+ await queryRunner.query( -+ `COMMENT ON COLUMN notification."notifierId" IS 'The ID of sender user of the Notification.'`, -+ ); -+ await queryRunner.query( -+ `COMMENT ON COLUMN notification."isRead" IS 'Whether the Notification is read.'`, -+ ); -+ await queryRunner.query( -+ `COMMENT ON COLUMN notification.type IS 'The type of the Notification.'`, -+ ); -+ await queryRunner.query( -+ `ALTER TABLE ONLY notification ADD CONSTRAINT "PK_705b6c7cdf9b2c2ff7ac7872cb7" PRIMARY KEY (id)`, -+ ); -+ await queryRunner.query( -+ `CREATE INDEX "IDX_080ab397c379af09b9d2169e5b" ON notification USING btree ("isRead")`, -+ ); -+ await queryRunner.query( -+ `CREATE INDEX "IDX_33f33cc8ef29d805a97ff4628b" ON notification USING btree (type)`, -+ ); -+ await queryRunner.query( -+ `CREATE INDEX "IDX_3b4e96eec8d36a8bbb9d02aa71" ON notification USING btree ("notifierId")`, -+ ); -+ await queryRunner.query( -+ `CREATE INDEX "IDX_3c601b70a1066d2c8b517094cb" ON notification USING btree ("notifieeId")`, -+ ); -+ await queryRunner.query( -+ `CREATE INDEX "IDX_b11a5e627c41d4dc3170f1d370" ON notification USING btree ("createdAt")`, -+ ); -+ await queryRunner.query( -+ `CREATE INDEX "IDX_e22bf6bda77b6adc1fd9e75c8c" ON notification USING btree ("appAccessTokenId")`, -+ ); -+ await queryRunner.query( -+ `ALTER TABLE ONLY notification ADD CONSTRAINT "FK_3b4e96eec8d36a8bbb9d02aa710" FOREIGN KEY ("notifierId") REFERENCES "user"(id) ON DELETE CASCADE`, -+ ); -+ await queryRunner.query( -+ `ALTER TABLE ONLY notification ADD CONSTRAINT "FK_3c601b70a1066d2c8b517094cb9" FOREIGN KEY ("notifieeId") REFERENCES "user"(id) ON DELETE CASCADE`, -+ ); -+ await queryRunner.query( -+ `ALTER TABLE ONLY notification ADD CONSTRAINT "FK_769cb6b73a1efe22ddf733ac453" FOREIGN KEY ("noteId") REFERENCES note(id) ON DELETE CASCADE`, -+ ); -+ await queryRunner.query( -+ `ALTER TABLE ONLY notification ADD CONSTRAINT "FK_bd7fab507621e635b32cd31892c" FOREIGN KEY ("followRequestId") REFERENCES follow_request(id) ON DELETE CASCADE`, -+ ); -+ await queryRunner.query( -+ `ALTER TABLE ONLY notification ADD CONSTRAINT "FK_e22bf6bda77b6adc1fd9e75c8c9" FOREIGN KEY ("appAccessTokenId") REFERENCES access_token(id) ON DELETE CASCADE`, -+ ); -+ } - } diff --git a/docs/renote_muting.patch b/docs/renote_muting.patch deleted file mode 100644 index c5bd2818c6..0000000000 --- a/docs/renote_muting.patch +++ /dev/null @@ -1,23 +0,0 @@ -diff --git a/packages/backend/migration/1665091090561-add-renote-muting.js b/packages/backend/migration/1665091090561-add-renote-muting.js -index 2c76aaff5..f8541c818 100644 ---- a/packages/backend/migration/1665091090561-add-renote-muting.js -+++ b/packages/backend/migration/1665091090561-add-renote-muting.js -@@ -4,18 +4,6 @@ export class addRenoteMuting1665091090561 { - } - - async up(queryRunner) { -- await queryRunner.query( -- `CREATE TABLE "renote_muting" ("id" character varying(32) NOT NULL, "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL, "muteeId" character varying(32) NOT NULL, "muterId" character varying(32) NOT NULL, CONSTRAINT "PK_renoteMuting_id" PRIMARY KEY ("id"))`, -- ); -- await queryRunner.query( -- `CREATE INDEX "IDX_renote_muting_createdAt" ON "muting" ("createdAt") `, -- ); -- await queryRunner.query( -- `CREATE INDEX "IDX_renote_muting_muteeId" ON "muting" ("muteeId") `, -- ); -- await queryRunner.query( -- `CREATE INDEX "IDX_renote_muting_muterId" ON "muting" ("muterId") `, -- ); - } - - async down(queryRunner) {} diff --git a/package.json b/package.json index cb1619468d..91568fcab3 100644 --- a/package.json +++ b/package.json @@ -13,10 +13,6 @@ "build": "pnpm node ./scripts/build-greet.js && pnpm -r run build ", "start": "pnpm --filter backend run start", "start:test": "pnpm --filter backend run start:test", - "init": "pnpm run migrate", - "migrate": "pnpm --filter backend run migrate", - "revertmigration": "pnpm --filter backend run revertmigration", - "migrateandstart": "pnpm run migrate && pnpm run start", "watch": "pnpm run dev", "dev": "pnpm node ./scripts/dev.js", "dev:staging": "NODE_OPTIONS=--max_old_space_size=3072 NODE_ENV=development pnpm run build && pnpm run start", diff --git a/packages/backend/migration/1000000000000-Init.js b/packages/backend/migration/1000000000000-Init.js deleted file mode 100644 index bab5fae7a0..0000000000 --- a/packages/backend/migration/1000000000000-Init.js +++ /dev/null @@ -1,1068 +0,0 @@ -export class Init1000000000000 { - async up(queryRunner) { - await queryRunner.query( - `CREATE TYPE "log_level_enum" AS ENUM('error', 'warning', 'info', 'success', 'debug')`, - ); - await queryRunner.query( - `CREATE TABLE "log" ("id" character varying(32) NOT NULL, "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL, "domain" character varying(64) array NOT NULL DEFAULT '{}'::varchar[], "level" "log_level_enum" NOT NULL, "worker" character varying(8) NOT NULL, "machine" character varying(128) NOT NULL, "message" character varying(1024) NOT NULL, "data" jsonb NOT NULL DEFAULT '{}', CONSTRAINT "PK_350604cbdf991d5930d9e618fbd" PRIMARY KEY ("id"))`, - ); - await queryRunner.query( - `CREATE INDEX "IDX_8e4eb51a35d81b64dda28eed0a" ON "log" ("createdAt") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_8cb40cfc8f3c28261e6f887b03" ON "log" ("domain") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_584b536b49e53ac81beb39a177" ON "log" ("level") `, - ); - await queryRunner.query( - `CREATE TABLE "drive_folder" ("id" character varying(32) NOT NULL, "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL, "name" character varying(128) NOT NULL, "userId" character varying(32), "parentId" character varying(32), CONSTRAINT "PK_7a0c089191f5ebdc214e0af808a" PRIMARY KEY ("id"))`, - ); - await queryRunner.query( - `CREATE INDEX "IDX_02878d441ceae15ce060b73daf" ON "drive_folder" ("createdAt") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_f4fc06e49c0171c85f1c48060d" ON "drive_folder" ("userId") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_00ceffb0cdc238b3233294f08f" ON "drive_folder" ("parentId") `, - ); - await queryRunner.query( - `CREATE TABLE "drive_file" ("id" character varying(32) NOT NULL, "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL, "userId" character varying(32), "userHost" character varying(128), "md5" character varying(32) NOT NULL, "name" character varying(256) NOT NULL, "type" character varying(128) NOT NULL, "size" integer NOT NULL, "comment" character varying(512), "properties" jsonb NOT NULL DEFAULT '{}', "storedInternal" boolean NOT NULL, "url" character varying(512) NOT NULL, "thumbnailUrl" character varying(512), "webpublicUrl" character varying(512), "accessKey" character varying(256), "thumbnailAccessKey" character varying(256), "webpublicAccessKey" character varying(256), "uri" character varying(512), "src" character varying(512), "folderId" character varying(32), "isSensitive" boolean NOT NULL DEFAULT false, "isLink" boolean NOT NULL DEFAULT false, CONSTRAINT "PK_43ddaaaf18c9e68029b7cbb032e" PRIMARY KEY ("id"))`, - ); - await queryRunner.query( - `CREATE INDEX "IDX_c8dfad3b72196dd1d6b5db168a" ON "drive_file" ("createdAt") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_860fa6f6c7df5bb887249fba22" ON "drive_file" ("userId") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_92779627994ac79277f070c91e" ON "drive_file" ("userHost") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_37bb9a1b4585f8a3beb24c62d6" ON "drive_file" ("md5") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_a40b8df8c989d7db937ea27cf6" ON "drive_file" ("type") `, - ); - await queryRunner.query( - `CREATE UNIQUE INDEX "IDX_d85a184c2540d2deba33daf642" ON "drive_file" ("accessKey") `, - ); - await queryRunner.query( - `CREATE UNIQUE INDEX "IDX_e74022ce9a074b3866f70e0d27" ON "drive_file" ("thumbnailAccessKey") `, - ); - await queryRunner.query( - `CREATE UNIQUE INDEX "IDX_c55b2b7c284d9fef98026fc88e" ON "drive_file" ("webpublicAccessKey") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_e5848eac4940934e23dbc17581" ON "drive_file" ("uri") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_bb90d1956dafc4068c28aa7560" ON "drive_file" ("folderId") `, - ); - await queryRunner.query( - `CREATE TABLE "user" ("id" character varying(32) NOT NULL, "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL, "updatedAt" TIMESTAMP WITH TIME ZONE, "lastFetchedAt" TIMESTAMP WITH TIME ZONE, "username" character varying(128) NOT NULL, "usernameLower" character varying(128) NOT NULL, "name" character varying(128), "followersCount" integer NOT NULL DEFAULT 0, "followingCount" integer NOT NULL DEFAULT 0, "notesCount" integer NOT NULL DEFAULT 0, "avatarId" character varying(32), "bannerId" character varying(32), "tags" character varying(128) array NOT NULL DEFAULT '{}'::varchar[], "avatarUrl" character varying(512), "bannerUrl" character varying(512), "avatarColor" character varying(32), "bannerColor" character varying(32), "isSuspended" boolean NOT NULL DEFAULT false, "isSilenced" boolean NOT NULL DEFAULT false, "isLocked" boolean NOT NULL DEFAULT false, "isBot" boolean NOT NULL DEFAULT false, "isCat" boolean NOT NULL DEFAULT false, "isAdmin" boolean NOT NULL DEFAULT false, "isModerator" boolean NOT NULL DEFAULT false, "isVerified" boolean NOT NULL DEFAULT false, "emojis" character varying(128) array NOT NULL DEFAULT '{}'::varchar[], "host" character varying(128), "inbox" character varying(512), "sharedInbox" character varying(512), "featured" character varying(512), "uri" character varying(512), "token" character(16), CONSTRAINT "UQ_a854e557b1b14814750c7c7b0c9" UNIQUE ("token"), CONSTRAINT "REL_58f5c71eaab331645112cf8cfa" UNIQUE ("avatarId"), CONSTRAINT "REL_afc64b53f8db3707ceb34eb28e" UNIQUE ("bannerId"), CONSTRAINT "PK_cace4a159ff9f2512dd42373760" PRIMARY KEY ("id"))`, - ); - await queryRunner.query( - `CREATE INDEX "IDX_e11e649824a45d8ed01d597fd9" ON "user" ("createdAt") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_80ca6e6ef65fb9ef34ea8c90f4" ON "user" ("updatedAt") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_a27b942a0d6dcff90e3ee9b5e8" ON "user" ("usernameLower") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_fa99d777623947a5b05f394cae" ON "user" ("tags") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_3252a5df8d5bbd16b281f7799e" ON "user" ("host") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_be623adaa4c566baf5d29ce0c8" ON "user" ("uri") `, - ); - await queryRunner.query( - `CREATE UNIQUE INDEX "IDX_a854e557b1b14814750c7c7b0c" ON "user" ("token") `, - ); - await queryRunner.query( - `CREATE UNIQUE INDEX "IDX_5deb01ae162d1d70b80d064c27" ON "user" ("usernameLower", "host") `, - ); - await queryRunner.query( - `CREATE TABLE "app" ("id" character varying(32) NOT NULL, "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL, "userId" character varying(32), "secret" character varying(64) NOT NULL, "name" character varying(128) NOT NULL, "description" character varying(512) NOT NULL, "permission" character varying(64) array NOT NULL, "callbackUrl" character varying(512), CONSTRAINT "PK_9478629fc093d229df09e560aea" PRIMARY KEY ("id"))`, - ); - await queryRunner.query( - `CREATE INDEX "IDX_048a757923ed8b157e9895da53" ON "app" ("createdAt") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_3f5b0899ef90527a3462d7c2cb" ON "app" ("userId") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_f49922d511d666848f250663c4" ON "app" ("secret") `, - ); - await queryRunner.query( - `CREATE TABLE "access_token" ("id" character varying(32) NOT NULL, "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL, "token" character varying(128) NOT NULL, "hash" character varying(128) NOT NULL, "userId" character varying(32) NOT NULL, "appId" character varying(32) NOT NULL, CONSTRAINT "PK_f20f028607b2603deabd8182d12" PRIMARY KEY ("id"))`, - ); - await queryRunner.query( - `CREATE INDEX "IDX_70ba8f6af34bc924fc9e12adb8" ON "access_token" ("token") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_64c327441248bae40f7d92f34f" ON "access_token" ("hash") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_9949557d0e1b2c19e5344c171e" ON "access_token" ("userId") `, - ); - await queryRunner.query( - `CREATE TYPE "note_visibility_enum" AS ENUM('public', 'home', 'followers', 'specified')`, - ); - await queryRunner.query( - `CREATE TABLE "note" ("id" character varying(32) NOT NULL, "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL, "replyId" character varying(32), "renoteId" character varying(32), "text" text, "name" character varying(256), "cw" character varying(512), "appId" character varying(32), "userId" character varying(32) NOT NULL, "viaMobile" boolean NOT NULL DEFAULT false, "localOnly" boolean NOT NULL DEFAULT false, "renoteCount" smallint NOT NULL DEFAULT 0, "repliesCount" smallint NOT NULL DEFAULT 0, "reactions" jsonb NOT NULL DEFAULT '{}', "visibility" "note_visibility_enum" NOT NULL, "uri" character varying(512), "score" integer NOT NULL DEFAULT 0, "fileIds" character varying(32) array NOT NULL DEFAULT '{}'::varchar[], "attachedFileTypes" character varying(256) array NOT NULL DEFAULT '{}'::varchar[], "visibleUserIds" character varying(32) array NOT NULL DEFAULT '{}'::varchar[], "mentions" character varying(32) array NOT NULL DEFAULT '{}'::varchar[], "mentionedRemoteUsers" text NOT NULL DEFAULT '[]', "emojis" character varying(128) array NOT NULL DEFAULT '{}'::varchar[], "tags" character varying(128) array NOT NULL DEFAULT '{}'::varchar[], "hasPoll" boolean NOT NULL DEFAULT false, "geo" jsonb DEFAULT null, "userHost" character varying(128), "replyUserId" character varying(32), "replyUserHost" character varying(128), "renoteUserId" character varying(32), "renoteUserHost" character varying(128), CONSTRAINT "PK_96d0c172a4fba276b1bbed43058" PRIMARY KEY ("id"))`, - ); - await queryRunner.query( - `CREATE INDEX "IDX_e7c0567f5261063592f022e9b5" ON "note" ("createdAt") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_17cb3553c700a4985dff5a30ff" ON "note" ("replyId") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_52ccc804d7c69037d558bac4c9" ON "note" ("renoteId") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_5b87d9d19127bd5d92026017a7" ON "note" ("userId") `, - ); - await queryRunner.query( - `CREATE UNIQUE INDEX "IDX_153536c67d05e9adb24e99fc2b" ON "note" ("uri") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_51c063b6a133a9cb87145450f5" ON "note" ("fileIds") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_25dfc71b0369b003a4cd434d0b" ON "note" ("attachedFileTypes") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_796a8c03959361f97dc2be1d5c" ON "note" ("visibleUserIds") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_54ebcb6d27222913b908d56fd8" ON "note" ("mentions") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_88937d94d7443d9a99a76fa5c0" ON "note" ("tags") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_7125a826ab192eb27e11d358a5" ON "note" ("userHost") `, - ); - await queryRunner.query( - `CREATE TABLE "poll_vote" ("id" character varying(32) NOT NULL, "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL, "userId" character varying(32) NOT NULL, "noteId" character varying(32) NOT NULL, "choice" integer NOT NULL, CONSTRAINT "PK_fd002d371201c472490ba89c6a0" PRIMARY KEY ("id"))`, - ); - await queryRunner.query( - `CREATE INDEX "IDX_0fb627e1c2f753262a74f0562d" ON "poll_vote" ("createdAt") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_66d2bd2ee31d14bcc23069a89f" ON "poll_vote" ("userId") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_aecfbd5ef60374918e63ee95fa" ON "poll_vote" ("noteId") `, - ); - await queryRunner.query( - `CREATE UNIQUE INDEX "IDX_50bd7164c5b78f1f4a42c4d21f" ON "poll_vote" ("userId", "noteId", "choice") `, - ); - await queryRunner.query( - `CREATE TABLE "note_reaction" ("id" character varying(32) NOT NULL, "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL, "userId" character varying(32) NOT NULL, "noteId" character varying(32) NOT NULL, "reaction" character varying(128) NOT NULL, CONSTRAINT "PK_767ec729b108799b587a3fcc9cf" PRIMARY KEY ("id"))`, - ); - await queryRunner.query( - `CREATE INDEX "IDX_01f4581f114e0ebd2bbb876f0b" ON "note_reaction" ("createdAt") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_13761f64257f40c5636d0ff95e" ON "note_reaction" ("userId") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_45145e4953780f3cd5656f0ea6" ON "note_reaction" ("noteId") `, - ); - await queryRunner.query( - `CREATE UNIQUE INDEX "IDX_ad0c221b25672daf2df320a817" ON "note_reaction" ("userId", "noteId") `, - ); - await queryRunner.query( - `CREATE TABLE "note_watching" ("id" character varying(32) NOT NULL, "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL, "userId" character varying(32) NOT NULL, "noteId" character varying(32) NOT NULL, "noteUserId" character varying(32) NOT NULL, CONSTRAINT "PK_49286fdb23725945a74aa27d757" PRIMARY KEY ("id"))`, - ); - await queryRunner.query( - `CREATE INDEX "IDX_318cdf42a9cfc11f479bd802bb" ON "note_watching" ("createdAt") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_b0134ec406e8d09a540f818288" ON "note_watching" ("userId") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_03e7028ab8388a3f5e3ce2a861" ON "note_watching" ("noteId") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_44499765eec6b5489d72c4253b" ON "note_watching" ("noteUserId") `, - ); - await queryRunner.query( - `CREATE UNIQUE INDEX "IDX_a42c93c69989ce1d09959df4cf" ON "note_watching" ("userId", "noteId") `, - ); - await queryRunner.query( - `CREATE TABLE "note_unread" ("id" character varying(32) NOT NULL, "userId" character varying(32) NOT NULL, "noteId" character varying(32) NOT NULL, "noteUserId" character varying(32) NOT NULL, "isSpecified" boolean NOT NULL, CONSTRAINT "PK_1904eda61a784f57e6e51fa9c1f" PRIMARY KEY ("id"))`, - ); - await queryRunner.query( - `CREATE INDEX "IDX_56b0166d34ddae49d8ef7610bb" ON "note_unread" ("userId") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_e637cba4dc4410218c4251260e" ON "note_unread" ("noteId") `, - ); - await queryRunner.query( - `CREATE UNIQUE INDEX "IDX_d908433a4953cc13216cd9c274" ON "note_unread" ("userId", "noteId") `, - ); - await queryRunner.query( - `CREATE TABLE "notification" ("id" character varying(32) NOT NULL, "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL, "notifieeId" character varying(32) NOT NULL, "notifierId" character varying(32) NOT NULL, "type" character varying(32) NOT NULL, "isRead" boolean NOT NULL DEFAULT false, "noteId" character varying(32), "reaction" character varying(128), "choice" integer, CONSTRAINT "PK_705b6c7cdf9b2c2ff7ac7872cb7" PRIMARY KEY ("id"))`, - ); - await queryRunner.query( - `CREATE INDEX "IDX_b11a5e627c41d4dc3170f1d370" ON "notification" ("createdAt") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_3c601b70a1066d2c8b517094cb" ON "notification" ("notifieeId") `, - ); - await queryRunner.query( - `CREATE TABLE "meta" ("id" character varying(32) NOT NULL, "name" character varying(128), "description" character varying(1024), "maintainerName" character varying(128), "maintainerEmail" character varying(128), "announcements" jsonb NOT NULL DEFAULT '[]', "disableRegistration" boolean NOT NULL DEFAULT false, "disableLocalTimeline" boolean NOT NULL DEFAULT false, "disableGlobalTimeline" boolean NOT NULL DEFAULT false, "enableEmojiReaction" boolean NOT NULL DEFAULT true, "useStarForReactionFallback" boolean NOT NULL DEFAULT false, "langs" character varying(64) array NOT NULL DEFAULT '{}'::varchar[], "hiddenTags" character varying(256) array NOT NULL DEFAULT '{}'::varchar[], "blockedHosts" character varying(256) array NOT NULL DEFAULT '{}'::varchar[], "mascotImageUrl" character varying(512) DEFAULT '/static-assets/badges/info.png', "bannerUrl" character varying(512), "errorImageUrl" character varying(512) DEFAULT '/static-assets/badges/error.png', "iconUrl" character varying(512), "cacheRemoteFiles" boolean NOT NULL DEFAULT false, "proxyAccount" character varying(128), "enableRecaptcha" boolean NOT NULL DEFAULT false, "recaptchaSiteKey" character varying(64), "recaptchaSecretKey" character varying(64), "localDriveCapacityMb" integer NOT NULL DEFAULT 1024, "remoteDriveCapacityMb" integer NOT NULL DEFAULT 32, "maxNoteTextLength" integer NOT NULL DEFAULT 500, "summalyProxy" character varying(128), "enableEmail" boolean NOT NULL DEFAULT false, "email" character varying(128), "smtpSecure" boolean NOT NULL DEFAULT false, "smtpHost" character varying(128), "smtpPort" integer, "smtpUser" character varying(128), "smtpPass" character varying(128), "enableServiceWorker" boolean NOT NULL DEFAULT false, "swPublicKey" character varying(128), "swPrivateKey" character varying(128), "enableTwitterIntegration" boolean NOT NULL DEFAULT false, "twitterConsumerKey" character varying(128), "twitterConsumerSecret" character varying(128), "enableGithubIntegration" boolean NOT NULL DEFAULT false, "githubClientId" character varying(128), "githubClientSecret" character varying(128), "enableDiscordIntegration" boolean NOT NULL DEFAULT false, "discordClientId" character varying(128), "discordClientSecret" character varying(128), CONSTRAINT "PK_c4c17a6c2bd7651338b60fc590b" PRIMARY KEY ("id"))`, - ); - await queryRunner.query( - `CREATE TABLE "following" ("id" character varying(32) NOT NULL, "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL, "followeeId" character varying(32) NOT NULL, "followerId" character varying(32) NOT NULL, "followerHost" character varying(128), "followerInbox" character varying(512), "followerSharedInbox" character varying(512), "followeeHost" character varying(128), "followeeInbox" character varying(512), "followeeSharedInbox" character varying(512), CONSTRAINT "PK_c76c6e044bdf76ecf8bfb82a645" PRIMARY KEY ("id"))`, - ); - await queryRunner.query( - `CREATE INDEX "IDX_582f8fab771a9040a12961f3e7" ON "following" ("createdAt") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_24e0042143a18157b234df186c" ON "following" ("followeeId") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_6516c5a6f3c015b4eed39978be" ON "following" ("followerId") `, - ); - await queryRunner.query( - `CREATE UNIQUE INDEX "IDX_307be5f1d1252e0388662acb96" ON "following" ("followerId", "followeeId") `, - ); - await queryRunner.query( - `CREATE TABLE "instance" ("id" character varying(32) NOT NULL, "caughtAt" TIMESTAMP WITH TIME ZONE NOT NULL, "host" character varying(128) NOT NULL, "system" character varying(64), "usersCount" integer NOT NULL DEFAULT 0, "notesCount" integer NOT NULL DEFAULT 0, "followingCount" integer NOT NULL DEFAULT 0, "followersCount" integer NOT NULL DEFAULT 0, "driveUsage" integer NOT NULL DEFAULT 0, "driveFiles" integer NOT NULL DEFAULT 0, "latestRequestSentAt" TIMESTAMP WITH TIME ZONE, "latestStatus" integer, "latestRequestReceivedAt" TIMESTAMP WITH TIME ZONE, "lastCommunicatedAt" TIMESTAMP WITH TIME ZONE NOT NULL, "isNotResponding" boolean NOT NULL DEFAULT false, "isMarkedAsClosed" boolean NOT NULL DEFAULT false, CONSTRAINT "PK_eaf60e4a0c399c9935413e06474" PRIMARY KEY ("id"))`, - ); - await queryRunner.query( - `CREATE INDEX "IDX_2cd3b2a6b4cf0b910b260afe08" ON "instance" ("caughtAt") `, - ); - await queryRunner.query( - `CREATE UNIQUE INDEX "IDX_8d5afc98982185799b160e10eb" ON "instance" ("host") `, - ); - await queryRunner.query( - `CREATE TABLE "muting" ("id" character varying(32) NOT NULL, "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL, "muteeId" character varying(32) NOT NULL, "muterId" character varying(32) NOT NULL, CONSTRAINT "PK_2e92d06c8b5c602eeb27ca9ba48" PRIMARY KEY ("id"))`, - ); - await queryRunner.query( - `CREATE INDEX "IDX_f86d57fbca33c7a4e6897490cc" ON "muting" ("createdAt") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_ec96b4fed9dae517e0dbbe0675" ON "muting" ("muteeId") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_93060675b4a79a577f31d260c6" ON "muting" ("muterId") `, - ); - await queryRunner.query( - `CREATE UNIQUE INDEX "IDX_1eb9d9824a630321a29fd3b290" ON "muting" ("muterId", "muteeId") `, - ); - await queryRunner.query( - `CREATE TABLE "sw_subscription" ("id" character varying(32) NOT NULL, "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL, "userId" character varying(32) NOT NULL, "endpoint" character varying(512) NOT NULL, "auth" character varying(256) NOT NULL, "publickey" character varying(128) NOT NULL, CONSTRAINT "PK_e8f763631530051b95eb6279b91" PRIMARY KEY ("id"))`, - ); - await queryRunner.query( - `CREATE INDEX "IDX_97754ca6f2baff9b4abb7f853d" ON "sw_subscription" ("userId") `, - ); - await queryRunner.query( - `CREATE TABLE "blocking" ("id" character varying(32) NOT NULL, "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL, "blockeeId" character varying(32) NOT NULL, "blockerId" character varying(32) NOT NULL, CONSTRAINT "PK_e5d9a541cc1965ee7e048ea09dd" PRIMARY KEY ("id"))`, - ); - await queryRunner.query( - `CREATE INDEX "IDX_b9a354f7941c1e779f3b33aea6" ON "blocking" ("createdAt") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_2cd4a2743a99671308f5417759" ON "blocking" ("blockeeId") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_0627125f1a8a42c9a1929edb55" ON "blocking" ("blockerId") `, - ); - await queryRunner.query( - `CREATE UNIQUE INDEX "IDX_98a1bc5cb30dfd159de056549f" ON "blocking" ("blockerId", "blockeeId") `, - ); - await queryRunner.query( - `CREATE TABLE "user_list" ("id" character varying(32) NOT NULL, "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL, "userId" character varying(32) NOT NULL, "name" character varying(128) NOT NULL, CONSTRAINT "PK_87bab75775fd9b1ff822b656402" PRIMARY KEY ("id"))`, - ); - await queryRunner.query( - `CREATE INDEX "IDX_b7fcefbdd1c18dce86687531f9" ON "user_list" ("userId") `, - ); - await queryRunner.query( - `CREATE TABLE "user_list_joining" ("id" character varying(32) NOT NULL, "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL, "userId" character varying(32) NOT NULL, "userListId" character varying(32) NOT NULL, CONSTRAINT "PK_11abb3768da1c5f8de101c9df45" PRIMARY KEY ("id"))`, - ); - await queryRunner.query( - `CREATE INDEX "IDX_d844bfc6f3f523a05189076efa" ON "user_list_joining" ("userId") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_605472305f26818cc93d1baaa7" ON "user_list_joining" ("userListId") `, - ); - await queryRunner.query( - `CREATE TABLE "hashtag" ("id" character varying(32) NOT NULL, "name" character varying(128) NOT NULL, "mentionedUserIds" character varying(32) array NOT NULL, "mentionedUsersCount" integer NOT NULL DEFAULT 0, "mentionedLocalUserIds" character varying(32) array NOT NULL, "mentionedLocalUsersCount" integer NOT NULL DEFAULT 0, "mentionedRemoteUserIds" character varying(32) array NOT NULL, "mentionedRemoteUsersCount" integer NOT NULL DEFAULT 0, "attachedUserIds" character varying(32) array NOT NULL, "attachedUsersCount" integer NOT NULL DEFAULT 0, "attachedLocalUserIds" character varying(32) array NOT NULL, "attachedLocalUsersCount" integer NOT NULL DEFAULT 0, "attachedRemoteUserIds" character varying(32) array NOT NULL, "attachedRemoteUsersCount" integer NOT NULL DEFAULT 0, CONSTRAINT "PK_cb36eb8af8412bfa978f1165d78" PRIMARY KEY ("id"))`, - ); - await queryRunner.query( - `CREATE UNIQUE INDEX "IDX_347fec870eafea7b26c8a73bac" ON "hashtag" ("name") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_2710a55f826ee236ea1a62698f" ON "hashtag" ("mentionedUsersCount") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_0e206cec573f1edff4a3062923" ON "hashtag" ("mentionedLocalUsersCount") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_4c02d38a976c3ae132228c6fce" ON "hashtag" ("mentionedRemoteUsersCount") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_d57f9030cd3af7f63ffb1c267c" ON "hashtag" ("attachedUsersCount") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_0c44bf4f680964145f2a68a341" ON "hashtag" ("attachedLocalUsersCount") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_0b03cbcd7e6a7ce068efa8ecc2" ON "hashtag" ("attachedRemoteUsersCount") `, - ); - await queryRunner.query( - `CREATE TABLE "note_favorite" ("id" character varying(32) NOT NULL, "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL, "userId" character varying(32) NOT NULL, "noteId" character varying(32) NOT NULL, CONSTRAINT "PK_af0da35a60b9fa4463a62082b36" PRIMARY KEY ("id"))`, - ); - await queryRunner.query( - `CREATE INDEX "IDX_47f4b1892f5d6ba8efb3057d81" ON "note_favorite" ("userId") `, - ); - await queryRunner.query( - `CREATE UNIQUE INDEX "IDX_0f4fb9ad355f3effff221ef245" ON "note_favorite" ("userId", "noteId") `, - ); - await queryRunner.query( - `CREATE TABLE "abuse_user_report" ("id" character varying(32) NOT NULL, "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL, "userId" character varying(32) NOT NULL, "reporterId" character varying(32) NOT NULL, "comment" character varying(512) NOT NULL, CONSTRAINT "PK_87873f5f5cc5c321a1306b2d18c" PRIMARY KEY ("id"))`, - ); - await queryRunner.query( - `CREATE INDEX "IDX_db2098070b2b5a523c58181f74" ON "abuse_user_report" ("createdAt") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_d049123c413e68ca52abe73420" ON "abuse_user_report" ("userId") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_04cc96756f89d0b7f9473e8cdf" ON "abuse_user_report" ("reporterId") `, - ); - await queryRunner.query( - `CREATE UNIQUE INDEX "IDX_5cd442c3b2e74fdd99dae20243" ON "abuse_user_report" ("userId", "reporterId") `, - ); - await queryRunner.query( - `CREATE TABLE "registration_ticket" ("id" character varying(32) NOT NULL, "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL, "code" character varying(64) NOT NULL, CONSTRAINT "PK_f11696b6fafcf3662d4292734f8" PRIMARY KEY ("id"))`, - ); - await queryRunner.query( - `CREATE UNIQUE INDEX "IDX_0ff69e8dfa9fe31bb4a4660f59" ON "registration_ticket" ("code") `, - ); - await queryRunner.query( - `CREATE TABLE "messaging_message" ("id" character varying(32) NOT NULL, "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL, "userId" character varying(32) NOT NULL, "recipientId" character varying(32) NOT NULL, "text" character varying(4096), "isRead" boolean NOT NULL DEFAULT false, "fileId" character varying(32), CONSTRAINT "PK_db398fd79dc95d0eb8c30456eaa" PRIMARY KEY ("id"))`, - ); - await queryRunner.query( - `CREATE INDEX "IDX_e21cd3646e52ef9c94aaf17c2e" ON "messaging_message" ("createdAt") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_5377c307783fce2b6d352e1203" ON "messaging_message" ("userId") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_cac14a4e3944454a5ce7daa514" ON "messaging_message" ("recipientId") `, - ); - await queryRunner.query( - `CREATE TABLE "signin" ("id" character varying(32) NOT NULL, "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL, "userId" character varying(32) NOT NULL, "ip" character varying(128) NOT NULL, "headers" jsonb NOT NULL, "success" boolean NOT NULL, CONSTRAINT "PK_9e96ddc025712616fc492b3b588" PRIMARY KEY ("id"))`, - ); - await queryRunner.query( - `CREATE INDEX "IDX_2c308dbdc50d94dc625670055f" ON "signin" ("userId") `, - ); - await queryRunner.query( - `CREATE TABLE "auth_session" ("id" character varying(32) NOT NULL, "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL, "token" character varying(128) NOT NULL, "userId" character varying(32), "appId" character varying(32) NOT NULL, CONSTRAINT "PK_19354ed146424a728c1112a8cbf" PRIMARY KEY ("id"))`, - ); - await queryRunner.query( - `CREATE INDEX "IDX_62cb09e1129f6ec024ef66e183" ON "auth_session" ("token") `, - ); - await queryRunner.query( - `CREATE TABLE "follow_request" ("id" character varying(32) NOT NULL, "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL, "followeeId" character varying(32) NOT NULL, "followerId" character varying(32) NOT NULL, "requestId" character varying(128), "followerHost" character varying(128), "followerInbox" character varying(512), "followerSharedInbox" character varying(512), "followeeHost" character varying(128), "followeeInbox" character varying(512), "followeeSharedInbox" character varying(512), CONSTRAINT "PK_53a9aa3725f7a3deb150b39dbfc" PRIMARY KEY ("id"))`, - ); - await queryRunner.query( - `CREATE INDEX "IDX_12c01c0d1a79f77d9f6c15fadd" ON "follow_request" ("followeeId") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_a7fd92dd6dc519e6fb435dd108" ON "follow_request" ("followerId") `, - ); - await queryRunner.query( - `CREATE UNIQUE INDEX "IDX_d54a512b822fac7ed52800f6b4" ON "follow_request" ("followerId", "followeeId") `, - ); - await queryRunner.query( - `CREATE TABLE "emoji" ("id" character varying(32) NOT NULL, "updatedAt" TIMESTAMP WITH TIME ZONE, "name" character varying(128) NOT NULL, "host" character varying(128), "url" character varying(512) NOT NULL, "uri" character varying(512), "type" character varying(64), "aliases" character varying(128) array NOT NULL DEFAULT '{}'::varchar[], CONSTRAINT "PK_df74ce05e24999ee01ea0bc50a3" PRIMARY KEY ("id"))`, - ); - await queryRunner.query( - `CREATE INDEX "IDX_b37dafc86e9af007e3295c2781" ON "emoji" ("name") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_5900e907bb46516ddf2871327c" ON "emoji" ("host") `, - ); - await queryRunner.query( - `CREATE UNIQUE INDEX "IDX_4f4d35e1256c84ae3d1f0eab10" ON "emoji" ("name", "host") `, - ); - await queryRunner.query( - `CREATE TABLE "reversi_game" ("id" character varying(32) NOT NULL, "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL, "startedAt" TIMESTAMP WITH TIME ZONE, "user1Id" character varying(32) NOT NULL, "user2Id" character varying(32) NOT NULL, "user1Accepted" boolean NOT NULL DEFAULT false, "user2Accepted" boolean NOT NULL DEFAULT false, "black" integer, "isStarted" boolean NOT NULL DEFAULT false, "isEnded" boolean NOT NULL DEFAULT false, "winnerId" character varying(32), "surrendered" character varying(32), "logs" jsonb NOT NULL DEFAULT '[]', "map" character varying(64) array NOT NULL, "bw" character varying(32) NOT NULL, "isLlotheo" boolean NOT NULL DEFAULT false, "canPutEverywhere" boolean NOT NULL DEFAULT false, "loopedBoard" boolean NOT NULL DEFAULT false, "form1" jsonb DEFAULT null, "form2" jsonb DEFAULT null, "crc32" character varying(32), CONSTRAINT "PK_76b30eeba71b1193ad7c5311c3f" PRIMARY KEY ("id"))`, - ); - await queryRunner.query( - `CREATE INDEX "IDX_b46ec40746efceac604142be1c" ON "reversi_game" ("createdAt") `, - ); - await queryRunner.query( - `CREATE TABLE "reversi_matching" ("id" character varying(32) NOT NULL, "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL, "parentId" character varying(32) NOT NULL, "childId" character varying(32) NOT NULL, CONSTRAINT "PK_880bd0afbab232f21c8b9d146cf" PRIMARY KEY ("id"))`, - ); - await queryRunner.query( - `CREATE INDEX "IDX_b604d92d6c7aec38627f6eaf16" ON "reversi_matching" ("createdAt") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_3b25402709dd9882048c2bbade" ON "reversi_matching" ("parentId") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_e247b23a3c9b45f89ec1299d06" ON "reversi_matching" ("childId") `, - ); - await queryRunner.query( - `CREATE TABLE "user_note_pining" ("id" character varying(32) NOT NULL, "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL, "userId" character varying(32) NOT NULL, "noteId" character varying(32) NOT NULL, CONSTRAINT "PK_a6a2dad4ae000abce2ea9d9b103" PRIMARY KEY ("id"))`, - ); - await queryRunner.query( - `CREATE INDEX "IDX_bfbc6f79ba4007b4ce5097f08d" ON "user_note_pining" ("userId") `, - ); - await queryRunner.query( - `CREATE UNIQUE INDEX "IDX_410cd649884b501c02d6e72738" ON "user_note_pining" ("userId", "noteId") `, - ); - await queryRunner.query( - `CREATE TYPE "poll_notevisibility_enum" AS ENUM('public', 'home', 'followers', 'specified')`, - ); - await queryRunner.query( - `CREATE TABLE "poll" ("noteId" character varying(32) NOT NULL, "expiresAt" TIMESTAMP WITH TIME ZONE, "multiple" boolean NOT NULL, "choices" character varying(128) array NOT NULL DEFAULT '{}'::varchar[], "votes" integer array NOT NULL, "noteVisibility" "poll_notevisibility_enum" NOT NULL, "userId" character varying(32) NOT NULL, "userHost" character varying(128), CONSTRAINT "REL_da851e06d0dfe2ef397d8b1bf1" UNIQUE ("noteId"), CONSTRAINT "PK_da851e06d0dfe2ef397d8b1bf1b" PRIMARY KEY ("noteId"))`, - ); - await queryRunner.query( - `CREATE INDEX "IDX_0610ebcfcfb4a18441a9bcdab2" ON "poll" ("userId") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_7fa20a12319c7f6dc3aed98c0a" ON "poll" ("userHost") `, - ); - await queryRunner.query( - `CREATE TABLE "user_keypair" ("userId" character varying(32) NOT NULL, "publicKey" character varying(4096) NOT NULL, "privateKey" character varying(4096) NOT NULL, CONSTRAINT "REL_f4853eb41ab722fe05f81cedeb" UNIQUE ("userId"), CONSTRAINT "PK_f4853eb41ab722fe05f81cedeb6" PRIMARY KEY ("userId"))`, - ); - await queryRunner.query( - `CREATE TABLE "user_publickey" ("userId" character varying(32) NOT NULL, "keyId" character varying(256) NOT NULL, "keyPem" character varying(4096) NOT NULL, CONSTRAINT "REL_10c146e4b39b443ede016f6736" UNIQUE ("userId"), CONSTRAINT "PK_10c146e4b39b443ede016f6736d" PRIMARY KEY ("userId"))`, - ); - await queryRunner.query( - `CREATE UNIQUE INDEX "IDX_171e64971c780ebd23fae140bb" ON "user_publickey" ("keyId") `, - ); - await queryRunner.query( - `CREATE TABLE "user_profile" ("userId" character varying(32) NOT NULL, "location" character varying(128), "birthday" character(10), "description" character varying(1024), "fields" jsonb NOT NULL DEFAULT '[]', "url" character varying(512), "email" character varying(128), "emailVerifyCode" character varying(128), "emailVerified" boolean NOT NULL DEFAULT false, "twoFactorTempSecret" character varying(128), "twoFactorSecret" character varying(128), "twoFactorEnabled" boolean NOT NULL DEFAULT false, "password" character varying(128), "clientData" jsonb NOT NULL DEFAULT '{}', "autoWatch" boolean NOT NULL DEFAULT false, "autoAcceptFollowed" boolean NOT NULL DEFAULT false, "alwaysMarkNsfw" boolean NOT NULL DEFAULT false, "carefulBot" boolean NOT NULL DEFAULT false, "twitter" boolean NOT NULL DEFAULT false, "twitterAccessToken" character varying(64) DEFAULT null, "twitterAccessTokenSecret" character varying(64) DEFAULT null, "twitterUserId" character varying(64) DEFAULT null, "twitterScreenName" character varying(64) DEFAULT null, "github" boolean NOT NULL DEFAULT false, "githubAccessToken" character varying(64) DEFAULT null, "githubId" integer DEFAULT null, "githubLogin" character varying(64) DEFAULT null, "discord" boolean NOT NULL DEFAULT false, "discordAccessToken" character varying(64) DEFAULT null, "discordRefreshToken" character varying(64) DEFAULT null, "discordExpiresDate" integer DEFAULT null, "discordId" character varying(64) DEFAULT null, "discordUsername" character varying(64) DEFAULT null, "discordDiscriminator" character varying(64) DEFAULT null, "userHost" character varying(128), CONSTRAINT "REL_51cb79b5555effaf7d69ba1cff" UNIQUE ("userId"), CONSTRAINT "PK_51cb79b5555effaf7d69ba1cff9" PRIMARY KEY ("userId"))`, - ); - await queryRunner.query( - `CREATE INDEX "IDX_dce530b98e454793dac5ec2f5a" ON "user_profile" ("userHost") `, - ); - await queryRunner.query( - `CREATE TYPE "__chart__active_users_span_enum" AS ENUM('hour', 'day')`, - ); - await queryRunner.query( - `CREATE TABLE "__chart__active_users" ("id" SERIAL NOT NULL, "date" integer NOT NULL, "group" character varying(128), "span" "__chart__active_users_span_enum" NOT NULL, "unique" jsonb NOT NULL DEFAULT '{}', "___local_count" bigint NOT NULL, "___remote_count" bigint NOT NULL, CONSTRAINT "PK_317237a9f733b970604a11e314f" PRIMARY KEY ("id"))`, - ); - await queryRunner.query( - `CREATE TYPE "__chart__drive_span_enum" AS ENUM('hour', 'day')`, - ); - await queryRunner.query( - `CREATE TABLE "__chart__drive" ("id" SERIAL NOT NULL, "date" integer NOT NULL, "group" character varying(128), "span" "__chart__drive_span_enum" NOT NULL, "unique" jsonb NOT NULL DEFAULT '{}', "___local_totalCount" bigint NOT NULL, "___local_totalSize" bigint NOT NULL, "___local_incCount" bigint NOT NULL, "___local_incSize" bigint NOT NULL, "___local_decCount" bigint NOT NULL, "___local_decSize" bigint NOT NULL, "___remote_totalCount" bigint NOT NULL, "___remote_totalSize" bigint NOT NULL, "___remote_incCount" bigint NOT NULL, "___remote_incSize" bigint NOT NULL, "___remote_decCount" bigint NOT NULL, "___remote_decSize" bigint NOT NULL, CONSTRAINT "PK_f96bc548a765cd4b3b354221ce7" PRIMARY KEY ("id"))`, - ); - await queryRunner.query( - `CREATE TYPE "__chart__federation_span_enum" AS ENUM('hour', 'day')`, - ); - await queryRunner.query( - `CREATE TABLE "__chart__federation" ("id" SERIAL NOT NULL, "date" integer NOT NULL, "group" character varying(128), "span" "__chart__federation_span_enum" NOT NULL, "unique" jsonb NOT NULL DEFAULT '{}', "___instance_total" bigint NOT NULL, "___instance_inc" bigint NOT NULL, "___instance_dec" bigint NOT NULL, CONSTRAINT "PK_b39dcd31a0fe1a7757e348e85fd" PRIMARY KEY ("id"))`, - ); - await queryRunner.query( - `CREATE TYPE "__chart__hashtag_span_enum" AS ENUM('hour', 'day')`, - ); - await queryRunner.query( - `CREATE TABLE "__chart__hashtag" ("id" SERIAL NOT NULL, "date" integer NOT NULL, "group" character varying(128), "span" "__chart__hashtag_span_enum" NOT NULL, "unique" jsonb NOT NULL DEFAULT '{}', "___local_count" bigint NOT NULL, "___remote_count" bigint NOT NULL, CONSTRAINT "PK_c32f1ea2b44a5d2f7881e37f8f9" PRIMARY KEY ("id"))`, - ); - await queryRunner.query( - `CREATE TYPE "__chart__instance_span_enum" AS ENUM('hour', 'day')`, - ); - await queryRunner.query( - `CREATE TABLE "__chart__instance" ("id" SERIAL NOT NULL, "date" integer NOT NULL, "group" character varying(128), "span" "__chart__instance_span_enum" NOT NULL, "unique" jsonb NOT NULL DEFAULT '{}', "___requests_failed" bigint NOT NULL, "___requests_succeeded" bigint NOT NULL, "___requests_received" bigint NOT NULL, "___notes_total" bigint NOT NULL, "___notes_inc" bigint NOT NULL, "___notes_dec" bigint NOT NULL, "___notes_diffs_normal" bigint NOT NULL, "___notes_diffs_reply" bigint NOT NULL, "___notes_diffs_renote" bigint NOT NULL, "___users_total" bigint NOT NULL, "___users_inc" bigint NOT NULL, "___users_dec" bigint NOT NULL, "___following_total" bigint NOT NULL, "___following_inc" bigint NOT NULL, "___following_dec" bigint NOT NULL, "___followers_total" bigint NOT NULL, "___followers_inc" bigint NOT NULL, "___followers_dec" bigint NOT NULL, "___drive_totalFiles" bigint NOT NULL, "___drive_totalUsage" bigint NOT NULL, "___drive_incFiles" bigint NOT NULL, "___drive_incUsage" bigint NOT NULL, "___drive_decFiles" bigint NOT NULL, "___drive_decUsage" bigint NOT NULL, CONSTRAINT "PK_1267c67c7c2d47b4903975f2c00" PRIMARY KEY ("id"))`, - ); - await queryRunner.query( - `CREATE TYPE "__chart__network_span_enum" AS ENUM('hour', 'day')`, - ); - await queryRunner.query( - `CREATE TABLE "__chart__network" ("id" SERIAL NOT NULL, "date" integer NOT NULL, "group" character varying(128), "span" "__chart__network_span_enum" NOT NULL, "unique" jsonb NOT NULL DEFAULT '{}', "___incomingRequests" bigint NOT NULL, "___outgoingRequests" bigint NOT NULL, "___totalTime" bigint NOT NULL, "___incomingBytes" bigint NOT NULL, "___outgoingBytes" bigint NOT NULL, CONSTRAINT "PK_bc4290c2e27fad14ef0c1ca93f3" PRIMARY KEY ("id"))`, - ); - await queryRunner.query( - `CREATE TYPE "__chart__notes_span_enum" AS ENUM('hour', 'day')`, - ); - await queryRunner.query( - `CREATE TABLE "__chart__notes" ("id" SERIAL NOT NULL, "date" integer NOT NULL, "group" character varying(128), "span" "__chart__notes_span_enum" NOT NULL, "unique" jsonb NOT NULL DEFAULT '{}', "___local_total" bigint NOT NULL, "___local_inc" bigint NOT NULL, "___local_dec" bigint NOT NULL, "___local_diffs_normal" bigint NOT NULL, "___local_diffs_reply" bigint NOT NULL, "___local_diffs_renote" bigint NOT NULL, "___remote_total" bigint NOT NULL, "___remote_inc" bigint NOT NULL, "___remote_dec" bigint NOT NULL, "___remote_diffs_normal" bigint NOT NULL, "___remote_diffs_reply" bigint NOT NULL, "___remote_diffs_renote" bigint NOT NULL, CONSTRAINT "PK_0aec823fa85c7f901bdb3863b14" PRIMARY KEY ("id"))`, - ); - await queryRunner.query( - `CREATE TYPE "__chart__per_user_drive_span_enum" AS ENUM('hour', 'day')`, - ); - await queryRunner.query( - `CREATE TABLE "__chart__per_user_drive" ("id" SERIAL NOT NULL, "date" integer NOT NULL, "group" character varying(128), "span" "__chart__per_user_drive_span_enum" NOT NULL, "unique" jsonb NOT NULL DEFAULT '{}', "___totalCount" bigint NOT NULL, "___totalSize" bigint NOT NULL, "___incCount" bigint NOT NULL, "___incSize" bigint NOT NULL, "___decCount" bigint NOT NULL, "___decSize" bigint NOT NULL, CONSTRAINT "PK_d0ef23d24d666e1a44a0cd3d208" PRIMARY KEY ("id"))`, - ); - await queryRunner.query( - `CREATE TYPE "__chart__per_user_following_span_enum" AS ENUM('hour', 'day')`, - ); - await queryRunner.query( - `CREATE TABLE "__chart__per_user_following" ("id" SERIAL NOT NULL, "date" integer NOT NULL, "group" character varying(128), "span" "__chart__per_user_following_span_enum" NOT NULL, "unique" jsonb NOT NULL DEFAULT '{}', "___local_followings_total" bigint NOT NULL, "___local_followings_inc" bigint NOT NULL, "___local_followings_dec" bigint NOT NULL, "___local_followers_total" bigint NOT NULL, "___local_followers_inc" bigint NOT NULL, "___local_followers_dec" bigint NOT NULL, "___remote_followings_total" bigint NOT NULL, "___remote_followings_inc" bigint NOT NULL, "___remote_followings_dec" bigint NOT NULL, "___remote_followers_total" bigint NOT NULL, "___remote_followers_inc" bigint NOT NULL, "___remote_followers_dec" bigint NOT NULL, CONSTRAINT "PK_85bb1b540363a29c2fec83bd907" PRIMARY KEY ("id"))`, - ); - await queryRunner.query( - `CREATE TYPE "__chart__per_user_notes_span_enum" AS ENUM('hour', 'day')`, - ); - await queryRunner.query( - `CREATE TABLE "__chart__per_user_notes" ("id" SERIAL NOT NULL, "date" integer NOT NULL, "group" character varying(128), "span" "__chart__per_user_notes_span_enum" NOT NULL, "unique" jsonb NOT NULL DEFAULT '{}', "___total" bigint NOT NULL, "___inc" bigint NOT NULL, "___dec" bigint NOT NULL, "___diffs_normal" bigint NOT NULL, "___diffs_reply" bigint NOT NULL, "___diffs_renote" bigint NOT NULL, CONSTRAINT "PK_334acf6e915af2f29edc11b8e50" PRIMARY KEY ("id"))`, - ); - await queryRunner.query( - `CREATE TYPE "__chart__per_user_reaction_span_enum" AS ENUM('hour', 'day')`, - ); - await queryRunner.query( - `CREATE TABLE "__chart__per_user_reaction" ("id" SERIAL NOT NULL, "date" integer NOT NULL, "group" character varying(128), "span" "__chart__per_user_reaction_span_enum" NOT NULL, "unique" jsonb NOT NULL DEFAULT '{}', "___local_count" bigint NOT NULL, "___remote_count" bigint NOT NULL, CONSTRAINT "PK_984f54dae441e65b633e8d27a7f" PRIMARY KEY ("id"))`, - ); - await queryRunner.query( - `CREATE TYPE "__chart__test_grouped_span_enum" AS ENUM('hour', 'day')`, - ); - await queryRunner.query( - `CREATE TABLE "__chart__test_grouped" ("id" SERIAL NOT NULL, "date" integer NOT NULL, "group" character varying(128), "span" "__chart__test_grouped_span_enum" NOT NULL, "unique" jsonb NOT NULL DEFAULT '{}', "___foo_total" bigint NOT NULL, "___foo_inc" bigint NOT NULL, "___foo_dec" bigint NOT NULL, CONSTRAINT "PK_f4a2b175d308695af30d4293272" PRIMARY KEY ("id"))`, - ); - await queryRunner.query( - `CREATE TYPE "__chart__test_unique_span_enum" AS ENUM('hour', 'day')`, - ); - await queryRunner.query( - `CREATE TABLE "__chart__test_unique" ("id" SERIAL NOT NULL, "date" integer NOT NULL, "group" character varying(128), "span" "__chart__test_unique_span_enum" NOT NULL, "unique" jsonb NOT NULL DEFAULT '{}', "___foo" bigint NOT NULL, CONSTRAINT "PK_409bac9c97cc612d8500012319d" PRIMARY KEY ("id"))`, - ); - await queryRunner.query( - `CREATE TYPE "__chart__test_span_enum" AS ENUM('hour', 'day')`, - ); - await queryRunner.query( - `CREATE TABLE "__chart__test" ("id" SERIAL NOT NULL, "date" integer NOT NULL, "group" character varying(128), "span" "__chart__test_span_enum" NOT NULL, "unique" jsonb NOT NULL DEFAULT '{}', "___foo_total" bigint NOT NULL, "___foo_inc" bigint NOT NULL, "___foo_dec" bigint NOT NULL, CONSTRAINT "PK_b4bc31dffbd1b785276a3ecfc1e" PRIMARY KEY ("id"))`, - ); - await queryRunner.query( - `CREATE TYPE "__chart__users_span_enum" AS ENUM('hour', 'day')`, - ); - await queryRunner.query( - `CREATE TABLE "__chart__users" ("id" SERIAL NOT NULL, "date" integer NOT NULL, "group" character varying(128), "span" "__chart__users_span_enum" NOT NULL, "unique" jsonb NOT NULL DEFAULT '{}', "___local_total" bigint NOT NULL, "___local_inc" bigint NOT NULL, "___local_dec" bigint NOT NULL, "___remote_total" bigint NOT NULL, "___remote_inc" bigint NOT NULL, "___remote_dec" bigint NOT NULL, CONSTRAINT "PK_4dfcf2c78d03524b9eb2c99d328" PRIMARY KEY ("id"))`, - ); - await queryRunner.query( - `ALTER TABLE "drive_folder" ADD CONSTRAINT "FK_f4fc06e49c0171c85f1c48060d2" FOREIGN KEY ("userId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, - ); - await queryRunner.query( - `ALTER TABLE "drive_folder" ADD CONSTRAINT "FK_00ceffb0cdc238b3233294f08f2" FOREIGN KEY ("parentId") REFERENCES "drive_folder"("id") ON DELETE SET NULL ON UPDATE NO ACTION`, - ); - await queryRunner.query( - `ALTER TABLE "drive_file" ADD CONSTRAINT "FK_860fa6f6c7df5bb887249fba22e" FOREIGN KEY ("userId") REFERENCES "user"("id") ON DELETE SET NULL ON UPDATE NO ACTION`, - ); - await queryRunner.query( - `ALTER TABLE "drive_file" ADD CONSTRAINT "FK_bb90d1956dafc4068c28aa7560a" FOREIGN KEY ("folderId") REFERENCES "drive_folder"("id") ON DELETE SET NULL ON UPDATE NO ACTION`, - ); - await queryRunner.query( - `ALTER TABLE "user" ADD CONSTRAINT "FK_58f5c71eaab331645112cf8cfa5" FOREIGN KEY ("avatarId") REFERENCES "drive_file"("id") ON DELETE SET NULL ON UPDATE NO ACTION`, - ); - await queryRunner.query( - `ALTER TABLE "user" ADD CONSTRAINT "FK_afc64b53f8db3707ceb34eb28e2" FOREIGN KEY ("bannerId") REFERENCES "drive_file"("id") ON DELETE SET NULL ON UPDATE NO ACTION`, - ); - await queryRunner.query( - `ALTER TABLE "app" ADD CONSTRAINT "FK_3f5b0899ef90527a3462d7c2cb3" FOREIGN KEY ("userId") REFERENCES "user"("id") ON DELETE SET NULL ON UPDATE NO ACTION`, - ); - await queryRunner.query( - `ALTER TABLE "access_token" ADD CONSTRAINT "FK_9949557d0e1b2c19e5344c171e9" FOREIGN KEY ("userId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, - ); - await queryRunner.query( - `ALTER TABLE "access_token" ADD CONSTRAINT "FK_a3ff16c90cc87a82a0b5959e560" FOREIGN KEY ("appId") REFERENCES "app"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, - ); - await queryRunner.query( - `ALTER TABLE "note" ADD CONSTRAINT "FK_17cb3553c700a4985dff5a30ff5" FOREIGN KEY ("replyId") REFERENCES "note"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, - ); - await queryRunner.query( - `ALTER TABLE "note" ADD CONSTRAINT "FK_52ccc804d7c69037d558bac4c96" FOREIGN KEY ("renoteId") REFERENCES "note"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, - ); - await queryRunner.query( - `ALTER TABLE "note" ADD CONSTRAINT "FK_ec5c201576192ba8904c345c5cc" FOREIGN KEY ("appId") REFERENCES "app"("id") ON DELETE SET NULL ON UPDATE NO ACTION`, - ); - await queryRunner.query( - `ALTER TABLE "note" ADD CONSTRAINT "FK_5b87d9d19127bd5d92026017a7b" FOREIGN KEY ("userId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, - ); - await queryRunner.query( - `ALTER TABLE "poll_vote" ADD CONSTRAINT "FK_66d2bd2ee31d14bcc23069a89f8" FOREIGN KEY ("userId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, - ); - await queryRunner.query( - `ALTER TABLE "poll_vote" ADD CONSTRAINT "FK_aecfbd5ef60374918e63ee95fa7" FOREIGN KEY ("noteId") REFERENCES "note"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, - ); - await queryRunner.query( - `ALTER TABLE "note_reaction" ADD CONSTRAINT "FK_13761f64257f40c5636d0ff95ee" FOREIGN KEY ("userId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, - ); - await queryRunner.query( - `ALTER TABLE "note_reaction" ADD CONSTRAINT "FK_45145e4953780f3cd5656f0ea6a" FOREIGN KEY ("noteId") REFERENCES "note"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, - ); - await queryRunner.query( - `ALTER TABLE "note_watching" ADD CONSTRAINT "FK_b0134ec406e8d09a540f8182888" FOREIGN KEY ("userId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, - ); - await queryRunner.query( - `ALTER TABLE "note_watching" ADD CONSTRAINT "FK_03e7028ab8388a3f5e3ce2a8619" FOREIGN KEY ("noteId") REFERENCES "note"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, - ); - await queryRunner.query( - `ALTER TABLE "note_unread" ADD CONSTRAINT "FK_56b0166d34ddae49d8ef7610bb9" FOREIGN KEY ("userId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, - ); - await queryRunner.query( - `ALTER TABLE "note_unread" ADD CONSTRAINT "FK_e637cba4dc4410218c4251260e4" FOREIGN KEY ("noteId") REFERENCES "note"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, - ); - await queryRunner.query( - `ALTER TABLE "notification" ADD CONSTRAINT "FK_3c601b70a1066d2c8b517094cb9" FOREIGN KEY ("notifieeId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, - ); - await queryRunner.query( - `ALTER TABLE "notification" ADD CONSTRAINT "FK_3b4e96eec8d36a8bbb9d02aa710" FOREIGN KEY ("notifierId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, - ); - await queryRunner.query( - `ALTER TABLE "notification" ADD CONSTRAINT "FK_769cb6b73a1efe22ddf733ac453" FOREIGN KEY ("noteId") REFERENCES "note"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, - ); - await queryRunner.query( - `ALTER TABLE "following" ADD CONSTRAINT "FK_24e0042143a18157b234df186c3" FOREIGN KEY ("followeeId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, - ); - await queryRunner.query( - `ALTER TABLE "following" ADD CONSTRAINT "FK_6516c5a6f3c015b4eed39978be5" FOREIGN KEY ("followerId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, - ); - await queryRunner.query( - `ALTER TABLE "muting" ADD CONSTRAINT "FK_ec96b4fed9dae517e0dbbe0675c" FOREIGN KEY ("muteeId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, - ); - await queryRunner.query( - `ALTER TABLE "muting" ADD CONSTRAINT "FK_93060675b4a79a577f31d260c67" FOREIGN KEY ("muterId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, - ); - await queryRunner.query( - `ALTER TABLE "sw_subscription" ADD CONSTRAINT "FK_97754ca6f2baff9b4abb7f853dd" FOREIGN KEY ("userId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, - ); - await queryRunner.query( - `ALTER TABLE "blocking" ADD CONSTRAINT "FK_2cd4a2743a99671308f5417759e" FOREIGN KEY ("blockeeId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, - ); - await queryRunner.query( - `ALTER TABLE "blocking" ADD CONSTRAINT "FK_0627125f1a8a42c9a1929edb552" FOREIGN KEY ("blockerId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, - ); - await queryRunner.query( - `ALTER TABLE "user_list" ADD CONSTRAINT "FK_b7fcefbdd1c18dce86687531f99" FOREIGN KEY ("userId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, - ); - await queryRunner.query( - `ALTER TABLE "user_list_joining" ADD CONSTRAINT "FK_d844bfc6f3f523a05189076efaa" FOREIGN KEY ("userId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, - ); - await queryRunner.query( - `ALTER TABLE "user_list_joining" ADD CONSTRAINT "FK_605472305f26818cc93d1baaa74" FOREIGN KEY ("userListId") REFERENCES "user_list"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, - ); - await queryRunner.query( - `ALTER TABLE "note_favorite" ADD CONSTRAINT "FK_47f4b1892f5d6ba8efb3057d81a" FOREIGN KEY ("userId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, - ); - await queryRunner.query( - `ALTER TABLE "note_favorite" ADD CONSTRAINT "FK_0e00498f180193423c992bc4370" FOREIGN KEY ("noteId") REFERENCES "note"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, - ); - await queryRunner.query( - `ALTER TABLE "abuse_user_report" ADD CONSTRAINT "FK_d049123c413e68ca52abe734203" FOREIGN KEY ("userId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, - ); - await queryRunner.query( - `ALTER TABLE "abuse_user_report" ADD CONSTRAINT "FK_04cc96756f89d0b7f9473e8cdf3" FOREIGN KEY ("reporterId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, - ); - await queryRunner.query( - `ALTER TABLE "messaging_message" ADD CONSTRAINT "FK_5377c307783fce2b6d352e1203b" FOREIGN KEY ("userId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, - ); - await queryRunner.query( - `ALTER TABLE "messaging_message" ADD CONSTRAINT "FK_cac14a4e3944454a5ce7daa5142" FOREIGN KEY ("recipientId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, - ); - await queryRunner.query( - `ALTER TABLE "messaging_message" ADD CONSTRAINT "FK_535def119223ac05ad3fa9ef64b" FOREIGN KEY ("fileId") REFERENCES "drive_file"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, - ); - await queryRunner.query( - `ALTER TABLE "signin" ADD CONSTRAINT "FK_2c308dbdc50d94dc625670055f7" FOREIGN KEY ("userId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, - ); - await queryRunner.query( - `ALTER TABLE "auth_session" ADD CONSTRAINT "FK_c072b729d71697f959bde66ade0" FOREIGN KEY ("userId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, - ); - await queryRunner.query( - `ALTER TABLE "auth_session" ADD CONSTRAINT "FK_dbe037d4bddd17b03a1dc778dee" FOREIGN KEY ("appId") REFERENCES "app"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, - ); - await queryRunner.query( - `ALTER TABLE "follow_request" ADD CONSTRAINT "FK_12c01c0d1a79f77d9f6c15fadd2" FOREIGN KEY ("followeeId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, - ); - await queryRunner.query( - `ALTER TABLE "follow_request" ADD CONSTRAINT "FK_a7fd92dd6dc519e6fb435dd108f" FOREIGN KEY ("followerId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, - ); - await queryRunner.query( - `ALTER TABLE "reversi_game" ADD CONSTRAINT "FK_f7467510c60a45ce5aca6292743" FOREIGN KEY ("user1Id") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, - ); - await queryRunner.query( - `ALTER TABLE "reversi_game" ADD CONSTRAINT "FK_6649a4e8c5d5cf32fb03b5da9f6" FOREIGN KEY ("user2Id") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, - ); - await queryRunner.query( - `ALTER TABLE "reversi_matching" ADD CONSTRAINT "FK_3b25402709dd9882048c2bbade0" FOREIGN KEY ("parentId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, - ); - await queryRunner.query( - `ALTER TABLE "reversi_matching" ADD CONSTRAINT "FK_e247b23a3c9b45f89ec1299d066" FOREIGN KEY ("childId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, - ); - await queryRunner.query( - `ALTER TABLE "user_note_pining" ADD CONSTRAINT "FK_bfbc6f79ba4007b4ce5097f08d6" FOREIGN KEY ("userId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, - ); - await queryRunner.query( - `ALTER TABLE "user_note_pining" ADD CONSTRAINT "FK_68881008f7c3588ad7ecae471cf" FOREIGN KEY ("noteId") REFERENCES "note"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, - ); - await queryRunner.query( - `ALTER TABLE "poll" ADD CONSTRAINT "FK_da851e06d0dfe2ef397d8b1bf1b" FOREIGN KEY ("noteId") REFERENCES "note"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, - ); - await queryRunner.query( - `ALTER TABLE "user_keypair" ADD CONSTRAINT "FK_f4853eb41ab722fe05f81cedeb6" FOREIGN KEY ("userId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, - ); - await queryRunner.query( - `ALTER TABLE "user_publickey" ADD CONSTRAINT "FK_10c146e4b39b443ede016f6736d" FOREIGN KEY ("userId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, - ); - await queryRunner.query( - `ALTER TABLE "user_profile" ADD CONSTRAINT "FK_51cb79b5555effaf7d69ba1cff9" FOREIGN KEY ("userId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, - ); - } - async down(queryRunner) { - await queryRunner.query( - `ALTER TABLE "user_profile" DROP CONSTRAINT "FK_51cb79b5555effaf7d69ba1cff9"`, - ); - await queryRunner.query( - `ALTER TABLE "user_publickey" DROP CONSTRAINT "FK_10c146e4b39b443ede016f6736d"`, - ); - await queryRunner.query( - `ALTER TABLE "user_keypair" DROP CONSTRAINT "FK_f4853eb41ab722fe05f81cedeb6"`, - ); - await queryRunner.query( - `ALTER TABLE "poll" DROP CONSTRAINT "FK_da851e06d0dfe2ef397d8b1bf1b"`, - ); - await queryRunner.query( - `ALTER TABLE "user_note_pining" DROP CONSTRAINT "FK_68881008f7c3588ad7ecae471cf"`, - ); - await queryRunner.query( - `ALTER TABLE "user_note_pining" DROP CONSTRAINT "FK_bfbc6f79ba4007b4ce5097f08d6"`, - ); - await queryRunner.query( - `ALTER TABLE "reversi_matching" DROP CONSTRAINT "FK_e247b23a3c9b45f89ec1299d066"`, - ); - await queryRunner.query( - `ALTER TABLE "reversi_matching" DROP CONSTRAINT "FK_3b25402709dd9882048c2bbade0"`, - ); - await queryRunner.query( - `ALTER TABLE "reversi_game" DROP CONSTRAINT "FK_6649a4e8c5d5cf32fb03b5da9f6"`, - ); - await queryRunner.query( - `ALTER TABLE "reversi_game" DROP CONSTRAINT "FK_f7467510c60a45ce5aca6292743"`, - ); - await queryRunner.query( - `ALTER TABLE "follow_request" DROP CONSTRAINT "FK_a7fd92dd6dc519e6fb435dd108f"`, - ); - await queryRunner.query( - `ALTER TABLE "follow_request" DROP CONSTRAINT "FK_12c01c0d1a79f77d9f6c15fadd2"`, - ); - await queryRunner.query( - `ALTER TABLE "auth_session" DROP CONSTRAINT "FK_dbe037d4bddd17b03a1dc778dee"`, - ); - await queryRunner.query( - `ALTER TABLE "auth_session" DROP CONSTRAINT "FK_c072b729d71697f959bde66ade0"`, - ); - await queryRunner.query( - `ALTER TABLE "signin" DROP CONSTRAINT "FK_2c308dbdc50d94dc625670055f7"`, - ); - await queryRunner.query( - `ALTER TABLE "messaging_message" DROP CONSTRAINT "FK_535def119223ac05ad3fa9ef64b"`, - ); - await queryRunner.query( - `ALTER TABLE "messaging_message" DROP CONSTRAINT "FK_cac14a4e3944454a5ce7daa5142"`, - ); - await queryRunner.query( - `ALTER TABLE "messaging_message" DROP CONSTRAINT "FK_5377c307783fce2b6d352e1203b"`, - ); - await queryRunner.query( - `ALTER TABLE "abuse_user_report" DROP CONSTRAINT "FK_04cc96756f89d0b7f9473e8cdf3"`, - ); - await queryRunner.query( - `ALTER TABLE "abuse_user_report" DROP CONSTRAINT "FK_d049123c413e68ca52abe734203"`, - ); - await queryRunner.query( - `ALTER TABLE "note_favorite" DROP CONSTRAINT "FK_0e00498f180193423c992bc4370"`, - ); - await queryRunner.query( - `ALTER TABLE "note_favorite" DROP CONSTRAINT "FK_47f4b1892f5d6ba8efb3057d81a"`, - ); - await queryRunner.query( - `ALTER TABLE "user_list_joining" DROP CONSTRAINT "FK_605472305f26818cc93d1baaa74"`, - ); - await queryRunner.query( - `ALTER TABLE "user_list_joining" DROP CONSTRAINT "FK_d844bfc6f3f523a05189076efaa"`, - ); - await queryRunner.query( - `ALTER TABLE "user_list" DROP CONSTRAINT "FK_b7fcefbdd1c18dce86687531f99"`, - ); - await queryRunner.query( - `ALTER TABLE "blocking" DROP CONSTRAINT "FK_0627125f1a8a42c9a1929edb552"`, - ); - await queryRunner.query( - `ALTER TABLE "blocking" DROP CONSTRAINT "FK_2cd4a2743a99671308f5417759e"`, - ); - await queryRunner.query( - `ALTER TABLE "sw_subscription" DROP CONSTRAINT "FK_97754ca6f2baff9b4abb7f853dd"`, - ); - await queryRunner.query( - `ALTER TABLE "muting" DROP CONSTRAINT "FK_93060675b4a79a577f31d260c67"`, - ); - await queryRunner.query( - `ALTER TABLE "muting" DROP CONSTRAINT "FK_ec96b4fed9dae517e0dbbe0675c"`, - ); - await queryRunner.query( - `ALTER TABLE "following" DROP CONSTRAINT "FK_6516c5a6f3c015b4eed39978be5"`, - ); - await queryRunner.query( - `ALTER TABLE "following" DROP CONSTRAINT "FK_24e0042143a18157b234df186c3"`, - ); - await queryRunner.query( - `ALTER TABLE "notification" DROP CONSTRAINT "FK_769cb6b73a1efe22ddf733ac453"`, - ); - await queryRunner.query( - `ALTER TABLE "notification" DROP CONSTRAINT "FK_3b4e96eec8d36a8bbb9d02aa710"`, - ); - await queryRunner.query( - `ALTER TABLE "notification" DROP CONSTRAINT "FK_3c601b70a1066d2c8b517094cb9"`, - ); - await queryRunner.query( - `ALTER TABLE "note_unread" DROP CONSTRAINT "FK_e637cba4dc4410218c4251260e4"`, - ); - await queryRunner.query( - `ALTER TABLE "note_unread" DROP CONSTRAINT "FK_56b0166d34ddae49d8ef7610bb9"`, - ); - await queryRunner.query( - `ALTER TABLE "note_watching" DROP CONSTRAINT "FK_03e7028ab8388a3f5e3ce2a8619"`, - ); - await queryRunner.query( - `ALTER TABLE "note_watching" DROP CONSTRAINT "FK_b0134ec406e8d09a540f8182888"`, - ); - await queryRunner.query( - `ALTER TABLE "note_reaction" DROP CONSTRAINT "FK_45145e4953780f3cd5656f0ea6a"`, - ); - await queryRunner.query( - `ALTER TABLE "note_reaction" DROP CONSTRAINT "FK_13761f64257f40c5636d0ff95ee"`, - ); - await queryRunner.query( - `ALTER TABLE "poll_vote" DROP CONSTRAINT "FK_aecfbd5ef60374918e63ee95fa7"`, - ); - await queryRunner.query( - `ALTER TABLE "poll_vote" DROP CONSTRAINT "FK_66d2bd2ee31d14bcc23069a89f8"`, - ); - await queryRunner.query( - `ALTER TABLE "note" DROP CONSTRAINT "FK_5b87d9d19127bd5d92026017a7b"`, - ); - await queryRunner.query( - `ALTER TABLE "note" DROP CONSTRAINT "FK_ec5c201576192ba8904c345c5cc"`, - ); - await queryRunner.query( - `ALTER TABLE "note" DROP CONSTRAINT "FK_52ccc804d7c69037d558bac4c96"`, - ); - await queryRunner.query( - `ALTER TABLE "note" DROP CONSTRAINT "FK_17cb3553c700a4985dff5a30ff5"`, - ); - await queryRunner.query( - `ALTER TABLE "access_token" DROP CONSTRAINT "FK_a3ff16c90cc87a82a0b5959e560"`, - ); - await queryRunner.query( - `ALTER TABLE "access_token" DROP CONSTRAINT "FK_9949557d0e1b2c19e5344c171e9"`, - ); - await queryRunner.query( - `ALTER TABLE "app" DROP CONSTRAINT "FK_3f5b0899ef90527a3462d7c2cb3"`, - ); - await queryRunner.query( - `ALTER TABLE "user" DROP CONSTRAINT "FK_afc64b53f8db3707ceb34eb28e2"`, - ); - await queryRunner.query( - `ALTER TABLE "user" DROP CONSTRAINT "FK_58f5c71eaab331645112cf8cfa5"`, - ); - await queryRunner.query( - `ALTER TABLE "drive_file" DROP CONSTRAINT "FK_bb90d1956dafc4068c28aa7560a"`, - ); - await queryRunner.query( - `ALTER TABLE "drive_file" DROP CONSTRAINT "FK_860fa6f6c7df5bb887249fba22e"`, - ); - await queryRunner.query( - `ALTER TABLE "drive_folder" DROP CONSTRAINT "FK_00ceffb0cdc238b3233294f08f2"`, - ); - await queryRunner.query( - `ALTER TABLE "drive_folder" DROP CONSTRAINT "FK_f4fc06e49c0171c85f1c48060d2"`, - ); - await queryRunner.query(`DROP TABLE "__chart__users"`); - await queryRunner.query(`DROP TYPE "__chart__users_span_enum"`); - await queryRunner.query(`DROP TABLE "__chart__test"`); - await queryRunner.query(`DROP TYPE "__chart__test_span_enum"`); - await queryRunner.query(`DROP TABLE "__chart__test_unique"`); - await queryRunner.query(`DROP TYPE "__chart__test_unique_span_enum"`); - await queryRunner.query(`DROP TABLE "__chart__test_grouped"`); - await queryRunner.query(`DROP TYPE "__chart__test_grouped_span_enum"`); - await queryRunner.query(`DROP TABLE "__chart__per_user_reaction"`); - await queryRunner.query(`DROP TYPE "__chart__per_user_reaction_span_enum"`); - await queryRunner.query(`DROP TABLE "__chart__per_user_notes"`); - await queryRunner.query(`DROP TYPE "__chart__per_user_notes_span_enum"`); - await queryRunner.query(`DROP TABLE "__chart__per_user_following"`); - await queryRunner.query( - `DROP TYPE "__chart__per_user_following_span_enum"`, - ); - await queryRunner.query(`DROP TABLE "__chart__per_user_drive"`); - await queryRunner.query(`DROP TYPE "__chart__per_user_drive_span_enum"`); - await queryRunner.query(`DROP TABLE "__chart__notes"`); - await queryRunner.query(`DROP TYPE "__chart__notes_span_enum"`); - await queryRunner.query(`DROP TABLE "__chart__network"`); - await queryRunner.query(`DROP TYPE "__chart__network_span_enum"`); - await queryRunner.query(`DROP TABLE "__chart__instance"`); - await queryRunner.query(`DROP TYPE "__chart__instance_span_enum"`); - await queryRunner.query(`DROP TABLE "__chart__hashtag"`); - await queryRunner.query(`DROP TYPE "__chart__hashtag_span_enum"`); - await queryRunner.query(`DROP TABLE "__chart__federation"`); - await queryRunner.query(`DROP TYPE "__chart__federation_span_enum"`); - await queryRunner.query(`DROP TABLE "__chart__drive"`); - await queryRunner.query(`DROP TYPE "__chart__drive_span_enum"`); - await queryRunner.query(`DROP TABLE "__chart__active_users"`); - await queryRunner.query(`DROP TYPE "__chart__active_users_span_enum"`); - await queryRunner.query(`DROP INDEX "IDX_dce530b98e454793dac5ec2f5a"`); - await queryRunner.query(`DROP TABLE "user_profile"`); - await queryRunner.query(`DROP INDEX "IDX_171e64971c780ebd23fae140bb"`); - await queryRunner.query(`DROP TABLE "user_publickey"`); - await queryRunner.query(`DROP TABLE "user_keypair"`); - await queryRunner.query(`DROP INDEX "IDX_7fa20a12319c7f6dc3aed98c0a"`); - await queryRunner.query(`DROP INDEX "IDX_0610ebcfcfb4a18441a9bcdab2"`); - await queryRunner.query(`DROP TABLE "poll"`); - await queryRunner.query(`DROP TYPE "poll_notevisibility_enum"`); - await queryRunner.query(`DROP INDEX "IDX_410cd649884b501c02d6e72738"`); - await queryRunner.query(`DROP INDEX "IDX_bfbc6f79ba4007b4ce5097f08d"`); - await queryRunner.query(`DROP TABLE "user_note_pining"`); - await queryRunner.query(`DROP INDEX "IDX_e247b23a3c9b45f89ec1299d06"`); - await queryRunner.query(`DROP INDEX "IDX_3b25402709dd9882048c2bbade"`); - await queryRunner.query(`DROP INDEX "IDX_b604d92d6c7aec38627f6eaf16"`); - await queryRunner.query(`DROP TABLE "reversi_matching"`); - await queryRunner.query(`DROP INDEX "IDX_b46ec40746efceac604142be1c"`); - await queryRunner.query(`DROP TABLE "reversi_game"`); - await queryRunner.query(`DROP INDEX "IDX_4f4d35e1256c84ae3d1f0eab10"`); - await queryRunner.query(`DROP INDEX "IDX_5900e907bb46516ddf2871327c"`); - await queryRunner.query(`DROP INDEX "IDX_b37dafc86e9af007e3295c2781"`); - await queryRunner.query(`DROP TABLE "emoji"`); - await queryRunner.query(`DROP INDEX "IDX_d54a512b822fac7ed52800f6b4"`); - await queryRunner.query(`DROP INDEX "IDX_a7fd92dd6dc519e6fb435dd108"`); - await queryRunner.query(`DROP INDEX "IDX_12c01c0d1a79f77d9f6c15fadd"`); - await queryRunner.query(`DROP TABLE "follow_request"`); - await queryRunner.query(`DROP INDEX "IDX_62cb09e1129f6ec024ef66e183"`); - await queryRunner.query(`DROP TABLE "auth_session"`); - await queryRunner.query(`DROP INDEX "IDX_2c308dbdc50d94dc625670055f"`); - await queryRunner.query(`DROP TABLE "signin"`); - await queryRunner.query(`DROP INDEX "IDX_cac14a4e3944454a5ce7daa514"`); - await queryRunner.query(`DROP INDEX "IDX_5377c307783fce2b6d352e1203"`); - await queryRunner.query(`DROP INDEX "IDX_e21cd3646e52ef9c94aaf17c2e"`); - await queryRunner.query(`DROP TABLE "messaging_message"`); - await queryRunner.query(`DROP INDEX "IDX_0ff69e8dfa9fe31bb4a4660f59"`); - await queryRunner.query(`DROP TABLE "registration_ticket"`); - await queryRunner.query(`DROP INDEX "IDX_5cd442c3b2e74fdd99dae20243"`); - await queryRunner.query(`DROP INDEX "IDX_04cc96756f89d0b7f9473e8cdf"`); - await queryRunner.query(`DROP INDEX "IDX_d049123c413e68ca52abe73420"`); - await queryRunner.query(`DROP INDEX "IDX_db2098070b2b5a523c58181f74"`); - await queryRunner.query(`DROP TABLE "abuse_user_report"`); - await queryRunner.query(`DROP INDEX "IDX_0f4fb9ad355f3effff221ef245"`); - await queryRunner.query(`DROP INDEX "IDX_47f4b1892f5d6ba8efb3057d81"`); - await queryRunner.query(`DROP TABLE "note_favorite"`); - await queryRunner.query(`DROP INDEX "IDX_0b03cbcd7e6a7ce068efa8ecc2"`); - await queryRunner.query(`DROP INDEX "IDX_0c44bf4f680964145f2a68a341"`); - await queryRunner.query(`DROP INDEX "IDX_d57f9030cd3af7f63ffb1c267c"`); - await queryRunner.query(`DROP INDEX "IDX_4c02d38a976c3ae132228c6fce"`); - await queryRunner.query(`DROP INDEX "IDX_0e206cec573f1edff4a3062923"`); - await queryRunner.query(`DROP INDEX "IDX_2710a55f826ee236ea1a62698f"`); - await queryRunner.query(`DROP INDEX "IDX_347fec870eafea7b26c8a73bac"`); - await queryRunner.query(`DROP TABLE "hashtag"`); - await queryRunner.query(`DROP INDEX "IDX_605472305f26818cc93d1baaa7"`); - await queryRunner.query(`DROP INDEX "IDX_d844bfc6f3f523a05189076efa"`); - await queryRunner.query(`DROP TABLE "user_list_joining"`); - await queryRunner.query(`DROP INDEX "IDX_b7fcefbdd1c18dce86687531f9"`); - await queryRunner.query(`DROP TABLE "user_list"`); - await queryRunner.query(`DROP INDEX "IDX_98a1bc5cb30dfd159de056549f"`); - await queryRunner.query(`DROP INDEX "IDX_0627125f1a8a42c9a1929edb55"`); - await queryRunner.query(`DROP INDEX "IDX_2cd4a2743a99671308f5417759"`); - await queryRunner.query(`DROP INDEX "IDX_b9a354f7941c1e779f3b33aea6"`); - await queryRunner.query(`DROP TABLE "blocking"`); - await queryRunner.query(`DROP INDEX "IDX_97754ca6f2baff9b4abb7f853d"`); - await queryRunner.query(`DROP TABLE "sw_subscription"`); - await queryRunner.query(`DROP INDEX "IDX_1eb9d9824a630321a29fd3b290"`); - await queryRunner.query(`DROP INDEX "IDX_93060675b4a79a577f31d260c6"`); - await queryRunner.query(`DROP INDEX "IDX_ec96b4fed9dae517e0dbbe0675"`); - await queryRunner.query(`DROP INDEX "IDX_f86d57fbca33c7a4e6897490cc"`); - await queryRunner.query(`DROP TABLE "muting"`); - await queryRunner.query(`DROP INDEX "IDX_8d5afc98982185799b160e10eb"`); - await queryRunner.query(`DROP INDEX "IDX_2cd3b2a6b4cf0b910b260afe08"`); - await queryRunner.query(`DROP TABLE "instance"`); - await queryRunner.query(`DROP INDEX "IDX_307be5f1d1252e0388662acb96"`); - await queryRunner.query(`DROP INDEX "IDX_6516c5a6f3c015b4eed39978be"`); - await queryRunner.query(`DROP INDEX "IDX_24e0042143a18157b234df186c"`); - await queryRunner.query(`DROP INDEX "IDX_582f8fab771a9040a12961f3e7"`); - await queryRunner.query(`DROP TABLE "following"`); - await queryRunner.query(`DROP TABLE "meta"`); - await queryRunner.query(`DROP INDEX "IDX_3c601b70a1066d2c8b517094cb"`); - await queryRunner.query(`DROP INDEX "IDX_b11a5e627c41d4dc3170f1d370"`); - await queryRunner.query(`DROP TABLE "notification"`); - await queryRunner.query(`DROP INDEX "IDX_d908433a4953cc13216cd9c274"`); - await queryRunner.query(`DROP INDEX "IDX_e637cba4dc4410218c4251260e"`); - await queryRunner.query(`DROP INDEX "IDX_56b0166d34ddae49d8ef7610bb"`); - await queryRunner.query(`DROP TABLE "note_unread"`); - await queryRunner.query(`DROP INDEX "IDX_a42c93c69989ce1d09959df4cf"`); - await queryRunner.query(`DROP INDEX "IDX_44499765eec6b5489d72c4253b"`); - await queryRunner.query(`DROP INDEX "IDX_03e7028ab8388a3f5e3ce2a861"`); - await queryRunner.query(`DROP INDEX "IDX_b0134ec406e8d09a540f818288"`); - await queryRunner.query(`DROP INDEX "IDX_318cdf42a9cfc11f479bd802bb"`); - await queryRunner.query(`DROP TABLE "note_watching"`); - await queryRunner.query(`DROP INDEX "IDX_ad0c221b25672daf2df320a817"`); - await queryRunner.query(`DROP INDEX "IDX_45145e4953780f3cd5656f0ea6"`); - await queryRunner.query(`DROP INDEX "IDX_13761f64257f40c5636d0ff95e"`); - await queryRunner.query(`DROP INDEX "IDX_01f4581f114e0ebd2bbb876f0b"`); - await queryRunner.query(`DROP TABLE "note_reaction"`); - await queryRunner.query(`DROP INDEX "IDX_50bd7164c5b78f1f4a42c4d21f"`); - await queryRunner.query(`DROP INDEX "IDX_aecfbd5ef60374918e63ee95fa"`); - await queryRunner.query(`DROP INDEX "IDX_66d2bd2ee31d14bcc23069a89f"`); - await queryRunner.query(`DROP INDEX "IDX_0fb627e1c2f753262a74f0562d"`); - await queryRunner.query(`DROP TABLE "poll_vote"`); - await queryRunner.query(`DROP INDEX "IDX_7125a826ab192eb27e11d358a5"`); - await queryRunner.query(`DROP INDEX "IDX_88937d94d7443d9a99a76fa5c0"`); - await queryRunner.query(`DROP INDEX "IDX_54ebcb6d27222913b908d56fd8"`); - await queryRunner.query(`DROP INDEX "IDX_796a8c03959361f97dc2be1d5c"`); - await queryRunner.query(`DROP INDEX "IDX_25dfc71b0369b003a4cd434d0b"`); - await queryRunner.query(`DROP INDEX "IDX_51c063b6a133a9cb87145450f5"`); - await queryRunner.query(`DROP INDEX "IDX_153536c67d05e9adb24e99fc2b"`); - await queryRunner.query(`DROP INDEX "IDX_5b87d9d19127bd5d92026017a7"`); - await queryRunner.query(`DROP INDEX "IDX_52ccc804d7c69037d558bac4c9"`); - await queryRunner.query(`DROP INDEX "IDX_17cb3553c700a4985dff5a30ff"`); - await queryRunner.query(`DROP INDEX "IDX_e7c0567f5261063592f022e9b5"`); - await queryRunner.query(`DROP TABLE "note"`); - await queryRunner.query(`DROP TYPE "note_visibility_enum"`); - await queryRunner.query(`DROP INDEX "IDX_9949557d0e1b2c19e5344c171e"`); - await queryRunner.query(`DROP INDEX "IDX_64c327441248bae40f7d92f34f"`); - await queryRunner.query(`DROP INDEX "IDX_70ba8f6af34bc924fc9e12adb8"`); - await queryRunner.query(`DROP TABLE "access_token"`); - await queryRunner.query(`DROP INDEX "IDX_f49922d511d666848f250663c4"`); - await queryRunner.query(`DROP INDEX "IDX_3f5b0899ef90527a3462d7c2cb"`); - await queryRunner.query(`DROP INDEX "IDX_048a757923ed8b157e9895da53"`); - await queryRunner.query(`DROP TABLE "app"`); - await queryRunner.query(`DROP INDEX "IDX_5deb01ae162d1d70b80d064c27"`); - await queryRunner.query(`DROP INDEX "IDX_a854e557b1b14814750c7c7b0c"`); - await queryRunner.query(`DROP INDEX "IDX_be623adaa4c566baf5d29ce0c8"`); - await queryRunner.query(`DROP INDEX "IDX_3252a5df8d5bbd16b281f7799e"`); - await queryRunner.query(`DROP INDEX "IDX_fa99d777623947a5b05f394cae"`); - await queryRunner.query(`DROP INDEX "IDX_a27b942a0d6dcff90e3ee9b5e8"`); - await queryRunner.query(`DROP INDEX "IDX_80ca6e6ef65fb9ef34ea8c90f4"`); - await queryRunner.query(`DROP INDEX "IDX_e11e649824a45d8ed01d597fd9"`); - await queryRunner.query(`DROP TABLE "user"`); - await queryRunner.query(`DROP INDEX "IDX_bb90d1956dafc4068c28aa7560"`); - await queryRunner.query(`DROP INDEX "IDX_e5848eac4940934e23dbc17581"`); - await queryRunner.query(`DROP INDEX "IDX_c55b2b7c284d9fef98026fc88e"`); - await queryRunner.query(`DROP INDEX "IDX_e74022ce9a074b3866f70e0d27"`); - await queryRunner.query(`DROP INDEX "IDX_d85a184c2540d2deba33daf642"`); - await queryRunner.query(`DROP INDEX "IDX_a40b8df8c989d7db937ea27cf6"`); - await queryRunner.query(`DROP INDEX "IDX_37bb9a1b4585f8a3beb24c62d6"`); - await queryRunner.query(`DROP INDEX "IDX_92779627994ac79277f070c91e"`); - await queryRunner.query(`DROP INDEX "IDX_860fa6f6c7df5bb887249fba22"`); - await queryRunner.query(`DROP INDEX "IDX_c8dfad3b72196dd1d6b5db168a"`); - await queryRunner.query(`DROP TABLE "drive_file"`); - await queryRunner.query(`DROP INDEX "IDX_00ceffb0cdc238b3233294f08f"`); - await queryRunner.query(`DROP INDEX "IDX_f4fc06e49c0171c85f1c48060d"`); - await queryRunner.query(`DROP INDEX "IDX_02878d441ceae15ce060b73daf"`); - await queryRunner.query(`DROP TABLE "drive_folder"`); - await queryRunner.query(`DROP INDEX "IDX_584b536b49e53ac81beb39a177"`); - await queryRunner.query(`DROP INDEX "IDX_8cb40cfc8f3c28261e6f887b03"`); - await queryRunner.query(`DROP INDEX "IDX_8e4eb51a35d81b64dda28eed0a"`); - await queryRunner.query(`DROP TABLE "log"`); - await queryRunner.query(`DROP TYPE "log_level_enum"`); - } -} diff --git a/packages/backend/migration/1556348509290-Pages.js b/packages/backend/migration/1556348509290-Pages.js deleted file mode 100644 index 696b2acbec..0000000000 --- a/packages/backend/migration/1556348509290-Pages.js +++ /dev/null @@ -1,50 +0,0 @@ -export class Pages1556348509290 { - async up(queryRunner) { - await queryRunner.query( - `CREATE TYPE "page_visibility_enum" AS ENUM('public', 'followers', 'specified')`, - ); - await queryRunner.query( - `CREATE TABLE "page" ("id" character varying(32) NOT NULL, "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL, "updatedAt" TIMESTAMP WITH TIME ZONE NOT NULL, "title" character varying(256) NOT NULL, "name" character varying(256) NOT NULL, "summary" character varying(256), "alignCenter" boolean NOT NULL, "font" character varying(32) NOT NULL, "userId" character varying(32) NOT NULL, "eyeCatchingImageId" character varying(32), "content" jsonb NOT NULL DEFAULT '[]', "variables" jsonb NOT NULL DEFAULT '[]', "visibility" "page_visibility_enum" NOT NULL, "visibleUserIds" character varying(32) array NOT NULL DEFAULT '{}'::varchar[], CONSTRAINT "PK_742f4117e065c5b6ad21b37ba1f" PRIMARY KEY ("id"))`, - ); - await queryRunner.query( - `CREATE INDEX "IDX_fbb4297c927a9b85e9cefa2eb1" ON "page" ("createdAt") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_af639b066dfbca78b01a920f8a" ON "page" ("updatedAt") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_b82c19c08afb292de4600d99e4" ON "page" ("name") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_ae1d917992dd0c9d9bbdad06c4" ON "page" ("userId") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_90148bbc2bf0854428786bfc15" ON "page" ("visibleUserIds") `, - ); - await queryRunner.query( - `CREATE UNIQUE INDEX "IDX_2133ef8317e4bdb839c0dcbf13" ON "page" ("userId", "name") `, - ); - await queryRunner.query( - `ALTER TABLE "page" ADD CONSTRAINT "FK_ae1d917992dd0c9d9bbdad06c4a" FOREIGN KEY ("userId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, - ); - await queryRunner.query( - `ALTER TABLE "page" ADD CONSTRAINT "FK_3126dd7c502c9e4d7597ef7ef10" FOREIGN KEY ("eyeCatchingImageId") REFERENCES "drive_file"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, - ); - } - async down(queryRunner) { - await queryRunner.query( - `ALTER TABLE "page" DROP CONSTRAINT "FK_3126dd7c502c9e4d7597ef7ef10"`, - ); - await queryRunner.query( - `ALTER TABLE "page" DROP CONSTRAINT "FK_ae1d917992dd0c9d9bbdad06c4a"`, - ); - await queryRunner.query(`DROP INDEX "IDX_2133ef8317e4bdb839c0dcbf13"`); - await queryRunner.query(`DROP INDEX "IDX_90148bbc2bf0854428786bfc15"`); - await queryRunner.query(`DROP INDEX "IDX_ae1d917992dd0c9d9bbdad06c4"`); - await queryRunner.query(`DROP INDEX "IDX_b82c19c08afb292de4600d99e4"`); - await queryRunner.query(`DROP INDEX "IDX_af639b066dfbca78b01a920f8a"`); - await queryRunner.query(`DROP INDEX "IDX_fbb4297c927a9b85e9cefa2eb1"`); - await queryRunner.query(`DROP TABLE "page"`); - await queryRunner.query(`DROP TYPE "page_visibility_enum"`); - } -} diff --git a/packages/backend/migration/1556746559567-UserProfile.js b/packages/backend/migration/1556746559567-UserProfile.js deleted file mode 100644 index d229ec519f..0000000000 --- a/packages/backend/migration/1556746559567-UserProfile.js +++ /dev/null @@ -1,21 +0,0 @@ -export class UserProfile1556746559567 { - async up(queryRunner) { - await queryRunner.query( - `ALTER TABLE "user_profile" ALTER COLUMN "githubId" TYPE VARCHAR(64) USING "githubId"::VARCHAR(64)`, - ); - await queryRunner.query( - `ALTER TABLE "user_profile" ALTER COLUMN "discordExpiresDate" TYPE VARCHAR(64) USING "discordExpiresDate"::VARCHAR(64)`, - ); - } - async down(queryRunner) { - await queryRunner.query( - `UPDATE "user_profile" SET github = FALSE, discord = FALSE`, - ); - await queryRunner.query( - `ALTER TABLE "user_profile" ALTER COLUMN "githubId" TYPE INTEGER USING NULL`, - ); - await queryRunner.query( - `ALTER TABLE "user_profile" ALTER COLUMN "discordExpiresDate" TYPE INTEGER USING NULL`, - ); - } -} diff --git a/packages/backend/migration/1557476068003-PinnedUsers.js b/packages/backend/migration/1557476068003-PinnedUsers.js deleted file mode 100644 index 6f348836ad..0000000000 --- a/packages/backend/migration/1557476068003-PinnedUsers.js +++ /dev/null @@ -1,10 +0,0 @@ -export class PinnedUsers1557476068003 { - async up(queryRunner) { - await queryRunner.query( - `ALTER TABLE "meta" ADD "pinnedUsers" character varying(256) array NOT NULL DEFAULT '{}'::varchar[]`, - ); - } - async down(queryRunner) { - await queryRunner.query(`ALTER TABLE "meta" DROP COLUMN "pinnedUsers"`); - } -} diff --git a/packages/backend/migration/1557761316509-AddSomeUrls.js b/packages/backend/migration/1557761316509-AddSomeUrls.js deleted file mode 100644 index 9365643bb0..0000000000 --- a/packages/backend/migration/1557761316509-AddSomeUrls.js +++ /dev/null @@ -1,18 +0,0 @@ -export class AddSomeUrls1557761316509 { - async up(queryRunner) { - await queryRunner.query( - `ALTER TABLE "meta" ADD "ToSUrl" character varying(512)`, - ); - await queryRunner.query( - `ALTER TABLE "meta" ADD "repositoryUrl" character varying(512) NOT NULL DEFAULT 'https://codeberg.org/calckey/calckey'`, - ); - await queryRunner.query( - `ALTER TABLE "meta" ADD "feedbackUrl" character varying(512) DEFAULT 'https://codeberg.org/calckey/calckey/issues'`, - ); - } - async down(queryRunner) { - await queryRunner.query(`ALTER TABLE "meta" DROP COLUMN "feedbackUrl"`); - await queryRunner.query(`ALTER TABLE "meta" DROP COLUMN "repositoryUrl"`); - await queryRunner.query(`ALTER TABLE "meta" DROP COLUMN "ToSUrl"`); - } -} diff --git a/packages/backend/migration/1557932705754-ObjectStorageSetting.js b/packages/backend/migration/1557932705754-ObjectStorageSetting.js deleted file mode 100644 index 5fcc98fe15..0000000000 --- a/packages/backend/migration/1557932705754-ObjectStorageSetting.js +++ /dev/null @@ -1,66 +0,0 @@ -export class ObjectStorageSetting1557932705754 { - async up(queryRunner) { - await queryRunner.query( - `ALTER TABLE "meta" ADD "useObjectStorage" boolean NOT NULL DEFAULT false`, - ); - await queryRunner.query( - `ALTER TABLE "meta" ADD "objectStorageBucket" character varying(512)`, - ); - await queryRunner.query( - `ALTER TABLE "meta" ADD "objectStoragePrefix" character varying(512)`, - ); - await queryRunner.query( - `ALTER TABLE "meta" ADD "objectStorageBaseUrl" character varying(512)`, - ); - await queryRunner.query( - `ALTER TABLE "meta" ADD "objectStorageEndpoint" character varying(512)`, - ); - await queryRunner.query( - `ALTER TABLE "meta" ADD "objectStorageRegion" character varying(512)`, - ); - await queryRunner.query( - `ALTER TABLE "meta" ADD "objectStorageAccessKey" character varying(512)`, - ); - await queryRunner.query( - `ALTER TABLE "meta" ADD "objectStorageSecretKey" character varying(512)`, - ); - await queryRunner.query( - `ALTER TABLE "meta" ADD "objectStoragePort" integer`, - ); - await queryRunner.query( - `ALTER TABLE "meta" ADD "objectStorageUseSSL" boolean NOT NULL DEFAULT true`, - ); - } - async down(queryRunner) { - await queryRunner.query( - `ALTER TABLE "meta" DROP COLUMN "objectStorageUseSSL"`, - ); - await queryRunner.query( - `ALTER TABLE "meta" DROP COLUMN "objectStoragePort"`, - ); - await queryRunner.query( - `ALTER TABLE "meta" DROP COLUMN "objectStorageSecretKey"`, - ); - await queryRunner.query( - `ALTER TABLE "meta" DROP COLUMN "objectStorageAccessKey"`, - ); - await queryRunner.query( - `ALTER TABLE "meta" DROP COLUMN "objectStorageRegion"`, - ); - await queryRunner.query( - `ALTER TABLE "meta" DROP COLUMN "objectStorageEndpoint"`, - ); - await queryRunner.query( - `ALTER TABLE "meta" DROP COLUMN "objectStorageBaseUrl"`, - ); - await queryRunner.query( - `ALTER TABLE "meta" DROP COLUMN "objectStoragePrefix"`, - ); - await queryRunner.query( - `ALTER TABLE "meta" DROP COLUMN "objectStorageBucket"`, - ); - await queryRunner.query( - `ALTER TABLE "meta" DROP COLUMN "useObjectStorage"`, - ); - } -} diff --git a/packages/backend/migration/1558072954435-PageLike.js b/packages/backend/migration/1558072954435-PageLike.js deleted file mode 100644 index e919e02ddb..0000000000 --- a/packages/backend/migration/1558072954435-PageLike.js +++ /dev/null @@ -1,34 +0,0 @@ -export class PageLike1558072954435 { - async up(queryRunner) { - await queryRunner.query( - `CREATE TABLE "page_like" ("id" character varying(32) NOT NULL, "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL, "userId" character varying(32) NOT NULL, "pageId" character varying(32) NOT NULL, CONSTRAINT "PK_813f034843af992d3ae0f43c64c" PRIMARY KEY ("id"))`, - ); - await queryRunner.query( - `CREATE INDEX "IDX_0e61efab7f88dbb79c9166dbb4" ON "page_like" ("userId") `, - ); - await queryRunner.query( - `CREATE UNIQUE INDEX "IDX_4ce6fb9c70529b4c8ac46c9bfa" ON "page_like" ("userId", "pageId") `, - ); - await queryRunner.query( - `ALTER TABLE "page" ADD "likedCount" integer NOT NULL DEFAULT 0`, - ); - await queryRunner.query( - `ALTER TABLE "page_like" ADD CONSTRAINT "FK_0e61efab7f88dbb79c9166dbb48" FOREIGN KEY ("userId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, - ); - await queryRunner.query( - `ALTER TABLE "page_like" ADD CONSTRAINT "FK_cf8782626dced3176038176a847" FOREIGN KEY ("pageId") REFERENCES "page"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, - ); - } - async down(queryRunner) { - await queryRunner.query( - `ALTER TABLE "page_like" DROP CONSTRAINT "FK_cf8782626dced3176038176a847"`, - ); - await queryRunner.query( - `ALTER TABLE "page_like" DROP CONSTRAINT "FK_0e61efab7f88dbb79c9166dbb48"`, - ); - await queryRunner.query(`ALTER TABLE "page" DROP COLUMN "likedCount"`); - await queryRunner.query(`DROP INDEX "IDX_4ce6fb9c70529b4c8ac46c9bfa"`); - await queryRunner.query(`DROP INDEX "IDX_0e61efab7f88dbb79c9166dbb4"`); - await queryRunner.query(`DROP TABLE "page_like"`); - } -} diff --git a/packages/backend/migration/1558103093633-UserGroup.js b/packages/backend/migration/1558103093633-UserGroup.js deleted file mode 100644 index dc581a24ef..0000000000 --- a/packages/backend/migration/1558103093633-UserGroup.js +++ /dev/null @@ -1,82 +0,0 @@ -export class UserGroup1558103093633 { - async up(queryRunner) { - await queryRunner.query( - `CREATE TABLE "user_group" ("id" character varying(32) NOT NULL, "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL, "name" character varying(256) NOT NULL, "userId" character varying(32) NOT NULL, "isPrivate" boolean NOT NULL DEFAULT false, CONSTRAINT "PK_3c29fba6fe013ec8724378ce7c9" PRIMARY KEY ("id"))`, - ); - await queryRunner.query( - `CREATE INDEX "IDX_20e30aa35180e317e133d75316" ON "user_group" ("createdAt") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_3d6b372788ab01be58853003c9" ON "user_group" ("userId") `, - ); - await queryRunner.query( - `CREATE TABLE "user_group_joining" ("id" character varying(32) NOT NULL, "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL, "userId" character varying(32) NOT NULL, "userGroupId" character varying(32) NOT NULL, CONSTRAINT "PK_15f2425885253c5507e1599cfe7" PRIMARY KEY ("id"))`, - ); - await queryRunner.query( - `CREATE INDEX "IDX_f3a1b4bd0c7cabba958a0c0b23" ON "user_group_joining" ("userId") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_67dc758bc0566985d1b3d39986" ON "user_group_joining" ("userGroupId") `, - ); - await queryRunner.query( - `ALTER TABLE "messaging_message" ADD "groupId" character varying(32)`, - ); - await queryRunner.query( - `ALTER TABLE "messaging_message" ADD "reads" character varying(32) array NOT NULL DEFAULT '{}'::varchar[]`, - ); - await queryRunner.query( - `ALTER TABLE "messaging_message" ALTER COLUMN "recipientId" DROP NOT NULL`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "messaging_message"."recipientId" IS 'The recipient user ID.'`, - ); - await queryRunner.query( - `CREATE INDEX "IDX_2c4be03b446884f9e9c502135b" ON "messaging_message" ("groupId") `, - ); - await queryRunner.query( - `ALTER TABLE "messaging_message" ADD CONSTRAINT "FK_2c4be03b446884f9e9c502135be" FOREIGN KEY ("groupId") REFERENCES "user_group"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, - ); - await queryRunner.query( - `ALTER TABLE "user_group" ADD CONSTRAINT "FK_3d6b372788ab01be58853003c93" FOREIGN KEY ("userId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, - ); - await queryRunner.query( - `ALTER TABLE "user_group_joining" ADD CONSTRAINT "FK_f3a1b4bd0c7cabba958a0c0b231" FOREIGN KEY ("userId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, - ); - await queryRunner.query( - `ALTER TABLE "user_group_joining" ADD CONSTRAINT "FK_67dc758bc0566985d1b3d399865" FOREIGN KEY ("userGroupId") REFERENCES "user_group"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, - ); - } - async down(queryRunner) { - await queryRunner.query( - `ALTER TABLE "user_group_joining" DROP CONSTRAINT "FK_67dc758bc0566985d1b3d399865"`, - ); - await queryRunner.query( - `ALTER TABLE "user_group_joining" DROP CONSTRAINT "FK_f3a1b4bd0c7cabba958a0c0b231"`, - ); - await queryRunner.query( - `ALTER TABLE "user_group" DROP CONSTRAINT "FK_3d6b372788ab01be58853003c93"`, - ); - await queryRunner.query( - `ALTER TABLE "messaging_message" DROP CONSTRAINT "FK_2c4be03b446884f9e9c502135be"`, - ); - await queryRunner.query(`DROP INDEX "IDX_2c4be03b446884f9e9c502135b"`); - await queryRunner.query( - `COMMENT ON COLUMN "messaging_message"."recipientId" IS ''`, - ); - await queryRunner.query( - `ALTER TABLE "messaging_message" ALTER COLUMN "recipientId" SET NOT NULL`, - ); - await queryRunner.query( - `ALTER TABLE "messaging_message" DROP COLUMN "reads"`, - ); - await queryRunner.query( - `ALTER TABLE "messaging_message" DROP COLUMN "groupId"`, - ); - await queryRunner.query(`DROP INDEX "IDX_67dc758bc0566985d1b3d39986"`); - await queryRunner.query(`DROP INDEX "IDX_f3a1b4bd0c7cabba958a0c0b23"`); - await queryRunner.query(`DROP TABLE "user_group_joining"`); - await queryRunner.query(`DROP INDEX "IDX_3d6b372788ab01be58853003c9"`); - await queryRunner.query(`DROP INDEX "IDX_20e30aa35180e317e133d75316"`); - await queryRunner.query(`DROP TABLE "user_group"`); - } -} diff --git a/packages/backend/migration/1558257926829-UserGroupInvite.js b/packages/backend/migration/1558257926829-UserGroupInvite.js deleted file mode 100644 index ed137fdb2e..0000000000 --- a/packages/backend/migration/1558257926829-UserGroupInvite.js +++ /dev/null @@ -1,38 +0,0 @@ -export class UserGroupInvite1558257926829 { - async up(queryRunner) { - await queryRunner.query( - `CREATE TABLE "user_group_invite" ("id" character varying(32) NOT NULL, "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL, "userId" character varying(32) NOT NULL, "userGroupId" character varying(32) NOT NULL, CONSTRAINT "PK_3893884af0d3a5f4d01e7921a97" PRIMARY KEY ("id"))`, - ); - await queryRunner.query( - `CREATE INDEX "IDX_1039988afa3bf991185b277fe0" ON "user_group_invite" ("userId") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_e10924607d058004304611a436" ON "user_group_invite" ("userGroupId") `, - ); - await queryRunner.query( - `CREATE UNIQUE INDEX "IDX_78787741f9010886796f2320a4" ON "user_group_invite" ("userId", "userGroupId") `, - ); - await queryRunner.query( - `CREATE UNIQUE INDEX "IDX_d9ecaed8c6dc43f3592c229282" ON "user_group_joining" ("userId", "userGroupId") `, - ); - await queryRunner.query( - `ALTER TABLE "user_group_invite" ADD CONSTRAINT "FK_1039988afa3bf991185b277fe03" FOREIGN KEY ("userId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, - ); - await queryRunner.query( - `ALTER TABLE "user_group_invite" ADD CONSTRAINT "FK_e10924607d058004304611a436a" FOREIGN KEY ("userGroupId") REFERENCES "user_group"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, - ); - } - async down(queryRunner) { - await queryRunner.query( - `ALTER TABLE "user_group_invite" DROP CONSTRAINT "FK_e10924607d058004304611a436a"`, - ); - await queryRunner.query( - `ALTER TABLE "user_group_invite" DROP CONSTRAINT "FK_1039988afa3bf991185b277fe03"`, - ); - await queryRunner.query(`DROP INDEX "IDX_d9ecaed8c6dc43f3592c229282"`); - await queryRunner.query(`DROP INDEX "IDX_78787741f9010886796f2320a4"`); - await queryRunner.query(`DROP INDEX "IDX_e10924607d058004304611a436"`); - await queryRunner.query(`DROP INDEX "IDX_1039988afa3bf991185b277fe0"`); - await queryRunner.query(`DROP TABLE "user_group_invite"`); - } -} diff --git a/packages/backend/migration/1558266512381-UserListJoining.js b/packages/backend/migration/1558266512381-UserListJoining.js deleted file mode 100644 index 3597e51f76..0000000000 --- a/packages/backend/migration/1558266512381-UserListJoining.js +++ /dev/null @@ -1,10 +0,0 @@ -export class UserListJoining1558266512381 { - async up(queryRunner) { - await queryRunner.query( - `CREATE UNIQUE INDEX "IDX_90f7da835e4c10aca6853621e1" ON "user_list_joining" ("userId", "userListId") `, - ); - } - async down(queryRunner) { - await queryRunner.query(`DROP INDEX "IDX_90f7da835e4c10aca6853621e1"`); - } -} diff --git a/packages/backend/migration/1561706992953-webauthn.js b/packages/backend/migration/1561706992953-webauthn.js deleted file mode 100644 index f860d2c11b..0000000000 --- a/packages/backend/migration/1561706992953-webauthn.js +++ /dev/null @@ -1,48 +0,0 @@ -export class webauthn1561706992953 { - async up(queryRunner) { - await queryRunner.query( - `CREATE TABLE "attestation_challenge" ("id" character varying(32) NOT NULL, "userId" character varying(32) NOT NULL, "challenge" character varying(64) NOT NULL, "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL, "registrationChallenge" boolean NOT NULL DEFAULT false, CONSTRAINT "PK_d0ba6786e093f1bcb497572a6b5" PRIMARY KEY ("id", "userId"))`, - ); - await queryRunner.query( - `CREATE INDEX "IDX_f1a461a618fa1755692d0e0d59" ON "attestation_challenge" ("userId") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_47efb914aed1f72dd39a306c7b" ON "attestation_challenge" ("challenge") `, - ); - await queryRunner.query( - `CREATE TABLE "user_security_key" ("id" character varying NOT NULL, "userId" character varying(32) NOT NULL, "publicKey" character varying NOT NULL, "lastUsed" TIMESTAMP WITH TIME ZONE NOT NULL, "name" character varying(30) NOT NULL, CONSTRAINT "PK_3e508571121ab39c5f85d10c166" PRIMARY KEY ("id"))`, - ); - await queryRunner.query( - `CREATE INDEX "IDX_ff9ca3b5f3ee3d0681367a9b44" ON "user_security_key" ("userId") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_0d7718e562dcedd0aa5cf2c9f7" ON "user_security_key" ("publicKey") `, - ); - await queryRunner.query( - `ALTER TABLE "user_profile" ADD "securityKeysAvailable" boolean NOT NULL DEFAULT false`, - ); - await queryRunner.query( - `ALTER TABLE "attestation_challenge" ADD CONSTRAINT "FK_f1a461a618fa1755692d0e0d592" FOREIGN KEY ("userId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, - ); - await queryRunner.query( - `ALTER TABLE "user_security_key" ADD CONSTRAINT "FK_ff9ca3b5f3ee3d0681367a9b447" FOREIGN KEY ("userId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, - ); - } - async down(queryRunner) { - await queryRunner.query( - `ALTER TABLE "user_security_key" DROP CONSTRAINT "FK_ff9ca3b5f3ee3d0681367a9b447"`, - ); - await queryRunner.query( - `ALTER TABLE "attestation_challenge" DROP CONSTRAINT "FK_f1a461a618fa1755692d0e0d592"`, - ); - await queryRunner.query( - `ALTER TABLE "user_profile" DROP COLUMN "securityKeysAvailable"`, - ); - await queryRunner.query(`DROP INDEX "IDX_0d7718e562dcedd0aa5cf2c9f7"`); - await queryRunner.query(`DROP INDEX "IDX_ff9ca3b5f3ee3d0681367a9b44"`); - await queryRunner.query(`DROP TABLE "user_security_key"`); - await queryRunner.query(`DROP INDEX "IDX_47efb914aed1f72dd39a306c7b"`); - await queryRunner.query(`DROP INDEX "IDX_f1a461a618fa1755692d0e0d59"`); - await queryRunner.query(`DROP TABLE "attestation_challenge"`); - } -} diff --git a/packages/backend/migration/1561873850023-ChartIndexes.js b/packages/backend/migration/1561873850023-ChartIndexes.js deleted file mode 100644 index ba46da1e41..0000000000 --- a/packages/backend/migration/1561873850023-ChartIndexes.js +++ /dev/null @@ -1,376 +0,0 @@ -export class ChartIndexes1561873850023 { - async up(queryRunner) { - await queryRunner.query( - `CREATE INDEX "IDX_0ad37b7ef50f4ddc84363d7ccc" ON "__chart__active_users" ("date") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_15e91a03aeeac9dbccdf43fc06" ON "__chart__active_users" ("span") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_00ed5f86db1f7efafb1978bf21" ON "__chart__active_users" ("group") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_20f57cc8f142c131340ee16742" ON "__chart__active_users" ("span", "date") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_9a3ed15a30ab7e3a37702e6e08" ON "__chart__active_users" ("date", "group") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_c26e2c1cbb6e911e0554b27416" ON "__chart__active_users" ("span", "date", "group") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_13565815f618a1ff53886c5b28" ON "__chart__drive" ("date") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_3fa0d0f17ca72e3dc80999a032" ON "__chart__drive" ("span") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_7a170f67425e62a8fabb76c872" ON "__chart__drive" ("group") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_6e1df243476e20cbf86572ecc0" ON "__chart__drive" ("span", "date") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_3313d7288855ec105b5bbf6c21" ON "__chart__drive" ("date", "group") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_06690fc959f1c9fdaf21928222" ON "__chart__drive" ("span", "date", "group") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_36cb699c49580d4e6c2e6159f9" ON "__chart__federation" ("date") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_e447064455928cf627590ef527" ON "__chart__federation" ("span") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_76e87c7bfc5d925fcbba405d84" ON "__chart__federation" ("group") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_2d416e6af791a82e338c79d480" ON "__chart__federation" ("span", "date") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_dd907becf76104e4b656659e6b" ON "__chart__federation" ("date", "group") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_e9cd07672b37d8966cf3709283" ON "__chart__federation" ("span", "date", "group") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_07747a1038c05f532a718fe1de" ON "__chart__hashtag" ("date") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_fcc181fb8283009c61cc4083ef" ON "__chart__hashtag" ("span") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_99a7d2faaef84a6f728d714ad6" ON "__chart__hashtag" ("group") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_49975586f50ed7b800fdd88fbd" ON "__chart__hashtag" ("span", "date") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_25a97c02003338124b2b75fdbc" ON "__chart__hashtag" ("date", "group") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_6d6f156ceefc6bc5f273a0e370" ON "__chart__hashtag" ("span", "date", "group") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_6b8f34a1a64b06014b6fb66824" ON "__chart__instance" ("date") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_c12f0af4a66cdd30c2287ce8aa" ON "__chart__instance" ("span") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_da8a46ba84ca1d8bb5a29bfb63" ON "__chart__instance" ("group") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_d0a4f79af5a97b08f37b547197" ON "__chart__instance" ("span", "date") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_39ee857ab2f23493037c6b6631" ON "__chart__instance" ("date", "group") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_f5448d9633cff74208d850aabe" ON "__chart__instance" ("span", "date", "group") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_a1efd3e0048a5f2793a47360dc" ON "__chart__network" ("date") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_f8dd01baeded2ffa833e0a610a" ON "__chart__network" ("span") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_7b5da130992ec9df96712d4290" ON "__chart__network" ("group") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_08fac0eb3b11f04c200c0b40dd" ON "__chart__network" ("span", "date") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_0a905b992fecd2b5c3fb98759e" ON "__chart__network" ("date", "group") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_9ff6944f01acb756fdc92d7563" ON "__chart__network" ("span", "date", "group") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_42eb716a37d381cdf566192b2b" ON "__chart__notes" ("date") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_e69096589f11e3baa98ddd64d0" ON "__chart__notes" ("span") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_7036f2957151588b813185c794" ON "__chart__notes" ("group") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_0c9a159c5082cbeef3ca6706b5" ON "__chart__notes" ("span", "date") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_f09d543e3acb16c5976bdb31fa" ON "__chart__notes" ("date", "group") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_924fc196c80ca24bae01dd37e4" ON "__chart__notes" ("span", "date", "group") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_5f86db6492274e07c1a3cdf286" ON "__chart__per_user_drive" ("date") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_328f259961e60c4fa0bfcf55ca" ON "__chart__per_user_drive" ("span") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_e496ca8096d28f6b9b509264dc" ON "__chart__per_user_drive" ("group") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_42ea9381f0fda8dfe0fa1c8b53" ON "__chart__per_user_drive" ("span", "date") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_30bf67687f483ace115c5ca642" ON "__chart__per_user_drive" ("date", "group") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_f2aeafde2ae6fbad38e857631b" ON "__chart__per_user_drive" ("span", "date", "group") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_7af07790712aa3438ff6773f3b" ON "__chart__per_user_following" ("date") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_f92dd6d03f8d994f29987f6214" ON "__chart__per_user_following" ("span") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_4b3593098b6edc9c5afe36b18b" ON "__chart__per_user_following" ("group") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_57b5458d0d3d6d1e7f13d4e57f" ON "__chart__per_user_following" ("span", "date") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_b77d4dd9562c3a899d9a286fcd" ON "__chart__per_user_following" ("date", "group") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_4db3b84c7be0d3464714f3e0b1" ON "__chart__per_user_following" ("span", "date", "group") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_84234bd1abb873f07329681c83" ON "__chart__per_user_notes" ("date") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_8d2cbbc8114d90d19b44d626b6" ON "__chart__per_user_notes" ("span") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_55bf20f366979f2436de99206b" ON "__chart__per_user_notes" ("group") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_046feeb12e9ef5f783f409866a" ON "__chart__per_user_notes" ("span", "date") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_5048e9daccbbbc6d567bb142d3" ON "__chart__per_user_notes" ("date", "group") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_f68a5ab958f9f5fa17a32ac23b" ON "__chart__per_user_notes" ("span", "date", "group") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_f7bf4c62059764c2c2bb40fdab" ON "__chart__per_user_reaction" ("date") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_65633a106bce43fc7c5c30a5c7" ON "__chart__per_user_reaction" ("span") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_8cf3156fd7a6b15c43459c6e3b" ON "__chart__per_user_reaction" ("group") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_edeb73c09c3143a81bcb34d569" ON "__chart__per_user_reaction" ("span", "date") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_229a41ad465f9205f1f5703291" ON "__chart__per_user_reaction" ("date", "group") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_e316f01a6d24eb31db27f88262" ON "__chart__per_user_reaction" ("span", "date", "group") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_0c641990ecf47d2545df4edb75" ON "__chart__test_grouped" ("date") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_2be7ec6cebddc14dc11e206686" ON "__chart__test_grouped" ("span") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_234dff3c0b56a6150b95431ab9" ON "__chart__test_grouped" ("group") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_a5133470f4825902e170328ca5" ON "__chart__test_grouped" ("span", "date") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_b14489029e4b3aaf4bba5fb524" ON "__chart__test_grouped" ("date", "group") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_84e661abb7bd1e51b690d4b017" ON "__chart__test_grouped" ("span", "date", "group") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_437bab3c6061d90f6bb65fd2cc" ON "__chart__test_unique" ("date") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_5c73bf61da4f6e6f15bae88ed1" ON "__chart__test_unique" ("span") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_bbfa573a8181018851ed0b6357" ON "__chart__test_unique" ("group") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_d70c86baedc68326be11f9c0ce" ON "__chart__test_unique" ("span", "date") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_a0cd75442dd10d0643a17c4a49" ON "__chart__test_unique" ("date", "group") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_66e1e1ecd2f29e57778af35b59" ON "__chart__test_unique" ("span", "date", "group") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_b070a906db04b44c67c6c2144d" ON "__chart__test" ("date") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_92255988735563f0fe4aba1f05" ON "__chart__test" ("span") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_d41cce6aee1a50bfc062038f9b" ON "__chart__test" ("group") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_c5870993e25c3d5771f91f5003" ON "__chart__test" ("span", "date") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_a319e5dbf47e8a17497623beae" ON "__chart__test" ("date", "group") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_f170de677ea75ad4533de2723e" ON "__chart__test" ("span", "date", "group") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_845254b3eaf708ae8a6cac3026" ON "__chart__users" ("date") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_7c184198ecf66a8d3ecb253ab3" ON "__chart__users" ("span") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_ed9b95919c672a13008e9487ee" ON "__chart__users" ("group") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_f091abb24193d50c653c6b77fc" ON "__chart__users" ("span", "date") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_337e9599f278bd7537fe30876f" ON "__chart__users" ("date", "group") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_a770a57c70e668cc61590c9161" ON "__chart__users" ("span", "date", "group") `, - ); - } - async down(queryRunner) { - await queryRunner.query(`DROP INDEX "IDX_a770a57c70e668cc61590c9161"`); - await queryRunner.query(`DROP INDEX "IDX_337e9599f278bd7537fe30876f"`); - await queryRunner.query(`DROP INDEX "IDX_f091abb24193d50c653c6b77fc"`); - await queryRunner.query(`DROP INDEX "IDX_ed9b95919c672a13008e9487ee"`); - await queryRunner.query(`DROP INDEX "IDX_7c184198ecf66a8d3ecb253ab3"`); - await queryRunner.query(`DROP INDEX "IDX_845254b3eaf708ae8a6cac3026"`); - await queryRunner.query(`DROP INDEX "IDX_f170de677ea75ad4533de2723e"`); - await queryRunner.query(`DROP INDEX "IDX_a319e5dbf47e8a17497623beae"`); - await queryRunner.query(`DROP INDEX "IDX_c5870993e25c3d5771f91f5003"`); - await queryRunner.query(`DROP INDEX "IDX_d41cce6aee1a50bfc062038f9b"`); - await queryRunner.query(`DROP INDEX "IDX_92255988735563f0fe4aba1f05"`); - await queryRunner.query(`DROP INDEX "IDX_b070a906db04b44c67c6c2144d"`); - await queryRunner.query(`DROP INDEX "IDX_66e1e1ecd2f29e57778af35b59"`); - await queryRunner.query(`DROP INDEX "IDX_a0cd75442dd10d0643a17c4a49"`); - await queryRunner.query(`DROP INDEX "IDX_d70c86baedc68326be11f9c0ce"`); - await queryRunner.query(`DROP INDEX "IDX_bbfa573a8181018851ed0b6357"`); - await queryRunner.query(`DROP INDEX "IDX_5c73bf61da4f6e6f15bae88ed1"`); - await queryRunner.query(`DROP INDEX "IDX_437bab3c6061d90f6bb65fd2cc"`); - await queryRunner.query(`DROP INDEX "IDX_84e661abb7bd1e51b690d4b017"`); - await queryRunner.query(`DROP INDEX "IDX_b14489029e4b3aaf4bba5fb524"`); - await queryRunner.query(`DROP INDEX "IDX_a5133470f4825902e170328ca5"`); - await queryRunner.query(`DROP INDEX "IDX_234dff3c0b56a6150b95431ab9"`); - await queryRunner.query(`DROP INDEX "IDX_2be7ec6cebddc14dc11e206686"`); - await queryRunner.query(`DROP INDEX "IDX_0c641990ecf47d2545df4edb75"`); - await queryRunner.query(`DROP INDEX "IDX_e316f01a6d24eb31db27f88262"`); - await queryRunner.query(`DROP INDEX "IDX_229a41ad465f9205f1f5703291"`); - await queryRunner.query(`DROP INDEX "IDX_edeb73c09c3143a81bcb34d569"`); - await queryRunner.query(`DROP INDEX "IDX_8cf3156fd7a6b15c43459c6e3b"`); - await queryRunner.query(`DROP INDEX "IDX_65633a106bce43fc7c5c30a5c7"`); - await queryRunner.query(`DROP INDEX "IDX_f7bf4c62059764c2c2bb40fdab"`); - await queryRunner.query(`DROP INDEX "IDX_f68a5ab958f9f5fa17a32ac23b"`); - await queryRunner.query(`DROP INDEX "IDX_5048e9daccbbbc6d567bb142d3"`); - await queryRunner.query(`DROP INDEX "IDX_046feeb12e9ef5f783f409866a"`); - await queryRunner.query(`DROP INDEX "IDX_55bf20f366979f2436de99206b"`); - await queryRunner.query(`DROP INDEX "IDX_8d2cbbc8114d90d19b44d626b6"`); - await queryRunner.query(`DROP INDEX "IDX_84234bd1abb873f07329681c83"`); - await queryRunner.query(`DROP INDEX "IDX_4db3b84c7be0d3464714f3e0b1"`); - await queryRunner.query(`DROP INDEX "IDX_b77d4dd9562c3a899d9a286fcd"`); - await queryRunner.query(`DROP INDEX "IDX_57b5458d0d3d6d1e7f13d4e57f"`); - await queryRunner.query(`DROP INDEX "IDX_4b3593098b6edc9c5afe36b18b"`); - await queryRunner.query(`DROP INDEX "IDX_f92dd6d03f8d994f29987f6214"`); - await queryRunner.query(`DROP INDEX "IDX_7af07790712aa3438ff6773f3b"`); - await queryRunner.query(`DROP INDEX "IDX_f2aeafde2ae6fbad38e857631b"`); - await queryRunner.query(`DROP INDEX "IDX_30bf67687f483ace115c5ca642"`); - await queryRunner.query(`DROP INDEX "IDX_42ea9381f0fda8dfe0fa1c8b53"`); - await queryRunner.query(`DROP INDEX "IDX_e496ca8096d28f6b9b509264dc"`); - await queryRunner.query(`DROP INDEX "IDX_328f259961e60c4fa0bfcf55ca"`); - await queryRunner.query(`DROP INDEX "IDX_5f86db6492274e07c1a3cdf286"`); - await queryRunner.query(`DROP INDEX "IDX_924fc196c80ca24bae01dd37e4"`); - await queryRunner.query(`DROP INDEX "IDX_f09d543e3acb16c5976bdb31fa"`); - await queryRunner.query(`DROP INDEX "IDX_0c9a159c5082cbeef3ca6706b5"`); - await queryRunner.query(`DROP INDEX "IDX_7036f2957151588b813185c794"`); - await queryRunner.query(`DROP INDEX "IDX_e69096589f11e3baa98ddd64d0"`); - await queryRunner.query(`DROP INDEX "IDX_42eb716a37d381cdf566192b2b"`); - await queryRunner.query(`DROP INDEX "IDX_9ff6944f01acb756fdc92d7563"`); - await queryRunner.query(`DROP INDEX "IDX_0a905b992fecd2b5c3fb98759e"`); - await queryRunner.query(`DROP INDEX "IDX_08fac0eb3b11f04c200c0b40dd"`); - await queryRunner.query(`DROP INDEX "IDX_7b5da130992ec9df96712d4290"`); - await queryRunner.query(`DROP INDEX "IDX_f8dd01baeded2ffa833e0a610a"`); - await queryRunner.query(`DROP INDEX "IDX_a1efd3e0048a5f2793a47360dc"`); - await queryRunner.query(`DROP INDEX "IDX_f5448d9633cff74208d850aabe"`); - await queryRunner.query(`DROP INDEX "IDX_39ee857ab2f23493037c6b6631"`); - await queryRunner.query(`DROP INDEX "IDX_d0a4f79af5a97b08f37b547197"`); - await queryRunner.query(`DROP INDEX "IDX_da8a46ba84ca1d8bb5a29bfb63"`); - await queryRunner.query(`DROP INDEX "IDX_c12f0af4a66cdd30c2287ce8aa"`); - await queryRunner.query(`DROP INDEX "IDX_6b8f34a1a64b06014b6fb66824"`); - await queryRunner.query(`DROP INDEX "IDX_6d6f156ceefc6bc5f273a0e370"`); - await queryRunner.query(`DROP INDEX "IDX_25a97c02003338124b2b75fdbc"`); - await queryRunner.query(`DROP INDEX "IDX_49975586f50ed7b800fdd88fbd"`); - await queryRunner.query(`DROP INDEX "IDX_99a7d2faaef84a6f728d714ad6"`); - await queryRunner.query(`DROP INDEX "IDX_fcc181fb8283009c61cc4083ef"`); - await queryRunner.query(`DROP INDEX "IDX_07747a1038c05f532a718fe1de"`); - await queryRunner.query(`DROP INDEX "IDX_e9cd07672b37d8966cf3709283"`); - await queryRunner.query(`DROP INDEX "IDX_dd907becf76104e4b656659e6b"`); - await queryRunner.query(`DROP INDEX "IDX_2d416e6af791a82e338c79d480"`); - await queryRunner.query(`DROP INDEX "IDX_76e87c7bfc5d925fcbba405d84"`); - await queryRunner.query(`DROP INDEX "IDX_e447064455928cf627590ef527"`); - await queryRunner.query(`DROP INDEX "IDX_36cb699c49580d4e6c2e6159f9"`); - await queryRunner.query(`DROP INDEX "IDX_06690fc959f1c9fdaf21928222"`); - await queryRunner.query(`DROP INDEX "IDX_3313d7288855ec105b5bbf6c21"`); - await queryRunner.query(`DROP INDEX "IDX_6e1df243476e20cbf86572ecc0"`); - await queryRunner.query(`DROP INDEX "IDX_7a170f67425e62a8fabb76c872"`); - await queryRunner.query(`DROP INDEX "IDX_3fa0d0f17ca72e3dc80999a032"`); - await queryRunner.query(`DROP INDEX "IDX_13565815f618a1ff53886c5b28"`); - await queryRunner.query(`DROP INDEX "IDX_c26e2c1cbb6e911e0554b27416"`); - await queryRunner.query(`DROP INDEX "IDX_9a3ed15a30ab7e3a37702e6e08"`); - await queryRunner.query(`DROP INDEX "IDX_20f57cc8f142c131340ee16742"`); - await queryRunner.query(`DROP INDEX "IDX_00ed5f86db1f7efafb1978bf21"`); - await queryRunner.query(`DROP INDEX "IDX_15e91a03aeeac9dbccdf43fc06"`); - await queryRunner.query(`DROP INDEX "IDX_0ad37b7ef50f4ddc84363d7ccc"`); - await queryRunner.query(`DROP INDEX "IDX_90148bbc2bf0854428786bfc15"`); - await queryRunner.query(`DROP INDEX "IDX_88937d94d7443d9a99a76fa5c0"`); - await queryRunner.query(`DROP INDEX "IDX_54ebcb6d27222913b908d56fd8"`); - await queryRunner.query(`DROP INDEX "IDX_796a8c03959361f97dc2be1d5c"`); - await queryRunner.query(`DROP INDEX "IDX_25dfc71b0369b003a4cd434d0b"`); - await queryRunner.query(`DROP INDEX "IDX_51c063b6a133a9cb87145450f5"`); - await queryRunner.query(`DROP INDEX "IDX_fa99d777623947a5b05f394cae"`); - await queryRunner.query(`DROP INDEX "IDX_315c779174fe8247ab324f036e"`); - await queryRunner.query(`DROP INDEX "IDX_c5d46cbfda48b1c33ed852e21b"`); - await queryRunner.query(`DROP INDEX "IDX_8cb40cfc8f3c28261e6f887b03"`); - } -} diff --git a/packages/backend/migration/1562422242907-PasswordLessLogin.js b/packages/backend/migration/1562422242907-PasswordLessLogin.js deleted file mode 100644 index 8e1280830b..0000000000 --- a/packages/backend/migration/1562422242907-PasswordLessLogin.js +++ /dev/null @@ -1,12 +0,0 @@ -export class PasswordLessLogin1562422242907 { - async up(queryRunner) { - await queryRunner.query( - `ALTER TABLE "user_profile" ADD COLUMN "usePasswordLessLogin" boolean DEFAULT false NOT NULL`, - ); - } - async down(queryRunner) { - await queryRunner.query( - `ALTER TABLE "user_profile" DROP COLUMN "usePasswordLessLogin"`, - ); - } -} diff --git a/packages/backend/migration/1562444565093-PinnedPage.js b/packages/backend/migration/1562444565093-PinnedPage.js deleted file mode 100644 index dcb342d3fc..0000000000 --- a/packages/backend/migration/1562444565093-PinnedPage.js +++ /dev/null @@ -1,24 +0,0 @@ -export class PinnedPage1562444565093 { - async up(queryRunner) { - await queryRunner.query( - `ALTER TABLE "user_profile" ADD "pinnedPageId" character varying(32)`, - ); - await queryRunner.query( - `ALTER TABLE "user_profile" ADD CONSTRAINT "UQ_6dc44f1ceb65b1e72bacef2ca27" UNIQUE ("pinnedPageId")`, - ); - await queryRunner.query( - `ALTER TABLE "user_profile" ADD CONSTRAINT "FK_6dc44f1ceb65b1e72bacef2ca27" FOREIGN KEY ("pinnedPageId") REFERENCES "page"("id") ON DELETE SET NULL ON UPDATE NO ACTION`, - ); - } - async down(queryRunner) { - await queryRunner.query( - `ALTER TABLE "user_profile" DROP CONSTRAINT "FK_6dc44f1ceb65b1e72bacef2ca27"`, - ); - await queryRunner.query( - `ALTER TABLE "user_profile" DROP CONSTRAINT "UQ_6dc44f1ceb65b1e72bacef2ca27"`, - ); - await queryRunner.query( - `ALTER TABLE "user_profile" DROP COLUMN "pinnedPageId"`, - ); - } -} diff --git a/packages/backend/migration/1562448332510-PageTitleHideOption.js b/packages/backend/migration/1562448332510-PageTitleHideOption.js deleted file mode 100644 index 9a1b42f4bb..0000000000 --- a/packages/backend/migration/1562448332510-PageTitleHideOption.js +++ /dev/null @@ -1,12 +0,0 @@ -export class PageTitleHideOption1562448332510 { - async up(queryRunner) { - await queryRunner.query( - `ALTER TABLE "page" ADD "hideTitleWhenPinned" boolean NOT NULL DEFAULT false`, - ); - } - async down(queryRunner) { - await queryRunner.query( - `ALTER TABLE "page" DROP COLUMN "hideTitleWhenPinned"`, - ); - } -} diff --git a/packages/backend/migration/1562869971568-ModerationLog.js b/packages/backend/migration/1562869971568-ModerationLog.js deleted file mode 100644 index f652b067b4..0000000000 --- a/packages/backend/migration/1562869971568-ModerationLog.js +++ /dev/null @@ -1,20 +0,0 @@ -export class ModerationLog1562869971568 { - async up(queryRunner) { - await queryRunner.query( - `CREATE TABLE "moderation_log" ("id" character varying(32) NOT NULL, "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL, "userId" character varying(32) NOT NULL, "type" character varying(128) NOT NULL, "info" jsonb NOT NULL, CONSTRAINT "PK_d0adca6ecfd068db83e4526cc26" PRIMARY KEY ("id"))`, - ); - await queryRunner.query( - `CREATE INDEX "IDX_a08ad074601d204e0f69da9a95" ON "moderation_log" ("userId") `, - ); - await queryRunner.query( - `ALTER TABLE "moderation_log" ADD CONSTRAINT "FK_a08ad074601d204e0f69da9a954" FOREIGN KEY ("userId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, - ); - } - async down(queryRunner) { - await queryRunner.query( - `ALTER TABLE "moderation_log" DROP CONSTRAINT "FK_a08ad074601d204e0f69da9a954"`, - ); - await queryRunner.query(`DROP INDEX "IDX_a08ad074601d204e0f69da9a95"`); - await queryRunner.query(`DROP TABLE "moderation_log"`); - } -} diff --git a/packages/backend/migration/1563757595828-UsedUsername.js b/packages/backend/migration/1563757595828-UsedUsername.js deleted file mode 100644 index 2cf5d8c740..0000000000 --- a/packages/backend/migration/1563757595828-UsedUsername.js +++ /dev/null @@ -1,10 +0,0 @@ -export class UsedUsername1563757595828 { - async up(queryRunner) { - await queryRunner.query( - `CREATE TABLE "used_username" ("username" character varying(128) NOT NULL, "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL, CONSTRAINT "PK_78fd79d2d24c6ac2f4cc9a31a5d" PRIMARY KEY ("username"))`, - ); - } - async down(queryRunner) { - await queryRunner.query(`DROP TABLE "used_username"`); - } -} diff --git a/packages/backend/migration/1565634203341-room.js b/packages/backend/migration/1565634203341-room.js deleted file mode 100644 index 1023c0a31a..0000000000 --- a/packages/backend/migration/1565634203341-room.js +++ /dev/null @@ -1,10 +0,0 @@ -export class room1565634203341 { - async up(queryRunner) { - await queryRunner.query( - `ALTER TABLE "user_profile" ADD "room" jsonb NOT NULL DEFAULT '{}'`, - ); - } - async down(queryRunner) { - await queryRunner.query(`ALTER TABLE "user_profile" DROP COLUMN "room"`); - } -} diff --git a/packages/backend/migration/1571220798684-CustomEmojiCategory.js b/packages/backend/migration/1571220798684-CustomEmojiCategory.js deleted file mode 100644 index 4d75313328..0000000000 --- a/packages/backend/migration/1571220798684-CustomEmojiCategory.js +++ /dev/null @@ -1,14 +0,0 @@ -export class CustomEmojiCategory1571220798684 { - async up(queryRunner) { - await queryRunner.query( - `ALTER TABLE "emoji" ADD "category" character varying(128)`, - undefined, - ); - } - async down(queryRunner) { - await queryRunner.query( - `ALTER TABLE "emoji" DROP COLUMN "category"`, - undefined, - ); - } -} diff --git a/packages/backend/migration/1572760203493-nodeinfo.js b/packages/backend/migration/1572760203493-nodeinfo.js deleted file mode 100644 index eea87c82c8..0000000000 --- a/packages/backend/migration/1572760203493-nodeinfo.js +++ /dev/null @@ -1,78 +0,0 @@ -export class nodeinfo1572760203493 { - async up(queryRunner) { - await queryRunner.query( - `ALTER TABLE "instance" DROP COLUMN "system"`, - undefined, - ); - await queryRunner.query( - `ALTER TABLE "instance" ADD "softwareName" character varying(64) DEFAULT null`, - undefined, - ); - await queryRunner.query( - `ALTER TABLE "instance" ADD "softwareVersion" character varying(64) DEFAULT null`, - undefined, - ); - await queryRunner.query( - `ALTER TABLE "instance" ADD "openRegistrations" boolean DEFAULT null`, - undefined, - ); - await queryRunner.query( - `ALTER TABLE "instance" ADD "name" character varying(256) DEFAULT null`, - undefined, - ); - await queryRunner.query( - `ALTER TABLE "instance" ADD "description" character varying(4096) DEFAULT null`, - undefined, - ); - await queryRunner.query( - `ALTER TABLE "instance" ADD "maintainerName" character varying(128) DEFAULT null`, - undefined, - ); - await queryRunner.query( - `ALTER TABLE "instance" ADD "maintainerEmail" character varying(256) DEFAULT null`, - undefined, - ); - await queryRunner.query( - `ALTER TABLE "instance" ADD "infoUpdatedAt" TIMESTAMP WITH TIME ZONE`, - undefined, - ); - } - async down(queryRunner) { - await queryRunner.query( - `ALTER TABLE "instance" DROP COLUMN "infoUpdatedAt"`, - undefined, - ); - await queryRunner.query( - `ALTER TABLE "instance" DROP COLUMN "maintainerEmail"`, - undefined, - ); - await queryRunner.query( - `ALTER TABLE "instance" DROP COLUMN "maintainerName"`, - undefined, - ); - await queryRunner.query( - `ALTER TABLE "instance" DROP COLUMN "description"`, - undefined, - ); - await queryRunner.query( - `ALTER TABLE "instance" DROP COLUMN "name"`, - undefined, - ); - await queryRunner.query( - `ALTER TABLE "instance" DROP COLUMN "openRegistrations"`, - undefined, - ); - await queryRunner.query( - `ALTER TABLE "instance" DROP COLUMN "softwareVersion"`, - undefined, - ); - await queryRunner.query( - `ALTER TABLE "instance" DROP COLUMN "softwareName"`, - undefined, - ); - await queryRunner.query( - `ALTER TABLE "instance" ADD "system" character varying(64)`, - undefined, - ); - } -} diff --git a/packages/backend/migration/1576269851876-TalkFederationId.js b/packages/backend/migration/1576269851876-TalkFederationId.js deleted file mode 100644 index f0aed7dd83..0000000000 --- a/packages/backend/migration/1576269851876-TalkFederationId.js +++ /dev/null @@ -1,17 +0,0 @@ -export class TalkFederationId1576269851876 { - constructor() { - this.name = "TalkFederationId1576269851876"; - } - async up(queryRunner) { - await queryRunner.query( - `ALTER TABLE "messaging_message" ADD "uri" character varying(512)`, - undefined, - ); - } - async down(queryRunner) { - await queryRunner.query( - `ALTER TABLE "messaging_message" DROP COLUMN "uri"`, - undefined, - ); - } -} diff --git a/packages/backend/migration/1576869585998-ProxyRemoteFiles.js b/packages/backend/migration/1576869585998-ProxyRemoteFiles.js deleted file mode 100644 index 5565f64b6d..0000000000 --- a/packages/backend/migration/1576869585998-ProxyRemoteFiles.js +++ /dev/null @@ -1,17 +0,0 @@ -export class ProxyRemoteFiles1576869585998 { - constructor() { - this.name = "ProxyRemoteFiles1576869585998"; - } - async up(queryRunner) { - await queryRunner.query( - `ALTER TABLE "meta" ADD "proxyRemoteFiles" boolean NOT NULL DEFAULT false`, - undefined, - ); - } - async down(queryRunner) { - await queryRunner.query( - `ALTER TABLE "meta" DROP COLUMN "proxyRemoteFiles"`, - undefined, - ); - } -} diff --git a/packages/backend/migration/1579267006611-v12.js b/packages/backend/migration/1579267006611-v12.js deleted file mode 100644 index f1d906465e..0000000000 --- a/packages/backend/migration/1579267006611-v12.js +++ /dev/null @@ -1,91 +0,0 @@ -export class v121579267006611 { - constructor() { - this.name = "v121579267006611"; - } - async up(queryRunner) { - await queryRunner.query( - `CREATE TABLE "announcement" ("id" character varying(32) NOT NULL, "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL, "text" character varying(8192) NOT NULL, "title" character varying(256) NOT NULL, "imageUrl" character varying(1024), CONSTRAINT "PK_e0ef0550174fd1099a308fd18a0" PRIMARY KEY ("id"))`, - undefined, - ); - await queryRunner.query( - `CREATE INDEX "IDX_118ec703e596086fc4515acb39" ON "announcement" ("createdAt") `, - undefined, - ); - await queryRunner.query( - `CREATE TABLE "announcement_read" ("id" character varying(32) NOT NULL, "userId" character varying(32) NOT NULL, "announcementId" character varying(32) NOT NULL, CONSTRAINT "PK_4b90ad1f42681d97b2683890c5e" PRIMARY KEY ("id"))`, - undefined, - ); - await queryRunner.query( - `CREATE INDEX "IDX_8288151386172b8109f7239ab2" ON "announcement_read" ("userId") `, - undefined, - ); - await queryRunner.query( - `CREATE INDEX "IDX_603a7b1e7aa0533c6c88e9bfaf" ON "announcement_read" ("announcementId") `, - undefined, - ); - await queryRunner.query( - `CREATE UNIQUE INDEX "IDX_924fa71815cfa3941d003702a0" ON "announcement_read" ("userId", "announcementId") `, - undefined, - ); - await queryRunner.query( - `ALTER TABLE "user" DROP COLUMN "isVerified"`, - undefined, - ); - await queryRunner.query( - `ALTER TABLE "meta" DROP COLUMN "announcements"`, - undefined, - ); - await queryRunner.query( - `ALTER TABLE "meta" DROP COLUMN "enableEmojiReaction"`, - undefined, - ); - await queryRunner.query( - `ALTER TABLE "announcement_read" ADD CONSTRAINT "FK_8288151386172b8109f7239ab28" FOREIGN KEY ("userId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, - undefined, - ); - await queryRunner.query( - `ALTER TABLE "announcement_read" ADD CONSTRAINT "FK_603a7b1e7aa0533c6c88e9bfafe" FOREIGN KEY ("announcementId") REFERENCES "announcement"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, - undefined, - ); - } - async down(queryRunner) { - await queryRunner.query( - `ALTER TABLE "announcement_read" DROP CONSTRAINT "FK_603a7b1e7aa0533c6c88e9bfafe"`, - undefined, - ); - await queryRunner.query( - `ALTER TABLE "announcement_read" DROP CONSTRAINT "FK_8288151386172b8109f7239ab28"`, - undefined, - ); - await queryRunner.query( - `ALTER TABLE "meta" ADD "enableEmojiReaction" boolean NOT NULL DEFAULT true`, - undefined, - ); - await queryRunner.query( - `ALTER TABLE "meta" ADD "announcements" jsonb NOT NULL DEFAULT '[]'`, - undefined, - ); - await queryRunner.query( - `ALTER TABLE "user" ADD "isVerified" boolean NOT NULL DEFAULT false`, - undefined, - ); - await queryRunner.query( - `DROP INDEX "IDX_924fa71815cfa3941d003702a0"`, - undefined, - ); - await queryRunner.query( - `DROP INDEX "IDX_603a7b1e7aa0533c6c88e9bfaf"`, - undefined, - ); - await queryRunner.query( - `DROP INDEX "IDX_8288151386172b8109f7239ab2"`, - undefined, - ); - await queryRunner.query(`DROP TABLE "announcement_read"`, undefined); - await queryRunner.query( - `DROP INDEX "IDX_118ec703e596086fc4515acb39"`, - undefined, - ); - await queryRunner.query(`DROP TABLE "announcement"`, undefined); - } -} diff --git a/packages/backend/migration/1579270193251-v12-2.js b/packages/backend/migration/1579270193251-v12-2.js deleted file mode 100644 index 6bbcdcc152..0000000000 --- a/packages/backend/migration/1579270193251-v12-2.js +++ /dev/null @@ -1,17 +0,0 @@ -export class v1221579270193251 { - constructor() { - this.name = "v1221579270193251"; - } - async up(queryRunner) { - await queryRunner.query( - `ALTER TABLE "announcement_read" ADD "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL`, - undefined, - ); - } - async down(queryRunner) { - await queryRunner.query( - `ALTER TABLE "announcement_read" DROP COLUMN "createdAt"`, - undefined, - ); - } -} diff --git a/packages/backend/migration/1579282808087-v12-3.js b/packages/backend/migration/1579282808087-v12-3.js deleted file mode 100644 index d5a9a86b52..0000000000 --- a/packages/backend/migration/1579282808087-v12-3.js +++ /dev/null @@ -1,17 +0,0 @@ -export class v1231579282808087 { - constructor() { - this.name = "v1231579282808087"; - } - async up(queryRunner) { - await queryRunner.query( - `ALTER TABLE "announcement" ADD "updatedAt" TIMESTAMP WITH TIME ZONE`, - undefined, - ); - } - async down(queryRunner) { - await queryRunner.query( - `ALTER TABLE "announcement" DROP COLUMN "updatedAt"`, - undefined, - ); - } -} diff --git a/packages/backend/migration/1579544426412-v12-4.js b/packages/backend/migration/1579544426412-v12-4.js deleted file mode 100644 index efd6ee61bb..0000000000 --- a/packages/backend/migration/1579544426412-v12-4.js +++ /dev/null @@ -1,25 +0,0 @@ -export class v1241579544426412 { - constructor() { - this.name = "v1241579544426412"; - } - async up(queryRunner) { - await queryRunner.query( - `ALTER TABLE "notification" ADD "followRequestId" character varying(32)`, - undefined, - ); - await queryRunner.query( - `ALTER TABLE "notification" ADD CONSTRAINT "FK_bd7fab507621e635b32cd31892c" FOREIGN KEY ("followRequestId") REFERENCES "follow_request"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, - undefined, - ); - } - async down(queryRunner) { - await queryRunner.query( - `ALTER TABLE "notification" DROP CONSTRAINT "FK_bd7fab507621e635b32cd31892c"`, - undefined, - ); - await queryRunner.query( - `ALTER TABLE "notification" DROP COLUMN "followRequestId"`, - undefined, - ); - } -} diff --git a/packages/backend/migration/1579977526288-v12-5.js b/packages/backend/migration/1579977526288-v12-5.js deleted file mode 100644 index f71c287551..0000000000 --- a/packages/backend/migration/1579977526288-v12-5.js +++ /dev/null @@ -1,156 +0,0 @@ -export class v1251579977526288 { - constructor() { - this.name = "v1251579977526288"; - } - async up(queryRunner) { - await queryRunner.query( - `CREATE TABLE "clip" ("id" character varying(32) NOT NULL, "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL, "userId" character varying(32) NOT NULL, "name" character varying(128) NOT NULL, "isPublic" boolean NOT NULL DEFAULT false, CONSTRAINT "PK_f0685dac8d4dd056d7255670b75" PRIMARY KEY ("id"))`, - undefined, - ); - await queryRunner.query( - `CREATE INDEX "IDX_2b5ec6c574d6802c94c80313fb" ON "clip" ("userId") `, - undefined, - ); - await queryRunner.query( - `CREATE TABLE "clip_note" ("id" character varying(32) NOT NULL, "noteId" character varying(32) NOT NULL, "clipId" character varying(32) NOT NULL, CONSTRAINT "PK_e94cda2f40a99b57e032a1a738b" PRIMARY KEY ("id"))`, - undefined, - ); - await queryRunner.query( - `CREATE INDEX "IDX_a012eaf5c87c65da1deb5fdbfa" ON "clip_note" ("noteId") `, - undefined, - ); - await queryRunner.query( - `CREATE INDEX "IDX_ebe99317bbbe9968a0c6f579ad" ON "clip_note" ("clipId") `, - undefined, - ); - await queryRunner.query( - `CREATE UNIQUE INDEX "IDX_6fc0ec357d55a18646262fdfff" ON "clip_note" ("noteId", "clipId") `, - undefined, - ); - await queryRunner.query( - `CREATE TYPE "antenna_src_enum" AS ENUM('home', 'all', 'list')`, - undefined, - ); - await queryRunner.query( - `CREATE TABLE "antenna" ("id" character varying(32) NOT NULL, "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL, "userId" character varying(32) NOT NULL, "name" character varying(128) NOT NULL, "src" "antenna_src_enum" NOT NULL, "userListId" character varying(32), "keywords" jsonb NOT NULL DEFAULT '[]', "withFile" boolean NOT NULL, "expression" character varying(2048), "notify" boolean NOT NULL, "hasNewNote" boolean NOT NULL DEFAULT false, CONSTRAINT "PK_c170b99775e1dccca947c9f2d5f" PRIMARY KEY ("id"))`, - undefined, - ); - await queryRunner.query( - `CREATE INDEX "IDX_6446c571a0e8d0f05f01c78909" ON "antenna" ("userId") `, - undefined, - ); - await queryRunner.query( - `CREATE TABLE "antenna_note" ("id" character varying(32) NOT NULL, "noteId" character varying(32) NOT NULL, "antennaId" character varying(32) NOT NULL, CONSTRAINT "PK_fb28d94d0989a3872df19fd6ef8" PRIMARY KEY ("id"))`, - undefined, - ); - await queryRunner.query( - `CREATE INDEX "IDX_bd0397be22147e17210940e125" ON "antenna_note" ("noteId") `, - undefined, - ); - await queryRunner.query( - `CREATE INDEX "IDX_0d775946662d2575dfd2068a5f" ON "antenna_note" ("antennaId") `, - undefined, - ); - await queryRunner.query( - `CREATE UNIQUE INDEX "IDX_335a0bf3f904406f9ef3dd51c2" ON "antenna_note" ("noteId", "antennaId") `, - undefined, - ); - await queryRunner.query(`ALTER TABLE "note" DROP COLUMN "geo"`, undefined); - await queryRunner.query( - `ALTER TABLE "clip" ADD CONSTRAINT "FK_2b5ec6c574d6802c94c80313fb2" FOREIGN KEY ("userId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, - undefined, - ); - await queryRunner.query( - `ALTER TABLE "clip_note" ADD CONSTRAINT "FK_a012eaf5c87c65da1deb5fdbfa3" FOREIGN KEY ("noteId") REFERENCES "note"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, - undefined, - ); - await queryRunner.query( - `ALTER TABLE "clip_note" ADD CONSTRAINT "FK_ebe99317bbbe9968a0c6f579adf" FOREIGN KEY ("clipId") REFERENCES "clip"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, - undefined, - ); - await queryRunner.query( - `ALTER TABLE "antenna" ADD CONSTRAINT "FK_6446c571a0e8d0f05f01c789096" FOREIGN KEY ("userId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, - undefined, - ); - await queryRunner.query( - `ALTER TABLE "antenna" ADD CONSTRAINT "FK_709d7d32053d0dd7620f678eeb9" FOREIGN KEY ("userListId") REFERENCES "user_list"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, - undefined, - ); - await queryRunner.query( - `ALTER TABLE "antenna_note" ADD CONSTRAINT "FK_bd0397be22147e17210940e125b" FOREIGN KEY ("noteId") REFERENCES "note"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, - undefined, - ); - await queryRunner.query( - `ALTER TABLE "antenna_note" ADD CONSTRAINT "FK_0d775946662d2575dfd2068a5f5" FOREIGN KEY ("antennaId") REFERENCES "antenna"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, - undefined, - ); - } - async down(queryRunner) { - await queryRunner.query( - `ALTER TABLE "antenna_note" DROP CONSTRAINT "FK_0d775946662d2575dfd2068a5f5"`, - undefined, - ); - await queryRunner.query( - `ALTER TABLE "antenna_note" DROP CONSTRAINT "FK_bd0397be22147e17210940e125b"`, - undefined, - ); - await queryRunner.query( - `ALTER TABLE "antenna" DROP CONSTRAINT "FK_709d7d32053d0dd7620f678eeb9"`, - undefined, - ); - await queryRunner.query( - `ALTER TABLE "antenna" DROP CONSTRAINT "FK_6446c571a0e8d0f05f01c789096"`, - undefined, - ); - await queryRunner.query( - `ALTER TABLE "clip_note" DROP CONSTRAINT "FK_ebe99317bbbe9968a0c6f579adf"`, - undefined, - ); - await queryRunner.query( - `ALTER TABLE "clip_note" DROP CONSTRAINT "FK_a012eaf5c87c65da1deb5fdbfa3"`, - undefined, - ); - await queryRunner.query( - `ALTER TABLE "clip" DROP CONSTRAINT "FK_2b5ec6c574d6802c94c80313fb2"`, - undefined, - ); - await queryRunner.query(`ALTER TABLE "note" ADD "geo" jsonb`, undefined); - await queryRunner.query( - `DROP INDEX "IDX_335a0bf3f904406f9ef3dd51c2"`, - undefined, - ); - await queryRunner.query( - `DROP INDEX "IDX_0d775946662d2575dfd2068a5f"`, - undefined, - ); - await queryRunner.query( - `DROP INDEX "IDX_bd0397be22147e17210940e125"`, - undefined, - ); - await queryRunner.query(`DROP TABLE "antenna_note"`, undefined); - await queryRunner.query( - `DROP INDEX "IDX_6446c571a0e8d0f05f01c78909"`, - undefined, - ); - await queryRunner.query(`DROP TABLE "antenna"`, undefined); - await queryRunner.query(`DROP TYPE "antenna_src_enum"`, undefined); - await queryRunner.query( - `DROP INDEX "IDX_6fc0ec357d55a18646262fdfff"`, - undefined, - ); - await queryRunner.query( - `DROP INDEX "IDX_ebe99317bbbe9968a0c6f579ad"`, - undefined, - ); - await queryRunner.query( - `DROP INDEX "IDX_a012eaf5c87c65da1deb5fdbfa"`, - undefined, - ); - await queryRunner.query(`DROP TABLE "clip_note"`, undefined); - await queryRunner.query( - `DROP INDEX "IDX_2b5ec6c574d6802c94c80313fb"`, - undefined, - ); - await queryRunner.query(`DROP TABLE "clip"`, undefined); - } -} diff --git a/packages/backend/migration/1579993013959-v12-6.js b/packages/backend/migration/1579993013959-v12-6.js deleted file mode 100644 index fc954c3612..0000000000 --- a/packages/backend/migration/1579993013959-v12-6.js +++ /dev/null @@ -1,33 +0,0 @@ -export class v1261579993013959 { - constructor() { - this.name = "v1261579993013959"; - } - async up(queryRunner) { - await queryRunner.query( - `ALTER TABLE "antenna" DROP COLUMN "hasNewNote"`, - undefined, - ); - await queryRunner.query( - `ALTER TABLE "antenna_note" ADD "read" boolean NOT NULL DEFAULT false`, - undefined, - ); - await queryRunner.query( - `CREATE INDEX "IDX_9937ea48d7ae97ffb4f3f063a4" ON "antenna_note" ("read") `, - undefined, - ); - } - async down(queryRunner) { - await queryRunner.query( - `DROP INDEX "IDX_9937ea48d7ae97ffb4f3f063a4"`, - undefined, - ); - await queryRunner.query( - `ALTER TABLE "antenna_note" DROP COLUMN "read"`, - undefined, - ); - await queryRunner.query( - `ALTER TABLE "antenna" ADD "hasNewNote" boolean NOT NULL DEFAULT false`, - undefined, - ); - } -} diff --git a/packages/backend/migration/1580069531114-v12-7.js b/packages/backend/migration/1580069531114-v12-7.js deleted file mode 100644 index c4214ddf13..0000000000 --- a/packages/backend/migration/1580069531114-v12-7.js +++ /dev/null @@ -1,51 +0,0 @@ -export class v1271580069531114 { - constructor() { - this.name = "v1271580069531114"; - } - async up(queryRunner) { - await queryRunner.query( - `ALTER TABLE "antenna" ADD "users" character varying(1024) array NOT NULL DEFAULT '{}'::varchar[]`, - undefined, - ); - await queryRunner.query( - `ALTER TABLE "antenna" ADD "caseSensitive" boolean NOT NULL DEFAULT false`, - undefined, - ); - await queryRunner.query( - `ALTER TYPE "public"."antenna_src_enum" RENAME TO "antenna_src_enum_old"`, - undefined, - ); - await queryRunner.query( - `CREATE TYPE "antenna_src_enum" AS ENUM('home', 'all', 'users', 'list')`, - undefined, - ); - await queryRunner.query( - `ALTER TABLE "antenna" ALTER COLUMN "src" TYPE "antenna_src_enum" USING "src"::"text"::"antenna_src_enum"`, - undefined, - ); - await queryRunner.query(`DROP TYPE "antenna_src_enum_old"`, undefined); - } - async down(queryRunner) { - await queryRunner.query( - `CREATE TYPE "antenna_src_enum_old" AS ENUM('home', 'all', 'list')`, - undefined, - ); - await queryRunner.query( - `ALTER TABLE "antenna" ALTER COLUMN "src" TYPE "antenna_src_enum_old" USING "src"::"text"::"antenna_src_enum_old"`, - undefined, - ); - await queryRunner.query(`DROP TYPE "antenna_src_enum"`, undefined); - await queryRunner.query( - `ALTER TYPE "antenna_src_enum_old" RENAME TO "antenna_src_enum"`, - undefined, - ); - await queryRunner.query( - `ALTER TABLE "antenna" DROP COLUMN "caseSensitive"`, - undefined, - ); - await queryRunner.query( - `ALTER TABLE "antenna" DROP COLUMN "users"`, - undefined, - ); - } -} diff --git a/packages/backend/migration/1580148575182-v12-8.js b/packages/backend/migration/1580148575182-v12-8.js deleted file mode 100644 index 11b792b7ea..0000000000 --- a/packages/backend/migration/1580148575182-v12-8.js +++ /dev/null @@ -1,25 +0,0 @@ -export class v1281580148575182 { - constructor() { - this.name = "v1281580148575182"; - } - async up(queryRunner) { - await queryRunner.query( - `ALTER TABLE "note" DROP CONSTRAINT "FK_ec5c201576192ba8904c345c5cc"`, - undefined, - ); - await queryRunner.query( - `ALTER TABLE "note" DROP COLUMN "appId"`, - undefined, - ); - } - async down(queryRunner) { - await queryRunner.query( - `ALTER TABLE "note" ADD "appId" character varying(32)`, - undefined, - ); - await queryRunner.query( - `ALTER TABLE "note" ADD CONSTRAINT "FK_ec5c201576192ba8904c345c5cc" FOREIGN KEY ("appId") REFERENCES "app"("id") ON DELETE SET NULL ON UPDATE NO ACTION`, - undefined, - ); - } -} diff --git a/packages/backend/migration/1580154400017-v12-9.js b/packages/backend/migration/1580154400017-v12-9.js deleted file mode 100644 index 19f8be0958..0000000000 --- a/packages/backend/migration/1580154400017-v12-9.js +++ /dev/null @@ -1,17 +0,0 @@ -export class v1291580154400017 { - constructor() { - this.name = "v1291580154400017"; - } - async up(queryRunner) { - await queryRunner.query( - `ALTER TABLE "antenna" ADD "withReplies" boolean NOT NULL DEFAULT false`, - undefined, - ); - } - async down(queryRunner) { - await queryRunner.query( - `ALTER TABLE "antenna" DROP COLUMN "withReplies"`, - undefined, - ); - } -} diff --git a/packages/backend/migration/1580276619901-v12-10.js b/packages/backend/migration/1580276619901-v12-10.js deleted file mode 100644 index e5dd1db5e5..0000000000 --- a/packages/backend/migration/1580276619901-v12-10.js +++ /dev/null @@ -1,31 +0,0 @@ -export class v12101580276619901 { - constructor() { - this.name = "v12101580276619901"; - } - async up(queryRunner) { - await queryRunner.query(`TRUNCATE TABLE "notification"`, undefined); - await queryRunner.query( - `ALTER TABLE "notification" DROP COLUMN "type"`, - undefined, - ); - await queryRunner.query( - `CREATE TYPE "notification_type_enum" AS ENUM('follow', 'mention', 'reply', 'renote', 'quote', 'reaction', 'pollVote', 'receiveFollowRequest', 'followRequestAccepted')`, - undefined, - ); - await queryRunner.query( - `ALTER TABLE "notification" ADD "type" "notification_type_enum" NOT NULL`, - undefined, - ); - } - async down(queryRunner) { - await queryRunner.query( - `ALTER TABLE "notification" DROP COLUMN "type"`, - undefined, - ); - await queryRunner.query(`DROP TYPE "notification_type_enum"`, undefined); - await queryRunner.query( - `ALTER TABLE "notification" ADD "type" character varying(32) NOT NULL`, - undefined, - ); - } -} diff --git a/packages/backend/migration/1580331224276-v12-11.js b/packages/backend/migration/1580331224276-v12-11.js deleted file mode 100644 index c31dca1758..0000000000 --- a/packages/backend/migration/1580331224276-v12-11.js +++ /dev/null @@ -1,33 +0,0 @@ -export class v12111580331224276 { - constructor() { - this.name = "v12111580331224276"; - } - async up(queryRunner) { - await queryRunner.query( - `ALTER TABLE "instance" DROP COLUMN "isMarkedAsClosed"`, - undefined, - ); - await queryRunner.query( - `ALTER TABLE "instance" ADD "isSuspended" boolean NOT NULL DEFAULT false`, - undefined, - ); - await queryRunner.query( - `CREATE INDEX "IDX_34500da2e38ac393f7bb6b299c" ON "instance" ("isSuspended") `, - undefined, - ); - } - async down(queryRunner) { - await queryRunner.query( - `DROP INDEX "IDX_34500da2e38ac393f7bb6b299c"`, - undefined, - ); - await queryRunner.query( - `ALTER TABLE "instance" DROP COLUMN "isSuspended"`, - undefined, - ); - await queryRunner.query( - `ALTER TABLE "instance" ADD "isMarkedAsClosed" boolean NOT NULL DEFAULT false`, - undefined, - ); - } -} diff --git a/packages/backend/migration/1580508795118-v12-12.js b/packages/backend/migration/1580508795118-v12-12.js deleted file mode 100644 index 6df1b8f8a9..0000000000 --- a/packages/backend/migration/1580508795118-v12-12.js +++ /dev/null @@ -1,145 +0,0 @@ -export class v12121580508795118 { - constructor() { - this.name = "v12121580508795118"; - } - async up(queryRunner) { - await queryRunner.query( - `ALTER TABLE "user_profile" DROP COLUMN "twitter"`, - undefined, - ); - await queryRunner.query( - `ALTER TABLE "user_profile" DROP COLUMN "twitterAccessToken"`, - undefined, - ); - await queryRunner.query( - `ALTER TABLE "user_profile" DROP COLUMN "twitterAccessTokenSecret"`, - undefined, - ); - await queryRunner.query( - `ALTER TABLE "user_profile" DROP COLUMN "twitterUserId"`, - undefined, - ); - await queryRunner.query( - `ALTER TABLE "user_profile" DROP COLUMN "twitterScreenName"`, - undefined, - ); - await queryRunner.query( - `ALTER TABLE "user_profile" DROP COLUMN "github"`, - undefined, - ); - await queryRunner.query( - `ALTER TABLE "user_profile" DROP COLUMN "githubAccessToken"`, - undefined, - ); - await queryRunner.query( - `ALTER TABLE "user_profile" DROP COLUMN "githubId"`, - undefined, - ); - await queryRunner.query( - `ALTER TABLE "user_profile" DROP COLUMN "githubLogin"`, - undefined, - ); - await queryRunner.query( - `ALTER TABLE "user_profile" DROP COLUMN "discord"`, - undefined, - ); - await queryRunner.query( - `ALTER TABLE "user_profile" DROP COLUMN "discordAccessToken"`, - undefined, - ); - await queryRunner.query( - `ALTER TABLE "user_profile" DROP COLUMN "discordRefreshToken"`, - undefined, - ); - await queryRunner.query( - `ALTER TABLE "user_profile" DROP COLUMN "discordExpiresDate"`, - undefined, - ); - await queryRunner.query( - `ALTER TABLE "user_profile" DROP COLUMN "discordId"`, - undefined, - ); - await queryRunner.query( - `ALTER TABLE "user_profile" DROP COLUMN "discordUsername"`, - undefined, - ); - await queryRunner.query( - `ALTER TABLE "user_profile" DROP COLUMN "discordDiscriminator"`, - undefined, - ); - await queryRunner.query( - `ALTER TABLE "user_profile" ADD "integrations" jsonb NOT NULL DEFAULT '{}'`, - undefined, - ); - } - async down(queryRunner) { - await queryRunner.query( - `ALTER TABLE "user_profile" DROP COLUMN "integrations"`, - undefined, - ); - await queryRunner.query( - `ALTER TABLE "user_profile" ADD "discordDiscriminator" character varying(64) DEFAULT NULL`, - undefined, - ); - await queryRunner.query( - `ALTER TABLE "user_profile" ADD "discordUsername" character varying(64) DEFAULT NULL`, - undefined, - ); - await queryRunner.query( - `ALTER TABLE "user_profile" ADD "discordId" character varying(64) DEFAULT NULL`, - undefined, - ); - await queryRunner.query( - `ALTER TABLE "user_profile" ADD "discordExpiresDate" character varying(64)`, - undefined, - ); - await queryRunner.query( - `ALTER TABLE "user_profile" ADD "discordRefreshToken" character varying(64) DEFAULT NULL`, - undefined, - ); - await queryRunner.query( - `ALTER TABLE "user_profile" ADD "discordAccessToken" character varying(64) DEFAULT NULL`, - undefined, - ); - await queryRunner.query( - `ALTER TABLE "user_profile" ADD "discord" boolean NOT NULL DEFAULT false`, - undefined, - ); - await queryRunner.query( - `ALTER TABLE "user_profile" ADD "githubLogin" character varying(64) DEFAULT NULL`, - undefined, - ); - await queryRunner.query( - `ALTER TABLE "user_profile" ADD "githubId" character varying(64)`, - undefined, - ); - await queryRunner.query( - `ALTER TABLE "user_profile" ADD "githubAccessToken" character varying(64) DEFAULT NULL`, - undefined, - ); - await queryRunner.query( - `ALTER TABLE "user_profile" ADD "github" boolean NOT NULL DEFAULT false`, - undefined, - ); - await queryRunner.query( - `ALTER TABLE "user_profile" ADD "twitterScreenName" character varying(64) DEFAULT NULL`, - undefined, - ); - await queryRunner.query( - `ALTER TABLE "user_profile" ADD "twitterUserId" character varying(64) DEFAULT NULL`, - undefined, - ); - await queryRunner.query( - `ALTER TABLE "user_profile" ADD "twitterAccessTokenSecret" character varying(64) DEFAULT NULL`, - undefined, - ); - await queryRunner.query( - `ALTER TABLE "user_profile" ADD "twitterAccessToken" character varying(64) DEFAULT NULL`, - undefined, - ); - await queryRunner.query( - `ALTER TABLE "user_profile" ADD "twitter" boolean NOT NULL DEFAULT false`, - undefined, - ); - } -} diff --git a/packages/backend/migration/1580543501339-v12-13.js b/packages/backend/migration/1580543501339-v12-13.js deleted file mode 100644 index fd4d131518..0000000000 --- a/packages/backend/migration/1580543501339-v12-13.js +++ /dev/null @@ -1,14 +0,0 @@ -export class v12131580543501339 { - constructor() { - this.name = "v12131580543501339"; - } - async up(queryRunner) { - await queryRunner.query( - `CREATE INDEX "IDX_NOTE_TAGS" ON "note" USING gin ("tags")`, - undefined, - ); - } - async down(queryRunner) { - await queryRunner.query(`DROP INDEX "IDX_NOTE_TAGS"`, undefined); - } -} diff --git a/packages/backend/migration/1580864313253-v12-14.js b/packages/backend/migration/1580864313253-v12-14.js deleted file mode 100644 index 47f778e1d7..0000000000 --- a/packages/backend/migration/1580864313253-v12-14.js +++ /dev/null @@ -1,41 +0,0 @@ -export class v12141580864313253 { - constructor() { - this.name = "v12141580864313253"; - } - async up(queryRunner) { - await queryRunner.query( - `ALTER TABLE "meta" RENAME COLUMN "proxyAccount" TO "proxyAccountId"`, - undefined, - ); - await queryRunner.query( - `ALTER TABLE "meta" DROP COLUMN "proxyAccountId"`, - undefined, - ); - await queryRunner.query( - `ALTER TABLE "meta" ADD "proxyAccountId" character varying(32)`, - undefined, - ); - await queryRunner.query( - `ALTER TABLE "meta" ADD CONSTRAINT "FK_ab1bc0c1e209daa77b8e8d212ad" FOREIGN KEY ("proxyAccountId") REFERENCES "user"("id") ON DELETE SET NULL ON UPDATE NO ACTION`, - undefined, - ); - } - async down(queryRunner) { - await queryRunner.query( - `ALTER TABLE "meta" DROP CONSTRAINT "FK_ab1bc0c1e209daa77b8e8d212ad"`, - undefined, - ); - await queryRunner.query( - `ALTER TABLE "meta" DROP COLUMN "proxyAccountId"`, - undefined, - ); - await queryRunner.query( - `ALTER TABLE "meta" ADD "proxyAccountId" character varying(128)`, - undefined, - ); - await queryRunner.query( - `ALTER TABLE "meta" RENAME COLUMN "proxyAccountId" TO "proxyAccount"`, - undefined, - ); - } -} diff --git a/packages/backend/migration/1581526429287-user-group-invitation.js b/packages/backend/migration/1581526429287-user-group-invitation.js deleted file mode 100644 index e327816ea7..0000000000 --- a/packages/backend/migration/1581526429287-user-group-invitation.js +++ /dev/null @@ -1,107 +0,0 @@ -export class userGroupInvitation1581526429287 { - constructor() { - this.name = "userGroupInvitation1581526429287"; - } - async up(queryRunner) { - await queryRunner.query( - `CREATE TABLE "user_group_invitation" ("id" character varying(32) NOT NULL, "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL, "userId" character varying(32) NOT NULL, "userGroupId" character varying(32) NOT NULL, CONSTRAINT "PK_160c63ec02bf23f6a5c5e8140d6" PRIMARY KEY ("id"))`, - undefined, - ); - await queryRunner.query( - `CREATE INDEX "IDX_bfbc6305547539369fe73eb144" ON "user_group_invitation" ("userId") `, - undefined, - ); - await queryRunner.query( - `CREATE INDEX "IDX_5cc8c468090e129857e9fecce5" ON "user_group_invitation" ("userGroupId") `, - undefined, - ); - await queryRunner.query( - `CREATE UNIQUE INDEX "IDX_e9793f65f504e5a31fbaedbf2f" ON "user_group_invitation" ("userId", "userGroupId") `, - undefined, - ); - await queryRunner.query( - `ALTER TABLE "notification" ADD "userGroupInvitationId" character varying(32)`, - undefined, - ); - await queryRunner.query( - `ALTER TYPE "public"."notification_type_enum" RENAME TO "notification_type_enum_old"`, - undefined, - ); - await queryRunner.query( - `CREATE TYPE "notification_type_enum" AS ENUM('follow', 'mention', 'reply', 'renote', 'quote', 'reaction', 'pollVote', 'receiveFollowRequest', 'followRequestAccepted', 'groupInvited')`, - undefined, - ); - await queryRunner.query( - `ALTER TABLE "notification" ALTER COLUMN "type" TYPE "notification_type_enum" USING "type"::"text"::"notification_type_enum"`, - undefined, - ); - await queryRunner.query( - `DROP TYPE "notification_type_enum_old"`, - undefined, - ); - await queryRunner.query( - `COMMENT ON COLUMN "notification"."type" IS 'The type of the Notification.'`, - undefined, - ); - await queryRunner.query( - `ALTER TABLE "user_group_invitation" ADD CONSTRAINT "FK_bfbc6305547539369fe73eb144a" FOREIGN KEY ("userId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, - undefined, - ); - await queryRunner.query( - `ALTER TABLE "user_group_invitation" ADD CONSTRAINT "FK_5cc8c468090e129857e9fecce5a" FOREIGN KEY ("userGroupId") REFERENCES "user_group"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, - undefined, - ); - await queryRunner.query( - `ALTER TABLE "notification" ADD CONSTRAINT "FK_8fe87814e978053a53b1beb7e98" FOREIGN KEY ("userGroupInvitationId") REFERENCES "user_group_invitation"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, - undefined, - ); - } - async down(queryRunner) { - await queryRunner.query( - `ALTER TABLE "notification" DROP CONSTRAINT "FK_8fe87814e978053a53b1beb7e98"`, - undefined, - ); - await queryRunner.query( - `ALTER TABLE "user_group_invitation" DROP CONSTRAINT "FK_5cc8c468090e129857e9fecce5a"`, - undefined, - ); - await queryRunner.query( - `ALTER TABLE "user_group_invitation" DROP CONSTRAINT "FK_bfbc6305547539369fe73eb144a"`, - undefined, - ); - await queryRunner.query( - `COMMENT ON COLUMN "notification"."type" IS ''`, - undefined, - ); - await queryRunner.query( - `CREATE TYPE "notification_type_enum_old" AS ENUM('follow', 'mention', 'reply', 'renote', 'quote', 'reaction', 'pollVote', 'receiveFollowRequest', 'followRequestAccepted')`, - undefined, - ); - await queryRunner.query( - `ALTER TABLE "notification" ALTER COLUMN "type" TYPE "notification_type_enum_old" USING "type"::"text"::"notification_type_enum_old"`, - undefined, - ); - await queryRunner.query(`DROP TYPE "notification_type_enum"`, undefined); - await queryRunner.query( - `ALTER TYPE "notification_type_enum_old" RENAME TO "notification_type_enum"`, - undefined, - ); - await queryRunner.query( - `ALTER TABLE "notification" DROP COLUMN "userGroupInvitationId"`, - undefined, - ); - await queryRunner.query( - `DROP INDEX "IDX_e9793f65f504e5a31fbaedbf2f"`, - undefined, - ); - await queryRunner.query( - `DROP INDEX "IDX_5cc8c468090e129857e9fecce5"`, - undefined, - ); - await queryRunner.query( - `DROP INDEX "IDX_bfbc6305547539369fe73eb144"`, - undefined, - ); - await queryRunner.query(`DROP TABLE "user_group_invitation"`, undefined); - } -} diff --git a/packages/backend/migration/1581695816408-user-group-antenna.js b/packages/backend/migration/1581695816408-user-group-antenna.js deleted file mode 100644 index 28112767e7..0000000000 --- a/packages/backend/migration/1581695816408-user-group-antenna.js +++ /dev/null @@ -1,67 +0,0 @@ -export class userGroupAntenna1581695816408 { - constructor() { - this.name = "userGroupAntenna1581695816408"; - } - async up(queryRunner) { - await queryRunner.query( - `ALTER TABLE "antenna" ADD "userGroupJoiningId" character varying(32)`, - undefined, - ); - await queryRunner.query( - `ALTER TYPE "public"."antenna_src_enum" RENAME TO "antenna_src_enum_old"`, - undefined, - ); - await queryRunner.query( - `CREATE TYPE "antenna_src_enum" AS ENUM('home', 'all', 'users', 'list', 'group')`, - undefined, - ); - await queryRunner.query( - `ALTER TABLE "antenna" ALTER COLUMN "src" TYPE "antenna_src_enum" USING "src"::"text"::"antenna_src_enum"`, - undefined, - ); - await queryRunner.query(`DROP TYPE "antenna_src_enum_old"`, undefined); - await queryRunner.query( - `ALTER TABLE "antenna" DROP COLUMN "users"`, - undefined, - ); - await queryRunner.query( - `ALTER TABLE "antenna" ADD "users" character varying(1024) array NOT NULL DEFAULT '{}'::varchar[]`, - undefined, - ); - await queryRunner.query( - `ALTER TABLE "antenna" ADD CONSTRAINT "FK_ccbf5a8c0be4511133dcc50ddeb" FOREIGN KEY ("userGroupJoiningId") REFERENCES "user_group_joining"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, - undefined, - ); - } - async down(queryRunner) { - await queryRunner.query( - `ALTER TABLE "antenna" DROP CONSTRAINT "FK_ccbf5a8c0be4511133dcc50ddeb"`, - undefined, - ); - await queryRunner.query( - `ALTER TABLE "antenna" DROP COLUMN "users"`, - undefined, - ); - await queryRunner.query( - `ALTER TABLE "antenna" ADD "users" character varying array NOT NULL DEFAULT '{}'`, - undefined, - ); - await queryRunner.query( - `CREATE TYPE "antenna_src_enum_old" AS ENUM('home', 'all', 'users', 'list')`, - undefined, - ); - await queryRunner.query( - `ALTER TABLE "antenna" ALTER COLUMN "src" TYPE "antenna_src_enum_old" USING "src"::"text"::"antenna_src_enum_old"`, - undefined, - ); - await queryRunner.query(`DROP TYPE "antenna_src_enum"`, undefined); - await queryRunner.query( - `ALTER TYPE "antenna_src_enum_old" RENAME TO "antenna_src_enum"`, - undefined, - ); - await queryRunner.query( - `ALTER TABLE "antenna" DROP COLUMN "userGroupJoiningId"`, - undefined, - ); - } -} diff --git a/packages/backend/migration/1581708415836-drive-user-folder-id-index.js b/packages/backend/migration/1581708415836-drive-user-folder-id-index.js deleted file mode 100644 index 41902dc53f..0000000000 --- a/packages/backend/migration/1581708415836-drive-user-folder-id-index.js +++ /dev/null @@ -1,17 +0,0 @@ -export class driveUserFolderIdIndex1581708415836 { - constructor() { - this.name = "driveUserFolderIdIndex1581708415836"; - } - async up(queryRunner) { - await queryRunner.query( - `CREATE INDEX "IDX_55720b33a61a7c806a8215b825" ON "drive_file" ("userId", "folderId", "id") `, - undefined, - ); - } - async down(queryRunner) { - await queryRunner.query( - `DROP INDEX "IDX_55720b33a61a7c806a8215b825"`, - undefined, - ); - } -} diff --git a/packages/backend/migration/1581979837262-promo.js b/packages/backend/migration/1581979837262-promo.js deleted file mode 100644 index 39e79965b7..0000000000 --- a/packages/backend/migration/1581979837262-promo.js +++ /dev/null @@ -1,67 +0,0 @@ -export class promo1581979837262 { - constructor() { - this.name = "promo1581979837262"; - } - async up(queryRunner) { - await queryRunner.query( - `CREATE TABLE "promo_note" ("noteId" character varying(32) NOT NULL, "expiresAt" TIMESTAMP WITH TIME ZONE NOT NULL, "userId" character varying(32) NOT NULL, CONSTRAINT "REL_e263909ca4fe5d57f8d4230dd5" UNIQUE ("noteId"), CONSTRAINT "PK_e263909ca4fe5d57f8d4230dd5c" PRIMARY KEY ("noteId"))`, - undefined, - ); - await queryRunner.query( - `CREATE INDEX "IDX_83f0862e9bae44af52ced7099e" ON "promo_note" ("userId") `, - undefined, - ); - await queryRunner.query( - `CREATE TABLE "promo_read" ("id" character varying(32) NOT NULL, "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL, "userId" character varying(32) NOT NULL, "noteId" character varying(32) NOT NULL, CONSTRAINT "PK_61917c1541002422b703318b7c9" PRIMARY KEY ("id"))`, - undefined, - ); - await queryRunner.query( - `CREATE INDEX "IDX_9657d55550c3d37bfafaf7d4b0" ON "promo_read" ("userId") `, - undefined, - ); - await queryRunner.query( - `CREATE UNIQUE INDEX "IDX_2882b8a1a07c7d281a98b6db16" ON "promo_read" ("userId", "noteId") `, - undefined, - ); - await queryRunner.query( - `ALTER TABLE "promo_note" ADD CONSTRAINT "FK_e263909ca4fe5d57f8d4230dd5c" FOREIGN KEY ("noteId") REFERENCES "note"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, - undefined, - ); - await queryRunner.query( - `ALTER TABLE "promo_read" ADD CONSTRAINT "FK_9657d55550c3d37bfafaf7d4b05" FOREIGN KEY ("userId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, - undefined, - ); - await queryRunner.query( - `ALTER TABLE "promo_read" ADD CONSTRAINT "FK_a46a1a603ecee695d7db26da5f4" FOREIGN KEY ("noteId") REFERENCES "note"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, - undefined, - ); - } - async down(queryRunner) { - await queryRunner.query( - `ALTER TABLE "promo_read" DROP CONSTRAINT "FK_a46a1a603ecee695d7db26da5f4"`, - undefined, - ); - await queryRunner.query( - `ALTER TABLE "promo_read" DROP CONSTRAINT "FK_9657d55550c3d37bfafaf7d4b05"`, - undefined, - ); - await queryRunner.query( - `ALTER TABLE "promo_note" DROP CONSTRAINT "FK_e263909ca4fe5d57f8d4230dd5c"`, - undefined, - ); - await queryRunner.query( - `DROP INDEX "IDX_2882b8a1a07c7d281a98b6db16"`, - undefined, - ); - await queryRunner.query( - `DROP INDEX "IDX_9657d55550c3d37bfafaf7d4b0"`, - undefined, - ); - await queryRunner.query(`DROP TABLE "promo_read"`, undefined); - await queryRunner.query( - `DROP INDEX "IDX_83f0862e9bae44af52ced7099e"`, - undefined, - ); - await queryRunner.query(`DROP TABLE "promo_note"`, undefined); - } -} diff --git a/packages/backend/migration/1582019042083-featured-injecttion.js b/packages/backend/migration/1582019042083-featured-injecttion.js deleted file mode 100644 index 61b7d0c272..0000000000 --- a/packages/backend/migration/1582019042083-featured-injecttion.js +++ /dev/null @@ -1,17 +0,0 @@ -export class featuredInjecttion1582019042083 { - constructor() { - this.name = "featuredInjecttion1582019042083"; - } - async up(queryRunner) { - await queryRunner.query( - `ALTER TABLE "user_profile" ADD "injectFeaturedNote" boolean NOT NULL DEFAULT true`, - undefined, - ); - } - async down(queryRunner) { - await queryRunner.query( - `ALTER TABLE "user_profile" DROP COLUMN "injectFeaturedNote"`, - undefined, - ); - } -} diff --git a/packages/backend/migration/1582210532752-antenna-exclude.js b/packages/backend/migration/1582210532752-antenna-exclude.js deleted file mode 100644 index 5a394270ef..0000000000 --- a/packages/backend/migration/1582210532752-antenna-exclude.js +++ /dev/null @@ -1,17 +0,0 @@ -export class antennaExclude1582210532752 { - constructor() { - this.name = "antennaExclude1582210532752"; - } - async up(queryRunner) { - await queryRunner.query( - `ALTER TABLE "antenna" ADD "excludeKeywords" jsonb NOT NULL DEFAULT '[]'`, - undefined, - ); - } - async down(queryRunner) { - await queryRunner.query( - `ALTER TABLE "antenna" DROP COLUMN "excludeKeywords"`, - undefined, - ); - } -} diff --git a/packages/backend/migration/1582875306439-note-reaction-length.js b/packages/backend/migration/1582875306439-note-reaction-length.js deleted file mode 100644 index 2c9b726732..0000000000 --- a/packages/backend/migration/1582875306439-note-reaction-length.js +++ /dev/null @@ -1,17 +0,0 @@ -export class noteReactionLength1582875306439 { - constructor() { - this.name = "noteReactionLength1582875306439"; - } - async up(queryRunner) { - await queryRunner.query( - `ALTER TABLE "note_reaction" ALTER COLUMN "reaction" TYPE character varying(130)`, - undefined, - ); - } - async down(queryRunner) { - await queryRunner.query( - `ALTER TABLE "note_reaction" ALTER COLUMN "reaction" TYPE character varying(128)`, - undefined, - ); - } -} diff --git a/packages/backend/migration/1585361548360-miauth.js b/packages/backend/migration/1585361548360-miauth.js deleted file mode 100644 index 2e052cb89a..0000000000 --- a/packages/backend/migration/1585361548360-miauth.js +++ /dev/null @@ -1,105 +0,0 @@ -export class miauth1585361548360 { - constructor() { - this.name = "miauth1585361548360"; - } - async up(queryRunner) { - await queryRunner.query( - `ALTER TABLE "access_token" ADD "lastUsedAt" TIMESTAMP WITH TIME ZONE DEFAULT null`, - undefined, - ); - await queryRunner.query( - `ALTER TABLE "access_token" ADD "session" character varying(128) DEFAULT null`, - undefined, - ); - await queryRunner.query( - `ALTER TABLE "access_token" ADD "name" character varying(128) DEFAULT null`, - undefined, - ); - await queryRunner.query( - `ALTER TABLE "access_token" ADD "description" character varying(512) DEFAULT null`, - undefined, - ); - await queryRunner.query( - `ALTER TABLE "access_token" ADD "iconUrl" character varying(512) DEFAULT null`, - undefined, - ); - await queryRunner.query( - `ALTER TABLE "access_token" ADD "permission" character varying(64) array NOT NULL DEFAULT '{}'::varchar[]`, - undefined, - ); - await queryRunner.query( - `ALTER TABLE "access_token" ADD "fetched" boolean NOT NULL DEFAULT false`, - undefined, - ); - await queryRunner.query( - `ALTER TABLE "access_token" DROP CONSTRAINT "FK_a3ff16c90cc87a82a0b5959e560"`, - undefined, - ); - await queryRunner.query( - `ALTER TABLE "access_token" ALTER COLUMN "appId" DROP NOT NULL`, - undefined, - ); - await queryRunner.query( - `ALTER TABLE "access_token" ALTER COLUMN "appId" SET DEFAULT null`, - undefined, - ); - await queryRunner.query( - `CREATE INDEX "IDX_bf3a053c07d9fb5d87317c56ee" ON "access_token" ("session") `, - undefined, - ); - await queryRunner.query( - `ALTER TABLE "access_token" ADD CONSTRAINT "FK_a3ff16c90cc87a82a0b5959e560" FOREIGN KEY ("appId") REFERENCES "app"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, - undefined, - ); - } - async down(queryRunner) { - await queryRunner.query( - `ALTER TABLE "access_token" DROP CONSTRAINT "FK_a3ff16c90cc87a82a0b5959e560"`, - undefined, - ); - await queryRunner.query( - `DROP INDEX "IDX_bf3a053c07d9fb5d87317c56ee"`, - undefined, - ); - await queryRunner.query( - `ALTER TABLE "access_token" ALTER COLUMN "appId" DROP DEFAULT`, - undefined, - ); - await queryRunner.query( - `ALTER TABLE "access_token" ALTER COLUMN "appId" SET NOT NULL`, - undefined, - ); - await queryRunner.query( - `ALTER TABLE "access_token" ADD CONSTRAINT "FK_a3ff16c90cc87a82a0b5959e560" FOREIGN KEY ("appId") REFERENCES "app"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, - undefined, - ); - await queryRunner.query( - `ALTER TABLE "access_token" DROP COLUMN "fetched"`, - undefined, - ); - await queryRunner.query( - `ALTER TABLE "access_token" DROP COLUMN "permission"`, - undefined, - ); - await queryRunner.query( - `ALTER TABLE "access_token" DROP COLUMN "iconUrl"`, - undefined, - ); - await queryRunner.query( - `ALTER TABLE "access_token" DROP COLUMN "description"`, - undefined, - ); - await queryRunner.query( - `ALTER TABLE "access_token" DROP COLUMN "name"`, - undefined, - ); - await queryRunner.query( - `ALTER TABLE "access_token" DROP COLUMN "session"`, - undefined, - ); - await queryRunner.query( - `ALTER TABLE "access_token" DROP COLUMN "lastUsedAt"`, - undefined, - ); - } -} diff --git a/packages/backend/migration/1585385921215-custom-notification.js b/packages/backend/migration/1585385921215-custom-notification.js deleted file mode 100644 index 23142cd3a8..0000000000 --- a/packages/backend/migration/1585385921215-custom-notification.js +++ /dev/null @@ -1,150 +0,0 @@ -export class customNotification1585385921215 { - constructor() { - this.name = "customNotification1585385921215"; - } - async up(queryRunner) { - await queryRunner.query( - `ALTER TABLE "notification" ADD "customBody" character varying(2048)`, - undefined, - ); - await queryRunner.query( - `ALTER TABLE "notification" ADD "customHeader" character varying(256)`, - undefined, - ); - await queryRunner.query( - `ALTER TABLE "notification" ADD "customIcon" character varying(1024)`, - undefined, - ); - await queryRunner.query( - `ALTER TABLE "notification" ADD "appAccessTokenId" character varying(32)`, - undefined, - ); - await queryRunner.query( - `ALTER TABLE "notification" DROP CONSTRAINT "FK_3b4e96eec8d36a8bbb9d02aa710"`, - undefined, - ); - await queryRunner.query( - `ALTER TABLE "notification" ALTER COLUMN "notifierId" DROP NOT NULL`, - undefined, - ); - await queryRunner.query( - `COMMENT ON COLUMN "notification"."notifierId" IS 'The ID of sender user of the Notification.'`, - undefined, - ); - await queryRunner.query( - `ALTER TYPE "public"."notification_type_enum" RENAME TO "notification_type_enum_old"`, - undefined, - ); - await queryRunner.query( - `CREATE TYPE "notification_type_enum" AS ENUM('follow', 'mention', 'reply', 'renote', 'quote', 'reaction', 'pollVote', 'receiveFollowRequest', 'followRequestAccepted', 'groupInvited', 'app')`, - undefined, - ); - await queryRunner.query( - `ALTER TABLE "notification" ALTER COLUMN "type" TYPE "notification_type_enum" USING "type"::"text"::"notification_type_enum"`, - undefined, - ); - await queryRunner.query( - `DROP TYPE "notification_type_enum_old"`, - undefined, - ); - await queryRunner.query( - `COMMENT ON COLUMN "notification"."type" IS 'The type of the Notification.'`, - undefined, - ); - await queryRunner.query( - `CREATE INDEX "IDX_3b4e96eec8d36a8bbb9d02aa71" ON "notification" ("notifierId") `, - undefined, - ); - await queryRunner.query( - `CREATE INDEX "IDX_33f33cc8ef29d805a97ff4628b" ON "notification" ("type") `, - undefined, - ); - await queryRunner.query( - `CREATE INDEX "IDX_080ab397c379af09b9d2169e5b" ON "notification" ("isRead") `, - undefined, - ); - await queryRunner.query( - `CREATE INDEX "IDX_e22bf6bda77b6adc1fd9e75c8c" ON "notification" ("appAccessTokenId") `, - undefined, - ); - await queryRunner.query( - `ALTER TABLE "notification" ADD CONSTRAINT "FK_3b4e96eec8d36a8bbb9d02aa710" FOREIGN KEY ("notifierId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, - undefined, - ); - await queryRunner.query( - `ALTER TABLE "notification" ADD CONSTRAINT "FK_e22bf6bda77b6adc1fd9e75c8c9" FOREIGN KEY ("appAccessTokenId") REFERENCES "access_token"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, - undefined, - ); - } - async down(queryRunner) { - await queryRunner.query( - `ALTER TABLE "notification" DROP CONSTRAINT "FK_e22bf6bda77b6adc1fd9e75c8c9"`, - undefined, - ); - await queryRunner.query( - `ALTER TABLE "notification" DROP CONSTRAINT "FK_3b4e96eec8d36a8bbb9d02aa710"`, - undefined, - ); - await queryRunner.query( - `DROP INDEX "IDX_e22bf6bda77b6adc1fd9e75c8c"`, - undefined, - ); - await queryRunner.query( - `DROP INDEX "IDX_080ab397c379af09b9d2169e5b"`, - undefined, - ); - await queryRunner.query( - `DROP INDEX "IDX_33f33cc8ef29d805a97ff4628b"`, - undefined, - ); - await queryRunner.query( - `DROP INDEX "IDX_3b4e96eec8d36a8bbb9d02aa71"`, - undefined, - ); - await queryRunner.query( - `COMMENT ON COLUMN "notification"."type" IS ''`, - undefined, - ); - await queryRunner.query( - `CREATE TYPE "notification_type_enum_old" AS ENUM('follow', 'mention', 'reply', 'renote', 'quote', 'reaction', 'pollVote', 'receiveFollowRequest', 'followRequestAccepted', 'groupInvited')`, - undefined, - ); - await queryRunner.query( - `ALTER TABLE "notification" ALTER COLUMN "type" TYPE "notification_type_enum_old" USING "type"::"text"::"notification_type_enum_old"`, - undefined, - ); - await queryRunner.query(`DROP TYPE "notification_type_enum"`, undefined); - await queryRunner.query( - `ALTER TYPE "notification_type_enum_old" RENAME TO "notification_type_enum"`, - undefined, - ); - await queryRunner.query( - `COMMENT ON COLUMN "notification"."notifierId" IS ''`, - undefined, - ); - await queryRunner.query( - `ALTER TABLE "notification" ALTER COLUMN "notifierId" SET NOT NULL`, - undefined, - ); - await queryRunner.query( - `ALTER TABLE "notification" ADD CONSTRAINT "FK_3b4e96eec8d36a8bbb9d02aa710" FOREIGN KEY ("notifierId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, - undefined, - ); - await queryRunner.query( - `ALTER TABLE "notification" DROP COLUMN "appAccessTokenId"`, - undefined, - ); - await queryRunner.query( - `ALTER TABLE "notification" DROP COLUMN "customIcon"`, - undefined, - ); - await queryRunner.query( - `ALTER TABLE "notification" DROP COLUMN "customHeader"`, - undefined, - ); - await queryRunner.query( - `ALTER TABLE "notification" DROP COLUMN "customBody"`, - undefined, - ); - } -} diff --git a/packages/backend/migration/1585772678853-ap-url.js b/packages/backend/migration/1585772678853-ap-url.js deleted file mode 100644 index 18cc4588e6..0000000000 --- a/packages/backend/migration/1585772678853-ap-url.js +++ /dev/null @@ -1,14 +0,0 @@ -export class apUrl1585772678853 { - constructor() { - this.name = "apUrl1585772678853"; - } - async up(queryRunner) { - await queryRunner.query( - `ALTER TABLE "note" ADD "url" character varying(512)`, - undefined, - ); - } - async down(queryRunner) { - await queryRunner.query(`ALTER TABLE "note" DROP COLUMN "url"`, undefined); - } -} diff --git a/packages/backend/migration/1586624197029-AddObjectStorageUseProxy.js b/packages/backend/migration/1586624197029-AddObjectStorageUseProxy.js deleted file mode 100644 index 89694f84b2..0000000000 --- a/packages/backend/migration/1586624197029-AddObjectStorageUseProxy.js +++ /dev/null @@ -1,17 +0,0 @@ -export class AddObjectStorageUseProxy1586624197029 { - constructor() { - this.name = "AddObjectStorageUseProxy1586624197029"; - } - async up(queryRunner) { - await queryRunner.query( - `ALTER TABLE "meta" ADD "objectStorageUseProxy" boolean NOT NULL DEFAULT true`, - undefined, - ); - } - async down(queryRunner) { - await queryRunner.query( - `ALTER TABLE "meta" DROP COLUMN "objectStorageUseProxy"`, - undefined, - ); - } -} diff --git a/packages/backend/migration/1586641139527-remote-reaction.js b/packages/backend/migration/1586641139527-remote-reaction.js deleted file mode 100644 index d7390544c4..0000000000 --- a/packages/backend/migration/1586641139527-remote-reaction.js +++ /dev/null @@ -1,17 +0,0 @@ -export class remoteReaction1586641139527 { - constructor() { - this.name = "remoteReaction1586641139527"; - } - async up(queryRunner) { - await queryRunner.query( - `ALTER TABLE "note_reaction" ALTER COLUMN "reaction" TYPE character varying(260)`, - undefined, - ); - } - async down(queryRunner) { - await queryRunner.query( - `ALTER TABLE "note_reaction" ALTER COLUMN "reaction" TYPE character varying(130)`, - undefined, - ); - } -} diff --git a/packages/backend/migration/1586708940386-pageAiScript.js b/packages/backend/migration/1586708940386-pageAiScript.js deleted file mode 100644 index 25eb710988..0000000000 --- a/packages/backend/migration/1586708940386-pageAiScript.js +++ /dev/null @@ -1,17 +0,0 @@ -export class pageAiScript1586708940386 { - constructor() { - this.name = "pageAiScript1586708940386"; - } - async up(queryRunner) { - await queryRunner.query( - `ALTER TABLE "page" ADD "script" character varying(16384) NOT NULL DEFAULT ''`, - undefined, - ); - } - async down(queryRunner) { - await queryRunner.query( - `ALTER TABLE "page" DROP COLUMN "script"`, - undefined, - ); - } -} diff --git a/packages/backend/migration/1588044505511-hCaptcha.js b/packages/backend/migration/1588044505511-hCaptcha.js deleted file mode 100644 index 29ba87370f..0000000000 --- a/packages/backend/migration/1588044505511-hCaptcha.js +++ /dev/null @@ -1,33 +0,0 @@ -export class hCaptcha1588044505511 { - constructor() { - this.name = "hCaptcha1588044505511"; - } - async up(queryRunner) { - await queryRunner.query( - `ALTER TABLE "meta" ADD "enableHcaptcha" boolean NOT NULL DEFAULT false`, - undefined, - ); - await queryRunner.query( - `ALTER TABLE "meta" ADD "hcaptchaSiteKey" character varying(64)`, - undefined, - ); - await queryRunner.query( - `ALTER TABLE "meta" ADD "hcaptchaSecretKey" character varying(64)`, - undefined, - ); - } - async down(queryRunner) { - await queryRunner.query( - `ALTER TABLE "meta" DROP COLUMN "hcaptchaSecretKey"`, - undefined, - ); - await queryRunner.query( - `ALTER TABLE "meta" DROP COLUMN "hcaptchaSiteKey"`, - undefined, - ); - await queryRunner.query( - `ALTER TABLE "meta" DROP COLUMN "enableHcaptcha"`, - undefined, - ); - } -} diff --git a/packages/backend/migration/1589023282116-pubRelay.js b/packages/backend/migration/1589023282116-pubRelay.js deleted file mode 100644 index a1a2299192..0000000000 --- a/packages/backend/migration/1589023282116-pubRelay.js +++ /dev/null @@ -1,27 +0,0 @@ -export class pubRelay1589023282116 { - constructor() { - this.name = "pubRelay1589023282116"; - } - async up(queryRunner) { - await queryRunner.query( - `CREATE TYPE "relay_status_enum" AS ENUM('requesting', 'accepted', 'rejected')`, - undefined, - ); - await queryRunner.query( - `CREATE TABLE "relay" ("id" character varying(32) NOT NULL, "inbox" character varying(512) NOT NULL, "status" "relay_status_enum" NOT NULL, CONSTRAINT "PK_78ebc9cfddf4292633b7ba57aee" PRIMARY KEY ("id"))`, - undefined, - ); - await queryRunner.query( - `CREATE UNIQUE INDEX "IDX_0d9a1738f2cf7f3b1c3334dfab" ON "relay" ("inbox") `, - undefined, - ); - } - async down(queryRunner) { - await queryRunner.query( - `DROP INDEX "IDX_0d9a1738f2cf7f3b1c3334dfab"`, - undefined, - ); - await queryRunner.query(`DROP TABLE "relay"`, undefined); - await queryRunner.query(`DROP TYPE "relay_status_enum"`, undefined); - } -} diff --git a/packages/backend/migration/1595075960584-blurhash.js b/packages/backend/migration/1595075960584-blurhash.js deleted file mode 100644 index 50660cd055..0000000000 --- a/packages/backend/migration/1595075960584-blurhash.js +++ /dev/null @@ -1,13 +0,0 @@ -export class blurhash1595075960584 { - constructor() { - this.name = "blurhash1595075960584"; - } - async up(queryRunner) { - await queryRunner.query( - `ALTER TABLE "drive_file" ADD "blurhash" character varying(128)`, - ); - } - async down(queryRunner) { - await queryRunner.query(`ALTER TABLE "drive_file" DROP COLUMN "blurhash"`); - } -} diff --git a/packages/backend/migration/1595077605646-blurhash-for-avatar-banner.js b/packages/backend/migration/1595077605646-blurhash-for-avatar-banner.js deleted file mode 100644 index 612ab648cb..0000000000 --- a/packages/backend/migration/1595077605646-blurhash-for-avatar-banner.js +++ /dev/null @@ -1,25 +0,0 @@ -export class blurhashForAvatarBanner1595077605646 { - constructor() { - this.name = "blurhashForAvatarBanner1595077605646"; - } - async up(queryRunner) { - await queryRunner.query(`ALTER TABLE "user" DROP COLUMN "avatarColor"`); - await queryRunner.query(`ALTER TABLE "user" DROP COLUMN "bannerColor"`); - await queryRunner.query( - `ALTER TABLE "user" ADD "avatarBlurhash" character varying(128)`, - ); - await queryRunner.query( - `ALTER TABLE "user" ADD "bannerBlurhash" character varying(128)`, - ); - } - async down(queryRunner) { - await queryRunner.query(`ALTER TABLE "user" DROP COLUMN "bannerBlurhash"`); - await queryRunner.query(`ALTER TABLE "user" DROP COLUMN "avatarBlurhash"`); - await queryRunner.query( - `ALTER TABLE "user" ADD "bannerColor" character varying(32)`, - ); - await queryRunner.query( - `ALTER TABLE "user" ADD "avatarColor" character varying(32)`, - ); - } -} diff --git a/packages/backend/migration/1595676934834-instance-icon-url.js b/packages/backend/migration/1595676934834-instance-icon-url.js deleted file mode 100644 index c228b14b6c..0000000000 --- a/packages/backend/migration/1595676934834-instance-icon-url.js +++ /dev/null @@ -1,13 +0,0 @@ -export class instanceIconUrl1595676934834 { - constructor() { - this.name = "instanceIconUrl1595676934834"; - } - async up(queryRunner) { - await queryRunner.query( - `ALTER TABLE "instance" ADD "iconUrl" character varying(256) DEFAULT null`, - ); - } - async down(queryRunner) { - await queryRunner.query(`ALTER TABLE "instance" DROP COLUMN "iconUrl"`); - } -} diff --git a/packages/backend/migration/1595771249699-word-mute.js b/packages/backend/migration/1595771249699-word-mute.js deleted file mode 100644 index 0a8a63294d..0000000000 --- a/packages/backend/migration/1595771249699-word-mute.js +++ /dev/null @@ -1,53 +0,0 @@ -export class wordMute1595771249699 { - constructor() { - this.name = "wordMute1595771249699"; - } - async up(queryRunner) { - await queryRunner.query( - `CREATE TABLE "muted_note" ("id" character varying(32) NOT NULL, "noteId" character varying(32) NOT NULL, "userId" character varying(32) NOT NULL, CONSTRAINT "PK_897e2eff1c0b9b64e55ca1418a4" PRIMARY KEY ("id"))`, - ); - await queryRunner.query( - `CREATE INDEX "IDX_70ab9786313d78e4201d81cdb8" ON "muted_note" ("noteId") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_d8e07aa18c2d64e86201601aec" ON "muted_note" ("userId") `, - ); - await queryRunner.query( - `CREATE UNIQUE INDEX "IDX_a8c6bfd637d3f1d67a27c48e27" ON "muted_note" ("noteId", "userId") `, - ); - await queryRunner.query( - `ALTER TABLE "user_profile" ADD "enableWordMute" boolean NOT NULL DEFAULT false`, - ); - await queryRunner.query( - `ALTER TABLE "user_profile" ADD "mutedWords" jsonb NOT NULL DEFAULT '[]'`, - ); - await queryRunner.query( - `CREATE INDEX "IDX_3befe6f999c86aff06eb0257b4" ON "user_profile" ("enableWordMute") `, - ); - await queryRunner.query( - `ALTER TABLE "muted_note" ADD CONSTRAINT "FK_70ab9786313d78e4201d81cdb89" FOREIGN KEY ("noteId") REFERENCES "note"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, - ); - await queryRunner.query( - `ALTER TABLE "muted_note" ADD CONSTRAINT "FK_d8e07aa18c2d64e86201601aec1" FOREIGN KEY ("userId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, - ); - } - async down(queryRunner) { - await queryRunner.query( - `ALTER TABLE "muted_note" DROP CONSTRAINT "FK_d8e07aa18c2d64e86201601aec1"`, - ); - await queryRunner.query( - `ALTER TABLE "muted_note" DROP CONSTRAINT "FK_70ab9786313d78e4201d81cdb89"`, - ); - await queryRunner.query(`DROP INDEX "IDX_3befe6f999c86aff06eb0257b4"`); - await queryRunner.query( - `ALTER TABLE "user_profile" DROP COLUMN "mutedWords"`, - ); - await queryRunner.query( - `ALTER TABLE "user_profile" DROP COLUMN "enableWordMute"`, - ); - await queryRunner.query(`DROP INDEX "IDX_a8c6bfd637d3f1d67a27c48e27"`); - await queryRunner.query(`DROP INDEX "IDX_d8e07aa18c2d64e86201601aec"`); - await queryRunner.query(`DROP INDEX "IDX_70ab9786313d78e4201d81cdb8"`); - await queryRunner.query(`DROP TABLE "muted_note"`); - } -} diff --git a/packages/backend/migration/1595782306083-word-mute2.js b/packages/backend/migration/1595782306083-word-mute2.js deleted file mode 100644 index 61f06b3474..0000000000 --- a/packages/backend/migration/1595782306083-word-mute2.js +++ /dev/null @@ -1,21 +0,0 @@ -export class wordMute21595782306083 { - constructor() { - this.name = "wordMute21595782306083"; - } - async up(queryRunner) { - await queryRunner.query( - `CREATE TYPE "muted_note_reason_enum" AS ENUM('word', 'manual', 'spam', 'other')`, - ); - await queryRunner.query( - `ALTER TABLE "muted_note" ADD "reason" "muted_note_reason_enum" NOT NULL`, - ); - await queryRunner.query( - `CREATE INDEX "IDX_636e977ff90b23676fb5624b25" ON "muted_note" ("reason") `, - ); - } - async down(queryRunner) { - await queryRunner.query(`DROP INDEX "IDX_636e977ff90b23676fb5624b25"`); - await queryRunner.query(`ALTER TABLE "muted_note" DROP COLUMN "reason"`); - await queryRunner.query(`DROP TYPE "muted_note_reason_enum"`); - } -} diff --git a/packages/backend/migration/1596548170836-channel.js b/packages/backend/migration/1596548170836-channel.js deleted file mode 100644 index 2aaaf95503..0000000000 --- a/packages/backend/migration/1596548170836-channel.js +++ /dev/null @@ -1,115 +0,0 @@ -export class channel1596548170836 { - constructor() { - this.name = "channel1596548170836"; - } - async up(queryRunner) { - await queryRunner.query( - `CREATE TABLE "channel" ("id" character varying(32) NOT NULL, "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL, "lastNotedAt" TIMESTAMP WITH TIME ZONE, "userId" character varying(32) NOT NULL, "name" character varying(128) NOT NULL, "description" character varying(2048), "bannerId" character varying(32), "notesCount" integer NOT NULL DEFAULT 0, "usersCount" integer NOT NULL DEFAULT 0, CONSTRAINT "PK_590f33ee6ee7d76437acf362e39" PRIMARY KEY ("id"))`, - ); - await queryRunner.query( - `CREATE INDEX "IDX_71cb7b435b7c0d4843317e7e16" ON "channel" ("createdAt") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_29ef80c6f13bcea998447fce43" ON "channel" ("lastNotedAt") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_823bae55bd81b3be6e05cff438" ON "channel" ("userId") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_0f58c11241e649d2a638a8de94" ON "channel" ("notesCount") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_094b86cd36bb805d1aa1e8cc9a" ON "channel" ("usersCount") `, - ); - await queryRunner.query( - `CREATE TABLE "channel_following" ("id" character varying(32) NOT NULL, "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL, "followeeId" character varying(32) NOT NULL, "followerId" character varying(32) NOT NULL, CONSTRAINT "PK_8b104be7f7415113f2a02cd5bdd" PRIMARY KEY ("id"))`, - ); - await queryRunner.query( - `CREATE INDEX "IDX_11e71f2511589dcc8a4d3214f9" ON "channel_following" ("createdAt") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_0e43068c3f92cab197c3d3cd86" ON "channel_following" ("followeeId") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_6d8084ec9496e7334a4602707e" ON "channel_following" ("followerId") `, - ); - await queryRunner.query( - `CREATE UNIQUE INDEX "IDX_2e230dd45a10e671d781d99f3e" ON "channel_following" ("followerId", "followeeId") `, - ); - await queryRunner.query( - `CREATE TABLE "channel_note_pining" ("id" character varying(32) NOT NULL, "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL, "channelId" character varying(32) NOT NULL, "noteId" character varying(32) NOT NULL, CONSTRAINT "PK_44f7474496bcf2e4b741681146d" PRIMARY KEY ("id"))`, - ); - await queryRunner.query( - `CREATE INDEX "IDX_8125f950afd3093acb10d2db8a" ON "channel_note_pining" ("channelId") `, - ); - await queryRunner.query( - `CREATE UNIQUE INDEX "IDX_f36fed37d6d4cdcc68c803cd9c" ON "channel_note_pining" ("channelId", "noteId") `, - ); - await queryRunner.query( - `ALTER TABLE "note" ADD "channelId" character varying(32) DEFAULT null`, - ); - await queryRunner.query( - `CREATE INDEX "IDX_f22169eb10657bded6d875ac8f" ON "note" ("channelId") `, - ); - await queryRunner.query( - `ALTER TABLE "channel" ADD CONSTRAINT "FK_823bae55bd81b3be6e05cff4383" FOREIGN KEY ("userId") REFERENCES "user"("id") ON DELETE SET NULL ON UPDATE NO ACTION`, - ); - await queryRunner.query( - `ALTER TABLE "channel" ADD CONSTRAINT "FK_999da2bcc7efadbfe0e92d3bc19" FOREIGN KEY ("bannerId") REFERENCES "drive_file"("id") ON DELETE SET NULL ON UPDATE NO ACTION`, - ); - await queryRunner.query( - `ALTER TABLE "note" ADD CONSTRAINT "FK_f22169eb10657bded6d875ac8f9" FOREIGN KEY ("channelId") REFERENCES "channel"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, - ); - await queryRunner.query( - `ALTER TABLE "channel_following" ADD CONSTRAINT "FK_0e43068c3f92cab197c3d3cd86e" FOREIGN KEY ("followeeId") REFERENCES "channel"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, - ); - await queryRunner.query( - `ALTER TABLE "channel_following" ADD CONSTRAINT "FK_6d8084ec9496e7334a4602707e1" FOREIGN KEY ("followerId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, - ); - await queryRunner.query( - `ALTER TABLE "channel_note_pining" ADD CONSTRAINT "FK_8125f950afd3093acb10d2db8a8" FOREIGN KEY ("channelId") REFERENCES "channel"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, - ); - await queryRunner.query( - `ALTER TABLE "channel_note_pining" ADD CONSTRAINT "FK_10b19ef67d297ea9de325cd4502" FOREIGN KEY ("noteId") REFERENCES "note"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, - ); - } - async down(queryRunner) { - await queryRunner.query( - `ALTER TABLE "channel_note_pining" DROP CONSTRAINT "FK_10b19ef67d297ea9de325cd4502"`, - ); - await queryRunner.query( - `ALTER TABLE "channel_note_pining" DROP CONSTRAINT "FK_8125f950afd3093acb10d2db8a8"`, - ); - await queryRunner.query( - `ALTER TABLE "channel_following" DROP CONSTRAINT "FK_6d8084ec9496e7334a4602707e1"`, - ); - await queryRunner.query( - `ALTER TABLE "channel_following" DROP CONSTRAINT "FK_0e43068c3f92cab197c3d3cd86e"`, - ); - await queryRunner.query( - `ALTER TABLE "note" DROP CONSTRAINT "FK_f22169eb10657bded6d875ac8f9"`, - ); - await queryRunner.query( - `ALTER TABLE "channel" DROP CONSTRAINT "FK_999da2bcc7efadbfe0e92d3bc19"`, - ); - await queryRunner.query( - `ALTER TABLE "channel" DROP CONSTRAINT "FK_823bae55bd81b3be6e05cff4383"`, - ); - await queryRunner.query(`DROP INDEX "IDX_f22169eb10657bded6d875ac8f"`); - await queryRunner.query(`ALTER TABLE "note" DROP COLUMN "channelId"`); - await queryRunner.query(`DROP INDEX "IDX_f36fed37d6d4cdcc68c803cd9c"`); - await queryRunner.query(`DROP INDEX "IDX_8125f950afd3093acb10d2db8a"`); - await queryRunner.query(`DROP TABLE "channel_note_pining"`); - await queryRunner.query(`DROP INDEX "IDX_2e230dd45a10e671d781d99f3e"`); - await queryRunner.query(`DROP INDEX "IDX_6d8084ec9496e7334a4602707e"`); - await queryRunner.query(`DROP INDEX "IDX_0e43068c3f92cab197c3d3cd86"`); - await queryRunner.query(`DROP INDEX "IDX_11e71f2511589dcc8a4d3214f9"`); - await queryRunner.query(`DROP TABLE "channel_following"`); - await queryRunner.query(`DROP INDEX "IDX_094b86cd36bb805d1aa1e8cc9a"`); - await queryRunner.query(`DROP INDEX "IDX_0f58c11241e649d2a638a8de94"`); - await queryRunner.query(`DROP INDEX "IDX_823bae55bd81b3be6e05cff438"`); - await queryRunner.query(`DROP INDEX "IDX_29ef80c6f13bcea998447fce43"`); - await queryRunner.query(`DROP INDEX "IDX_71cb7b435b7c0d4843317e7e16"`); - await queryRunner.query(`DROP TABLE "channel"`); - } -} diff --git a/packages/backend/migration/1596786425167-channel2.js b/packages/backend/migration/1596786425167-channel2.js deleted file mode 100644 index ae871f5ff6..0000000000 --- a/packages/backend/migration/1596786425167-channel2.js +++ /dev/null @@ -1,15 +0,0 @@ -export class channel21596786425167 { - constructor() { - this.name = "channel21596786425167"; - } - async up(queryRunner) { - await queryRunner.query( - `ALTER TABLE "channel_following" ADD "readCursor" TIMESTAMP WITH TIME ZONE NOT NULL`, - ); - } - async down(queryRunner) { - await queryRunner.query( - `ALTER TABLE "channel_following" DROP COLUMN "readCursor"`, - ); - } -} diff --git a/packages/backend/migration/1597230137744-objectStorageSetPublicRead.js b/packages/backend/migration/1597230137744-objectStorageSetPublicRead.js deleted file mode 100644 index 81540d5e8c..0000000000 --- a/packages/backend/migration/1597230137744-objectStorageSetPublicRead.js +++ /dev/null @@ -1,15 +0,0 @@ -export class objectStorageSetPublicRead1597230137744 { - constructor() { - this.name = "objectStorageSetPublicRead1597230137744"; - } - async up(queryRunner) { - await queryRunner.query( - `ALTER TABLE "meta" ADD "objectStorageSetPublicRead" boolean NOT NULL DEFAULT false`, - ); - } - async down(queryRunner) { - await queryRunner.query( - `ALTER TABLE "meta" DROP COLUMN "objectStorageSetPublicRead"`, - ); - } -} diff --git a/packages/backend/migration/1597236229720-IncludingNotificationTypes.js b/packages/backend/migration/1597236229720-IncludingNotificationTypes.js deleted file mode 100644 index ce02148d28..0000000000 --- a/packages/backend/migration/1597236229720-IncludingNotificationTypes.js +++ /dev/null @@ -1,21 +0,0 @@ -export class IncludingNotificationTypes1597236229720 { - constructor() { - this.name = "IncludingNotificationTypes1597236229720"; - } - async up(queryRunner) { - await queryRunner.query( - `CREATE TYPE "user_profile_includingnotificationtypes_enum" AS ENUM('follow', 'mention', 'reply', 'renote', 'quote', 'reaction', 'pollVote', 'receiveFollowRequest', 'followRequestAccepted', 'groupInvited', 'app')`, - ); - await queryRunner.query( - `ALTER TABLE "user_profile" ADD "includingNotificationTypes" "user_profile_includingnotificationtypes_enum" array`, - ); - } - async down(queryRunner) { - await queryRunner.query( - `ALTER TABLE "user_profile" DROP COLUMN "includingNotificationTypes"`, - ); - await queryRunner.query( - `DROP TYPE "user_profile_includingnotificationtypes_enum"`, - ); - } -} diff --git a/packages/backend/migration/1597385880794-add-sensitive-index.js b/packages/backend/migration/1597385880794-add-sensitive-index.js deleted file mode 100644 index d7c818bbfe..0000000000 --- a/packages/backend/migration/1597385880794-add-sensitive-index.js +++ /dev/null @@ -1,13 +0,0 @@ -export class addSensitiveIndex1597385880794 { - constructor() { - this.name = "addSensitiveIndex1597385880794"; - } - async up(queryRunner) { - await queryRunner.query( - `CREATE INDEX "IDX_a7eba67f8b3fa27271e85d2e26" ON "drive_file" ("isSensitive") `, - ); - } - async down(queryRunner) { - await queryRunner.query(`DROP INDEX "IDX_a7eba67f8b3fa27271e85d2e26"`); - } -} diff --git a/packages/backend/migration/1597459042300-channel-unread.js b/packages/backend/migration/1597459042300-channel-unread.js deleted file mode 100644 index 4975a84f92..0000000000 --- a/packages/backend/migration/1597459042300-channel-unread.js +++ /dev/null @@ -1,44 +0,0 @@ -export class channelUnread1597459042300 { - constructor() { - this.name = "channelUnread1597459042300"; - } - async up(queryRunner) { - await queryRunner.query(`TRUNCATE TABLE "note_unread"`, undefined); - await queryRunner.query( - `ALTER TABLE "channel_following" DROP COLUMN "readCursor"`, - ); - await queryRunner.query( - `ALTER TABLE "note_unread" ADD "isMentioned" boolean NOT NULL`, - ); - await queryRunner.query( - `ALTER TABLE "note_unread" ADD "noteChannelId" character varying(32)`, - ); - await queryRunner.query( - `CREATE INDEX "IDX_25b1dd384bec391b07b74b861c" ON "note_unread" ("isMentioned") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_89a29c9237b8c3b6b3cbb4cb30" ON "note_unread" ("isSpecified") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_29e8c1d579af54d4232939f994" ON "note_unread" ("noteUserId") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_6a57f051d82c6d4036c141e107" ON "note_unread" ("noteChannelId") `, - ); - } - async down(queryRunner) { - await queryRunner.query(`DROP INDEX "IDX_6a57f051d82c6d4036c141e107"`); - await queryRunner.query(`DROP INDEX "IDX_29e8c1d579af54d4232939f994"`); - await queryRunner.query(`DROP INDEX "IDX_89a29c9237b8c3b6b3cbb4cb30"`); - await queryRunner.query(`DROP INDEX "IDX_25b1dd384bec391b07b74b861c"`); - await queryRunner.query( - `ALTER TABLE "note_unread" DROP COLUMN "noteChannelId"`, - ); - await queryRunner.query( - `ALTER TABLE "note_unread" DROP COLUMN "isMentioned"`, - ); - await queryRunner.query( - `ALTER TABLE "channel_following" ADD "readCursor" TIMESTAMP WITH TIME ZONE NOT NULL`, - ); - } -} diff --git a/packages/backend/migration/1597893996136-ChannelNoteIdDescIndex.js b/packages/backend/migration/1597893996136-ChannelNoteIdDescIndex.js deleted file mode 100644 index 5a31d51e8b..0000000000 --- a/packages/backend/migration/1597893996136-ChannelNoteIdDescIndex.js +++ /dev/null @@ -1,17 +0,0 @@ -export class ChannelNoteIdDescIndex1597893996136 { - constructor() { - this.name = "ChannelNoteIdDescIndex1597893996136"; - } - async up(queryRunner) { - await queryRunner.query(`DROP INDEX "IDX_f22169eb10657bded6d875ac8f"`); - await queryRunner.query( - `CREATE INDEX "IDX_note_on_channelId_and_id_desc" ON "note" ("channelId", "id" desc)`, - ); - } - async down(queryRunner) { - await queryRunner.query(`DROP INDEX "IDX_note_on_channelId_and_id_desc"`); - await queryRunner.query( - `CREATE INDEX "IDX_f22169eb10657bded6d875ac8f" ON "note" ("channelId") `, - ); - } -} diff --git a/packages/backend/migration/1600353287890-mutingNotificationTypes.js b/packages/backend/migration/1600353287890-mutingNotificationTypes.js deleted file mode 100644 index 2a317b3f9f..0000000000 --- a/packages/backend/migration/1600353287890-mutingNotificationTypes.js +++ /dev/null @@ -1,33 +0,0 @@ -export class mutingNotificationTypes1600353287890 { - constructor() { - this.name = "mutingNotificationTypes1600353287890"; - } - async up(queryRunner) { - await queryRunner.query( - `ALTER TABLE "user_profile" DROP COLUMN "includingNotificationTypes"`, - ); - await queryRunner.query( - `DROP TYPE "public"."user_profile_includingnotificationtypes_enum"`, - ); - await queryRunner.query( - `CREATE TYPE "user_profile_mutingnotificationtypes_enum" AS ENUM('follow', 'mention', 'reply', 'renote', 'quote', 'reaction', 'pollVote', 'receiveFollowRequest', 'followRequestAccepted', 'groupInvited', 'app')`, - ); - await queryRunner.query( - `ALTER TABLE "user_profile" ADD "mutingNotificationTypes" "user_profile_mutingnotificationtypes_enum" array NOT NULL DEFAULT '{}'`, - ); - } - async down(queryRunner) { - await queryRunner.query( - `ALTER TABLE "user_profile" DROP COLUMN "mutingNotificationTypes"`, - ); - await queryRunner.query( - `DROP TYPE "user_profile_mutingnotificationtypes_enum"`, - ); - await queryRunner.query( - `CREATE TYPE "public"."user_profile_includingnotificationtypes_enum" AS ENUM('follow', 'mention', 'reply', 'renote', 'quote', 'reaction', 'pollVote', 'receiveFollowRequest', 'followRequestAccepted', 'groupInvited', 'app')`, - ); - await queryRunner.query( - `ALTER TABLE "user_profile" ADD "includingNotificationTypes" "user_profile_includingnotificationtypes_enum" array`, - ); - } -} diff --git a/packages/backend/migration/1603094348345-refine-abuse-user-report.js b/packages/backend/migration/1603094348345-refine-abuse-user-report.js deleted file mode 100644 index 1aaf2685e5..0000000000 --- a/packages/backend/migration/1603094348345-refine-abuse-user-report.js +++ /dev/null @@ -1,63 +0,0 @@ -export class refineAbuseUserReport1603094348345 { - constructor() { - this.name = "refineAbuseUserReport1603094348345"; - } - async up(queryRunner) { - await queryRunner.query( - `ALTER TABLE "abuse_user_report" DROP CONSTRAINT "FK_d049123c413e68ca52abe734203"`, - ); - await queryRunner.query(`DROP INDEX "IDX_d049123c413e68ca52abe73420"`); - await queryRunner.query(`DROP INDEX "IDX_5cd442c3b2e74fdd99dae20243"`); - await queryRunner.query( - `ALTER TABLE "abuse_user_report" RENAME COLUMN "userId" TO "targetUserId"`, - ); - await queryRunner.query( - `ALTER TABLE "abuse_user_report" ADD "assigneeId" character varying(32)`, - ); - await queryRunner.query( - `ALTER TABLE "abuse_user_report" ADD "resolved" boolean NOT NULL DEFAULT false`, - ); - await queryRunner.query( - `ALTER TABLE "abuse_user_report" DROP COLUMN "comment"`, - ); - await queryRunner.query( - `ALTER TABLE "abuse_user_report" ADD "comment" character varying(2048) NOT NULL DEFAULT '{}'::varchar[]`, - ); - await queryRunner.query( - `CREATE INDEX "IDX_2b15aaf4a0dc5be3499af7ab6a" ON "abuse_user_report" ("resolved") `, - ); - await queryRunner.query( - `ALTER TABLE "abuse_user_report" ADD CONSTRAINT "FK_08b883dd5fdd6f9c4c1572b36de" FOREIGN KEY ("assigneeId") REFERENCES "user"("id") ON DELETE SET NULL ON UPDATE NO ACTION`, - ); - } - async down(queryRunner) { - await queryRunner.query( - `ALTER TABLE "abuse_user_report" DROP CONSTRAINT "FK_08b883dd5fdd6f9c4c1572b36de"`, - ); - await queryRunner.query(`DROP INDEX "IDX_2b15aaf4a0dc5be3499af7ab6a"`); - await queryRunner.query( - `ALTER TABLE "abuse_user_report" DROP COLUMN "comment"`, - ); - await queryRunner.query( - `ALTER TABLE "abuse_user_report" ADD "comment" character varying(512) NOT NULL DEFAULT '{}'::varchar[]`, - ); - await queryRunner.query( - `ALTER TABLE "abuse_user_report" DROP COLUMN "resolved"`, - ); - await queryRunner.query( - `ALTER TABLE "abuse_user_report" DROP COLUMN "assigneeId"`, - ); - await queryRunner.query( - `ALTER TABLE "abuse_user_report" RENAME COLUMN "targetUserId" TO "userId"`, - ); - await queryRunner.query( - `CREATE UNIQUE INDEX "IDX_5cd442c3b2e74fdd99dae20243" ON "abuse_user_report" ("userId", "reporterId") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_d049123c413e68ca52abe73420" ON "abuse_user_report" ("userId") `, - ); - await queryRunner.query( - `ALTER TABLE "abuse_user_report" ADD CONSTRAINT "FK_d049123c413e68ca52abe734203" FOREIGN KEY ("userId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, - ); - } -} diff --git a/packages/backend/migration/1603095701770-refine-abuse-user-report2.js b/packages/backend/migration/1603095701770-refine-abuse-user-report2.js deleted file mode 100644 index 301a8e5382..0000000000 --- a/packages/backend/migration/1603095701770-refine-abuse-user-report2.js +++ /dev/null @@ -1,29 +0,0 @@ -export class refineAbuseUserReport21603095701770 { - constructor() { - this.name = "refineAbuseUserReport21603095701770"; - } - async up(queryRunner) { - await queryRunner.query( - `ALTER TABLE "abuse_user_report" ADD "targetUserHost" character varying(128)`, - ); - await queryRunner.query( - `ALTER TABLE "abuse_user_report" ADD "reporterHost" character varying(128)`, - ); - await queryRunner.query( - `CREATE INDEX "IDX_4ebbf7f93cdc10e8d1ef2fc6cd" ON "abuse_user_report" ("targetUserHost") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_f8d8b93740ad12c4ce8213a199" ON "abuse_user_report" ("reporterHost") `, - ); - } - async down(queryRunner) { - await queryRunner.query(`DROP INDEX "IDX_f8d8b93740ad12c4ce8213a199"`); - await queryRunner.query(`DROP INDEX "IDX_4ebbf7f93cdc10e8d1ef2fc6cd"`); - await queryRunner.query( - `ALTER TABLE "abuse_user_report" DROP COLUMN "reporterHost"`, - ); - await queryRunner.query( - `ALTER TABLE "abuse_user_report" DROP COLUMN "targetUserHost"`, - ); - } -} diff --git a/packages/backend/migration/1603776877564-instance-theme-color.js b/packages/backend/migration/1603776877564-instance-theme-color.js deleted file mode 100644 index 9bb3d65c0e..0000000000 --- a/packages/backend/migration/1603776877564-instance-theme-color.js +++ /dev/null @@ -1,13 +0,0 @@ -export class instanceThemeColor1603776877564 { - constructor() { - this.name = "instanceThemeColor1603776877564"; - } - async up(queryRunner) { - await queryRunner.query( - `ALTER TABLE "instance" ADD "themeColor" character varying(64) DEFAULT null`, - ); - } - async down(queryRunner) { - await queryRunner.query(`ALTER TABLE "instance" DROP COLUMN "themeColor"`); - } -} diff --git a/packages/backend/migration/1603781553011-instance-favicon.js b/packages/backend/migration/1603781553011-instance-favicon.js deleted file mode 100644 index 4b2442692f..0000000000 --- a/packages/backend/migration/1603781553011-instance-favicon.js +++ /dev/null @@ -1,13 +0,0 @@ -export class instanceFavicon1603781553011 { - constructor() { - this.name = "instanceFavicon1603781553011"; - } - async up(queryRunner) { - await queryRunner.query( - `ALTER TABLE "instance" ADD "faviconUrl" character varying(256) DEFAULT null`, - ); - } - async down(queryRunner) { - await queryRunner.query(`ALTER TABLE "instance" DROP COLUMN "faviconUrl"`); - } -} diff --git a/packages/backend/migration/1604821689616-delete-auto-watch.js b/packages/backend/migration/1604821689616-delete-auto-watch.js deleted file mode 100644 index 6a8333ce16..0000000000 --- a/packages/backend/migration/1604821689616-delete-auto-watch.js +++ /dev/null @@ -1,15 +0,0 @@ -export class deleteAutoWatch1604821689616 { - constructor() { - this.name = "deleteAutoWatch1604821689616"; - } - async up(queryRunner) { - await queryRunner.query( - `ALTER TABLE "user_profile" DROP COLUMN "autoWatch"`, - ); - } - async down(queryRunner) { - await queryRunner.query( - `ALTER TABLE "user_profile" ADD "autoWatch" boolean NOT NULL DEFAULT false`, - ); - } -} diff --git a/packages/backend/migration/1605408848373-clip-description.js b/packages/backend/migration/1605408848373-clip-description.js deleted file mode 100644 index 99cda65346..0000000000 --- a/packages/backend/migration/1605408848373-clip-description.js +++ /dev/null @@ -1,13 +0,0 @@ -export class clipDescription1605408848373 { - constructor() { - this.name = "clipDescription1605408848373"; - } - async up(queryRunner) { - await queryRunner.query( - `ALTER TABLE "clip" ADD "description" character varying(2048) DEFAULT null`, - ); - } - async down(queryRunner) { - await queryRunner.query(`ALTER TABLE "clip" DROP COLUMN "description"`); - } -} diff --git a/packages/backend/migration/1605408971051-comments.js b/packages/backend/migration/1605408971051-comments.js deleted file mode 100644 index 363fec5cdd..0000000000 --- a/packages/backend/migration/1605408971051-comments.js +++ /dev/null @@ -1,1067 +0,0 @@ -export class comments1605408971051 { - constructor() { - this.name = "comments1605408971051"; - } - async up(queryRunner) { - await queryRunner.query( - `COMMENT ON COLUMN "log"."createdAt" IS 'The created date of the Log.'`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "drive_folder"."createdAt" IS 'The created date of the DriveFolder.'`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "drive_folder"."name" IS 'The name of the DriveFolder.'`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "drive_folder"."userId" IS 'The owner ID.'`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "drive_folder"."parentId" IS 'The parent folder ID. If null, it means the DriveFolder is located in root.'`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "drive_file"."createdAt" IS 'The created date of the DriveFile.'`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "drive_file"."userId" IS 'The owner ID.'`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "drive_file"."userHost" IS 'The host of owner. It will be null if the user in local.'`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "drive_file"."md5" IS 'The MD5 hash of the DriveFile.'`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "drive_file"."name" IS 'The file name of the DriveFile.'`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "drive_file"."type" IS 'The content type (MIME) of the DriveFile.'`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "drive_file"."size" IS 'The file size (bytes) of the DriveFile.'`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "drive_file"."comment" IS 'The comment of the DriveFile.'`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "drive_file"."blurhash" IS 'The BlurHash string.'`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "drive_file"."properties" IS 'The any properties of the DriveFile. For example, it includes image width/height.'`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "drive_file"."url" IS 'The URL of the DriveFile.'`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "drive_file"."thumbnailUrl" IS 'The URL of the thumbnail of the DriveFile.'`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "drive_file"."webpublicUrl" IS 'The URL of the webpublic of the DriveFile.'`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "drive_file"."uri" IS 'The URI of the DriveFile. it will be null when the DriveFile is local.'`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "drive_file"."folderId" IS 'The parent folder ID. If null, it means the DriveFile is located in root.'`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "drive_file"."isSensitive" IS 'Whether the DriveFile is NSFW.'`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "drive_file"."isLink" IS 'Whether the DriveFile is direct link to remote server.'`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "user"."createdAt" IS 'The created date of the User.'`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "user"."updatedAt" IS 'The updated date of the User.'`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "user"."username" IS 'The username of the User.'`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "user"."usernameLower" IS 'The username (lowercased) of the User.'`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "user"."name" IS 'The name of the User.'`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "user"."followersCount" IS 'The count of followers.'`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "user"."followingCount" IS 'The count of following.'`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "user"."notesCount" IS 'The count of notes.'`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "user"."avatarId" IS 'The ID of avatar DriveFile.'`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "user"."bannerId" IS 'The ID of banner DriveFile.'`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "user"."isSuspended" IS 'Whether the User is suspended.'`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "user"."isSilenced" IS 'Whether the User is silenced.'`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "user"."isLocked" IS 'Whether the User is locked.'`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "user"."isBot" IS 'Whether the User is a bot.'`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "user"."isCat" IS 'Whether the User is a cat.'`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "user"."isAdmin" IS 'Whether the User is the admin.'`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "user"."isModerator" IS 'Whether the User is a moderator.'`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "user"."host" IS 'The host of the User. It will be null if the origin of the user is local.'`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "user"."inbox" IS 'The inbox URL of the User. It will be null if the origin of the user is local.'`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "user"."sharedInbox" IS 'The sharedInbox URL of the User. It will be null if the origin of the user is local.'`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "user"."featured" IS 'The featured URL of the User. It will be null if the origin of the user is local.'`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "user"."uri" IS 'The URI of the User. It will be null if the origin of the user is local.'`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "user"."token" IS 'The native access token of the User. It will be null if the origin of the user is local.'`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "app"."createdAt" IS 'The created date of the App.'`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "app"."userId" IS 'The owner ID.'`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "app"."secret" IS 'The secret key of the App.'`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "app"."name" IS 'The name of the App.'`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "app"."description" IS 'The description of the App.'`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "app"."permission" IS 'The permission of the App.'`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "app"."callbackUrl" IS 'The callbackUrl of the App.'`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "access_token"."createdAt" IS 'The created date of the AccessToken.'`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "access_token"."lastUsedAt" IS NULL`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "access_token"."session" IS NULL`, - ); - await queryRunner.query(`COMMENT ON COLUMN "access_token"."appId" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "access_token"."name" IS NULL`); - await queryRunner.query( - `COMMENT ON COLUMN "access_token"."description" IS NULL`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "access_token"."iconUrl" IS NULL`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "channel"."createdAt" IS 'The created date of the Channel.'`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "channel"."userId" IS 'The owner ID.'`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "channel"."name" IS 'The name of the Channel.'`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "channel"."description" IS 'The description of the Channel.'`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "channel"."bannerId" IS 'The ID of banner Channel.'`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "channel"."notesCount" IS 'The count of notes.'`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "channel"."usersCount" IS 'The count of users.'`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "note"."createdAt" IS 'The created date of the Note.'`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "note"."replyId" IS 'The ID of reply target.'`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "note"."renoteId" IS 'The ID of renote target.'`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "note"."userId" IS 'The ID of author.'`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "note"."uri" IS 'The URI of a note. it will be null when the note is local.'`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "note"."url" IS 'The human readable url of a note. it will be null when the note is local.'`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "note"."channelId" IS 'The ID of source channel.'`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "note"."userHost" IS '[Denormalized]'`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "note"."replyUserId" IS '[Denormalized]'`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "note"."replyUserHost" IS '[Denormalized]'`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "note"."renoteUserId" IS '[Denormalized]'`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "note"."renoteUserHost" IS '[Denormalized]'`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "poll_vote"."createdAt" IS 'The created date of the PollVote.'`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "note_reaction"."createdAt" IS 'The created date of the NoteReaction.'`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "note_watching"."createdAt" IS 'The created date of the NoteWatching.'`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "note_watching"."userId" IS 'The watcher ID.'`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "note_watching"."noteId" IS 'The target Note ID.'`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "note_watching"."noteUserId" IS '[Denormalized]'`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "note_unread"."noteUserId" IS '[Denormalized]'`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "note_unread"."noteChannelId" IS '[Denormalized]'`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "follow_request"."createdAt" IS 'The created date of the FollowRequest.'`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "follow_request"."followeeId" IS 'The followee user ID.'`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "follow_request"."followerId" IS 'The follower user ID.'`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "follow_request"."requestId" IS 'id of Follow Activity.'`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "follow_request"."followerHost" IS '[Denormalized]'`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "follow_request"."followerInbox" IS '[Denormalized]'`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "follow_request"."followerSharedInbox" IS '[Denormalized]'`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "follow_request"."followeeHost" IS '[Denormalized]'`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "follow_request"."followeeInbox" IS '[Denormalized]'`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "follow_request"."followeeSharedInbox" IS '[Denormalized]'`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "user_group"."createdAt" IS 'The created date of the UserGroup.'`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "user_group"."userId" IS 'The ID of owner.'`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "user_group_invitation"."createdAt" IS 'The created date of the UserGroupInvitation.'`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "user_group_invitation"."userId" IS 'The user ID.'`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "user_group_invitation"."userGroupId" IS 'The group ID.'`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "notification"."createdAt" IS 'The created date of the Notification.'`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "notification"."notifieeId" IS 'The ID of recipient user of the Notification.'`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "notification"."isRead" IS 'Whether the Notification is read.'`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "meta"."localDriveCapacityMb" IS 'Drive capacity of a local user (MB)'`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "meta"."remoteDriveCapacityMb" IS 'Drive capacity of a remote user (MB)'`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "meta"."maxNoteTextLength" IS 'Max allowed note text length in characters'`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "following"."createdAt" IS 'The created date of the Following.'`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "following"."followeeId" IS 'The followee user ID.'`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "following"."followerId" IS 'The follower user ID.'`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "following"."followerHost" IS '[Denormalized]'`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "following"."followerInbox" IS '[Denormalized]'`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "following"."followerSharedInbox" IS '[Denormalized]'`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "following"."followeeHost" IS '[Denormalized]'`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "following"."followeeInbox" IS '[Denormalized]'`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "following"."followeeSharedInbox" IS '[Denormalized]'`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "instance"."caughtAt" IS 'The caught date of the Instance.'`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "instance"."host" IS 'The host of the Instance.'`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "instance"."usersCount" IS 'The count of the users of the Instance.'`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "instance"."notesCount" IS 'The count of the notes of the Instance.'`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "instance"."softwareName" IS 'The software of the Instance.'`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "instance"."softwareVersion" IS NULL`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "instance"."openRegistrations" IS NULL`, - ); - await queryRunner.query(`COMMENT ON COLUMN "instance"."name" IS NULL`); - await queryRunner.query( - `COMMENT ON COLUMN "instance"."description" IS NULL`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "instance"."maintainerName" IS NULL`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "instance"."maintainerEmail" IS NULL`, - ); - await queryRunner.query(`COMMENT ON COLUMN "instance"."iconUrl" IS NULL`); - await queryRunner.query( - `COMMENT ON COLUMN "instance"."faviconUrl" IS NULL`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "instance"."themeColor" IS NULL`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "muting"."createdAt" IS 'The created date of the Muting.'`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "muting"."muteeId" IS 'The mutee user ID.'`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "muting"."muterId" IS 'The muter user ID.'`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "blocking"."createdAt" IS 'The created date of the Blocking.'`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "blocking"."blockeeId" IS 'The blockee user ID.'`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "blocking"."blockerId" IS 'The blocker user ID.'`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "user_list"."createdAt" IS 'The created date of the UserList.'`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "user_list"."userId" IS 'The owner ID.'`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "user_list"."name" IS 'The name of the UserList.'`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "user_list_joining"."createdAt" IS 'The created date of the UserListJoining.'`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "user_list_joining"."userId" IS 'The user ID.'`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "user_list_joining"."userListId" IS 'The list ID.'`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "user_group_joining"."createdAt" IS 'The created date of the UserGroupJoining.'`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "user_group_joining"."userId" IS 'The user ID.'`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "user_group_joining"."userGroupId" IS 'The group ID.'`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "note_favorite"."createdAt" IS 'The created date of the NoteFavorite.'`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "abuse_user_report"."createdAt" IS 'The created date of the AbuseUserReport.'`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "abuse_user_report"."targetUserHost" IS '[Denormalized]'`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "abuse_user_report"."reporterHost" IS '[Denormalized]'`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "messaging_message"."createdAt" IS 'The created date of the MessagingMessage.'`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "messaging_message"."userId" IS 'The sender user ID.'`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "messaging_message"."groupId" IS 'The recipient group ID.'`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "signin"."createdAt" IS 'The created date of the Signin.'`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "auth_session"."createdAt" IS 'The created date of the AuthSession.'`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "reversi_game"."createdAt" IS 'The created date of the ReversiGame.'`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "reversi_game"."startedAt" IS 'The started date of the ReversiGame.'`, - ); - await queryRunner.query(`COMMENT ON COLUMN "reversi_game"."form1" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "reversi_game"."form2" IS NULL`); - await queryRunner.query( - `COMMENT ON COLUMN "reversi_matching"."createdAt" IS 'The created date of the ReversiMatching.'`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "user_note_pining"."createdAt" IS 'The created date of the UserNotePinings.'`, - ); - await queryRunner.query(`COMMENT ON COLUMN "poll"."noteId" IS NULL`); - await queryRunner.query( - `COMMENT ON COLUMN "poll"."noteVisibility" IS '[Denormalized]'`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "poll"."userId" IS '[Denormalized]'`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "poll"."userHost" IS '[Denormalized]'`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "user_keypair"."userId" IS NULL`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "user_publickey"."userId" IS NULL`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "page"."createdAt" IS 'The created date of the Page.'`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "page"."updatedAt" IS 'The updated date of the Page.'`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "page"."userId" IS 'The ID of author.'`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "user_profile"."userId" IS NULL`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "user_profile"."location" IS 'The location of the User.'`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "user_profile"."birthday" IS 'The birthday (YYYY-MM-DD) of the User.'`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "user_profile"."description" IS 'The description (bio) of the User.'`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "user_profile"."url" IS 'Remote URL of the user.'`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "user_profile"."email" IS 'The email address of the User.'`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "user_profile"."password" IS 'The password hash of the User. It will be null if the origin of the user is local.'`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "user_profile"."clientData" IS 'The client-specific data of the User.'`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "user_profile"."room" IS 'The room data of the User.'`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "user_profile"."userHost" IS '[Denormalized]'`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "user_security_key"."id" IS 'Variable-length id given to navigator.credentials.get()'`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "user_security_key"."publicKey" IS 'Variable-length public key used to verify attestations (hex-encoded).'`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "user_security_key"."lastUsed" IS 'The date of the last time the UserSecurityKey was successfully validated.'`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "user_security_key"."name" IS 'User-defined name for this key'`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "attestation_challenge"."challenge" IS 'Hex-encoded sha256 hash of the challenge.'`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "attestation_challenge"."createdAt" IS 'The date challenge was created for expiry purposes.'`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "attestation_challenge"."registrationChallenge" IS 'Indicates that the challenge is only for registration purposes if true to prevent the challenge for being used as authentication.'`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "moderation_log"."createdAt" IS 'The created date of the ModerationLog.'`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "announcement"."createdAt" IS 'The created date of the Announcement.'`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "announcement"."updatedAt" IS 'The updated date of the Announcement.'`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "announcement_read"."createdAt" IS 'The created date of the AnnouncementRead.'`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "clip"."createdAt" IS 'The created date of the Clip.'`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "clip"."userId" IS 'The owner ID.'`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "clip"."name" IS 'The name of the Clip.'`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "clip"."description" IS 'The description of the Clip.'`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "clip_note"."noteId" IS 'The note ID.'`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "clip_note"."clipId" IS 'The clip ID.'`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "antenna"."createdAt" IS 'The created date of the Antenna.'`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "antenna"."userId" IS 'The owner ID.'`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "antenna"."name" IS 'The name of the Antenna.'`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "antenna_note"."noteId" IS 'The note ID.'`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "antenna_note"."antennaId" IS 'The antenna ID.'`, - ); - await queryRunner.query(`COMMENT ON COLUMN "promo_note"."noteId" IS NULL`); - await queryRunner.query( - `COMMENT ON COLUMN "promo_note"."userId" IS '[Denormalized]'`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "promo_read"."createdAt" IS 'The created date of the PromoRead.'`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "muted_note"."noteId" IS 'The note ID.'`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "muted_note"."userId" IS 'The user ID.'`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "muted_note"."reason" IS 'The reason of the MutedNote.'`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "channel_following"."createdAt" IS 'The created date of the ChannelFollowing.'`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "channel_following"."followeeId" IS 'The followee channel ID.'`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "channel_following"."followerId" IS 'The follower user ID.'`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "channel_note_pining"."createdAt" IS 'The created date of the ChannelNotePining.'`, - ); - } - async down(queryRunner) { - await queryRunner.query( - `COMMENT ON COLUMN "channel_note_pining"."createdAt" IS NULL`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "channel_following"."followerId" IS NULL`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "channel_following"."followeeId" IS NULL`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "channel_following"."createdAt" IS NULL`, - ); - await queryRunner.query(`COMMENT ON COLUMN "muted_note"."reason" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "muted_note"."userId" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "muted_note"."noteId" IS NULL`); - await queryRunner.query( - `COMMENT ON COLUMN "promo_read"."createdAt" IS NULL`, - ); - await queryRunner.query(`COMMENT ON COLUMN "promo_note"."userId" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "promo_note"."noteId" IS NULL`); - await queryRunner.query( - `COMMENT ON COLUMN "antenna_note"."antennaId" IS NULL`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "antenna_note"."noteId" IS NULL`, - ); - await queryRunner.query(`COMMENT ON COLUMN "antenna"."name" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "antenna"."userId" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "antenna"."createdAt" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "clip_note"."clipId" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "clip_note"."noteId" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "clip"."description" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "clip"."name" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "clip"."userId" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "clip"."createdAt" IS NULL`); - await queryRunner.query( - `COMMENT ON COLUMN "announcement_read"."createdAt" IS NULL`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "announcement"."updatedAt" IS NULL`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "announcement"."createdAt" IS NULL`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "moderation_log"."createdAt" IS NULL`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "attestation_challenge"."registrationChallenge" IS NULL`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "attestation_challenge"."createdAt" IS NULL`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "attestation_challenge"."challenge" IS NULL`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "user_security_key"."name" IS NULL`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "user_security_key"."lastUsed" IS NULL`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "user_security_key"."publicKey" IS NULL`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "user_security_key"."id" IS NULL`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "user_profile"."userHost" IS NULL`, - ); - await queryRunner.query(`COMMENT ON COLUMN "user_profile"."room" IS NULL`); - await queryRunner.query( - `COMMENT ON COLUMN "user_profile"."clientData" IS NULL`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "user_profile"."password" IS NULL`, - ); - await queryRunner.query(`COMMENT ON COLUMN "user_profile"."email" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "user_profile"."url" IS NULL`); - await queryRunner.query( - `COMMENT ON COLUMN "user_profile"."description" IS 'The description (bio) of the User.'`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "user_profile"."birthday" IS NULL`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "user_profile"."location" IS NULL`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "user_profile"."userId" IS NULL`, - ); - await queryRunner.query(`COMMENT ON COLUMN "page"."userId" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "page"."updatedAt" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "page"."createdAt" IS NULL`); - await queryRunner.query( - `COMMENT ON COLUMN "user_publickey"."userId" IS NULL`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "user_keypair"."userId" IS NULL`, - ); - await queryRunner.query(`COMMENT ON COLUMN "poll"."userHost" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "poll"."userId" IS NULL`); - await queryRunner.query( - `COMMENT ON COLUMN "poll"."noteVisibility" IS NULL`, - ); - await queryRunner.query(`COMMENT ON COLUMN "poll"."noteId" IS NULL`); - await queryRunner.query( - `COMMENT ON COLUMN "user_note_pining"."createdAt" IS NULL`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "reversi_matching"."createdAt" IS NULL`, - ); - await queryRunner.query(`COMMENT ON COLUMN "reversi_game"."form2" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "reversi_game"."form1" IS NULL`); - await queryRunner.query( - `COMMENT ON COLUMN "reversi_game"."startedAt" IS NULL`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "reversi_game"."createdAt" IS NULL`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "auth_session"."createdAt" IS NULL`, - ); - await queryRunner.query(`COMMENT ON COLUMN "signin"."createdAt" IS NULL`); - await queryRunner.query( - `COMMENT ON COLUMN "messaging_message"."groupId" IS NULL`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "messaging_message"."userId" IS NULL`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "messaging_message"."createdAt" IS NULL`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "abuse_user_report"."reporterHost" IS NULL`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "abuse_user_report"."targetUserHost" IS NULL`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "abuse_user_report"."createdAt" IS NULL`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "note_favorite"."createdAt" IS NULL`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "user_group_joining"."userGroupId" IS NULL`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "user_group_joining"."userId" IS NULL`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "user_group_joining"."createdAt" IS NULL`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "user_list_joining"."userListId" IS NULL`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "user_list_joining"."userId" IS NULL`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "user_list_joining"."createdAt" IS NULL`, - ); - await queryRunner.query(`COMMENT ON COLUMN "user_list"."name" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "user_list"."userId" IS NULL`); - await queryRunner.query( - `COMMENT ON COLUMN "user_list"."createdAt" IS NULL`, - ); - await queryRunner.query(`COMMENT ON COLUMN "blocking"."blockerId" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "blocking"."blockeeId" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "blocking"."createdAt" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "muting"."muterId" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "muting"."muteeId" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "muting"."createdAt" IS NULL`); - await queryRunner.query( - `COMMENT ON COLUMN "instance"."themeColor" IS NULL`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "instance"."faviconUrl" IS NULL`, - ); - await queryRunner.query(`COMMENT ON COLUMN "instance"."iconUrl" IS NULL`); - await queryRunner.query( - `COMMENT ON COLUMN "instance"."maintainerEmail" IS NULL`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "instance"."maintainerName" IS NULL`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "instance"."description" IS NULL`, - ); - await queryRunner.query(`COMMENT ON COLUMN "instance"."name" IS NULL`); - await queryRunner.query( - `COMMENT ON COLUMN "instance"."openRegistrations" IS NULL`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "instance"."softwareVersion" IS NULL`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "instance"."softwareName" IS NULL`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "instance"."notesCount" IS NULL`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "instance"."usersCount" IS NULL`, - ); - await queryRunner.query(`COMMENT ON COLUMN "instance"."host" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "instance"."caughtAt" IS NULL`); - await queryRunner.query( - `COMMENT ON COLUMN "following"."followeeSharedInbox" IS NULL`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "following"."followeeInbox" IS NULL`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "following"."followeeHost" IS NULL`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "following"."followerSharedInbox" IS NULL`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "following"."followerInbox" IS NULL`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "following"."followerHost" IS NULL`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "following"."followerId" IS NULL`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "following"."followeeId" IS NULL`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "following"."createdAt" IS NULL`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "meta"."maxNoteTextLength" IS NULL`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "meta"."remoteDriveCapacityMb" IS NULL`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "meta"."localDriveCapacityMb" IS NULL`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "notification"."isRead" IS NULL`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "notification"."notifieeId" IS NULL`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "notification"."createdAt" IS NULL`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "user_group_invitation"."userGroupId" IS NULL`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "user_group_invitation"."userId" IS NULL`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "user_group_invitation"."createdAt" IS NULL`, - ); - await queryRunner.query(`COMMENT ON COLUMN "user_group"."userId" IS NULL`); - await queryRunner.query( - `COMMENT ON COLUMN "user_group"."createdAt" IS NULL`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "follow_request"."followeeSharedInbox" IS NULL`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "follow_request"."followeeInbox" IS NULL`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "follow_request"."followeeHost" IS NULL`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "follow_request"."followerSharedInbox" IS NULL`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "follow_request"."followerInbox" IS NULL`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "follow_request"."followerHost" IS NULL`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "follow_request"."requestId" IS NULL`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "follow_request"."followerId" IS NULL`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "follow_request"."followeeId" IS NULL`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "follow_request"."createdAt" IS NULL`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "note_unread"."noteChannelId" IS NULL`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "note_unread"."noteUserId" IS NULL`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "note_watching"."noteUserId" IS NULL`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "note_watching"."noteId" IS NULL`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "note_watching"."userId" IS NULL`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "note_watching"."createdAt" IS NULL`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "note_reaction"."createdAt" IS NULL`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "poll_vote"."createdAt" IS NULL`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "note"."renoteUserHost" IS NULL`, - ); - await queryRunner.query(`COMMENT ON COLUMN "note"."renoteUserId" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "note"."replyUserHost" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "note"."replyUserId" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "note"."userHost" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "note"."channelId" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "note"."url" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "note"."uri" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "note"."userId" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "note"."renoteId" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "note"."replyId" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "note"."createdAt" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "channel"."usersCount" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "channel"."notesCount" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "channel"."bannerId" IS NULL`); - await queryRunner.query( - `COMMENT ON COLUMN "channel"."description" IS NULL`, - ); - await queryRunner.query(`COMMENT ON COLUMN "channel"."name" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "channel"."userId" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "channel"."createdAt" IS NULL`); - await queryRunner.query( - `COMMENT ON COLUMN "access_token"."iconUrl" IS NULL`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "access_token"."description" IS NULL`, - ); - await queryRunner.query(`COMMENT ON COLUMN "access_token"."name" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "access_token"."appId" IS NULL`); - await queryRunner.query( - `COMMENT ON COLUMN "access_token"."session" IS NULL`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "access_token"."lastUsedAt" IS NULL`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "access_token"."createdAt" IS NULL`, - ); - await queryRunner.query(`COMMENT ON COLUMN "app"."callbackUrl" IS NULL`); - await queryRunner.query( - `COMMENT ON COLUMN "app"."permission" IS 'The permission of the App.'`, - ); - await queryRunner.query(`COMMENT ON COLUMN "app"."description" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "app"."name" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "app"."secret" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "app"."userId" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "app"."createdAt" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "user"."token" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "user"."uri" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "user"."featured" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "user"."sharedInbox" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "user"."inbox" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "user"."host" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "user"."isModerator" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "user"."isAdmin" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "user"."isCat" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "user"."isBot" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "user"."isLocked" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "user"."isSilenced" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "user"."isSuspended" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "user"."bannerId" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "user"."avatarId" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "user"."notesCount" IS NULL`); - await queryRunner.query( - `COMMENT ON COLUMN "user"."followingCount" IS NULL`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "user"."followersCount" IS NULL`, - ); - await queryRunner.query(`COMMENT ON COLUMN "user"."name" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "user"."usernameLower" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "user"."username" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "user"."updatedAt" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "user"."createdAt" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "drive_file"."isLink" IS NULL`); - await queryRunner.query( - `COMMENT ON COLUMN "drive_file"."isSensitive" IS NULL`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "drive_file"."folderId" IS NULL`, - ); - await queryRunner.query(`COMMENT ON COLUMN "drive_file"."uri" IS NULL`); - await queryRunner.query( - `COMMENT ON COLUMN "drive_file"."webpublicUrl" IS NULL`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "drive_file"."thumbnailUrl" IS NULL`, - ); - await queryRunner.query(`COMMENT ON COLUMN "drive_file"."url" IS NULL`); - await queryRunner.query( - `COMMENT ON COLUMN "drive_file"."properties" IS NULL`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "drive_file"."blurhash" IS NULL`, - ); - await queryRunner.query(`COMMENT ON COLUMN "drive_file"."comment" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "drive_file"."size" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "drive_file"."type" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "drive_file"."name" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "drive_file"."md5" IS NULL`); - await queryRunner.query( - `COMMENT ON COLUMN "drive_file"."userHost" IS NULL`, - ); - await queryRunner.query(`COMMENT ON COLUMN "drive_file"."userId" IS NULL`); - await queryRunner.query( - `COMMENT ON COLUMN "drive_file"."createdAt" IS NULL`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "drive_folder"."parentId" IS NULL`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "drive_folder"."userId" IS NULL`, - ); - await queryRunner.query(`COMMENT ON COLUMN "drive_folder"."name" IS NULL`); - await queryRunner.query( - `COMMENT ON COLUMN "drive_folder"."createdAt" IS NULL`, - ); - await queryRunner.query(`COMMENT ON COLUMN "log"."createdAt" IS NULL`); - } -} diff --git a/packages/backend/migration/1605585339718-instance-pinned-pages.js b/packages/backend/migration/1605585339718-instance-pinned-pages.js deleted file mode 100644 index 09e1617641..0000000000 --- a/packages/backend/migration/1605585339718-instance-pinned-pages.js +++ /dev/null @@ -1,13 +0,0 @@ -export class instancePinnedPages1605585339718 { - constructor() { - this.name = "instancePinnedPages1605585339718"; - } - async up(queryRunner) { - await queryRunner.query( - `ALTER TABLE "meta" ADD "pinnedPages" character varying(512) array NOT NULL DEFAULT '{"/featured", "/channels", "/explore", "/pages", "/about-misskey"}'::varchar[]`, - ); - } - async down(queryRunner) { - await queryRunner.query(`ALTER TABLE "meta" DROP COLUMN "pinnedPages"`); - } -} diff --git a/packages/backend/migration/1605965516823-instance-images.js b/packages/backend/migration/1605965516823-instance-images.js deleted file mode 100644 index ed9a26a655..0000000000 --- a/packages/backend/migration/1605965516823-instance-images.js +++ /dev/null @@ -1,19 +0,0 @@ -export class instanceImages1605965516823 { - constructor() { - this.name = "instanceImages1605965516823"; - } - async up(queryRunner) { - await queryRunner.query( - `ALTER TABLE "meta" ADD "backgroundImageUrl" character varying(512)`, - ); - await queryRunner.query( - `ALTER TABLE "meta" ADD "logoImageUrl" character varying(512)`, - ); - } - async down(queryRunner) { - await queryRunner.query(`ALTER TABLE "meta" DROP COLUMN "logoImageUrl"`); - await queryRunner.query( - `ALTER TABLE "meta" DROP COLUMN "backgroundImageUrl"`, - ); - } -} diff --git a/packages/backend/migration/1606191203881-no-crawle.js b/packages/backend/migration/1606191203881-no-crawle.js deleted file mode 100644 index 4e7e822771..0000000000 --- a/packages/backend/migration/1606191203881-no-crawle.js +++ /dev/null @@ -1,21 +0,0 @@ -export class noCrawle1606191203881 { - constructor() { - this.name = "noCrawle1606191203881"; - } - async up(queryRunner) { - await queryRunner.query( - `ALTER TABLE "user_profile" ADD "noCrawle" boolean NOT NULL DEFAULT false`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "user_profile"."noCrawle" IS 'Whether reject index by crawler.'`, - ); - } - async down(queryRunner) { - await queryRunner.query( - `COMMENT ON COLUMN "user_profile"."noCrawle" IS 'Whether reject index by crawler.'`, - ); - await queryRunner.query( - `ALTER TABLE "user_profile" DROP COLUMN "noCrawle"`, - ); - } -} diff --git a/packages/backend/migration/1607151207216-instance-pinned-clip.js b/packages/backend/migration/1607151207216-instance-pinned-clip.js deleted file mode 100644 index 655b4c7fbd..0000000000 --- a/packages/backend/migration/1607151207216-instance-pinned-clip.js +++ /dev/null @@ -1,13 +0,0 @@ -export class instancePinnedClip1607151207216 { - constructor() { - this.name = "instancePinnedClip1607151207216"; - } - async up(queryRunner) { - await queryRunner.query( - `ALTER TABLE "meta" ADD "pinnedClipId" character varying(32)`, - ); - } - async down(queryRunner) { - await queryRunner.query(`ALTER TABLE "meta" DROP COLUMN "pinnedClipId"`); - } -} diff --git a/packages/backend/migration/1607353487793-isExplorable.js b/packages/backend/migration/1607353487793-isExplorable.js deleted file mode 100644 index d654ee121f..0000000000 --- a/packages/backend/migration/1607353487793-isExplorable.js +++ /dev/null @@ -1,23 +0,0 @@ -export class isExplorable1607353487793 { - constructor() { - this.name = "isExplorable1607353487793"; - } - async up(queryRunner) { - await queryRunner.query( - `ALTER TABLE "user" ADD "isExplorable" boolean NOT NULL DEFAULT true`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "user"."isExplorable" IS 'Whether the User is explorable.'`, - ); - await queryRunner.query( - `CREATE INDEX "IDX_d5a1b83c7cab66f167e6888188" ON "user" ("isExplorable") `, - ); - } - async down(queryRunner) { - await queryRunner.query(`DROP INDEX "IDX_d5a1b83c7cab66f167e6888188"`); - await queryRunner.query( - `COMMENT ON COLUMN "user"."isExplorable" IS 'Whether the User is explorable.'`, - ); - await queryRunner.query(`ALTER TABLE "user" DROP COLUMN "isExplorable"`); - } -} diff --git a/packages/backend/migration/1610277136869-registry.js b/packages/backend/migration/1610277136869-registry.js deleted file mode 100644 index 023519302e..0000000000 --- a/packages/backend/migration/1610277136869-registry.js +++ /dev/null @@ -1,31 +0,0 @@ -export class registry1610277136869 { - constructor() { - this.name = "registry1610277136869"; - } - async up(queryRunner) { - await queryRunner.query( - `CREATE TABLE "registry_item" ("id" character varying(32) NOT NULL, "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL, "updatedAt" TIMESTAMP WITH TIME ZONE NOT NULL, "userId" character varying(32) NOT NULL, "key" character varying(1024) NOT NULL, "scope" character varying(1024) array NOT NULL DEFAULT '{}'::varchar[], "domain" character varying(512), CONSTRAINT "PK_64b3f7e6008b4d89b826cd3af95" PRIMARY KEY ("id")); COMMENT ON COLUMN "registry_item"."createdAt" IS 'The created date of the RegistryItem.'; COMMENT ON COLUMN "registry_item"."updatedAt" IS 'The updated date of the RegistryItem.'; COMMENT ON COLUMN "registry_item"."userId" IS 'The owner ID.'; COMMENT ON COLUMN "registry_item"."key" IS 'The key of the RegistryItem.'`, - ); - await queryRunner.query( - `CREATE INDEX "IDX_fb9d21ba0abb83223263df6bcb" ON "registry_item" ("userId") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_22baca135bb8a3ea1a83d13df3" ON "registry_item" ("scope") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_0a72bdfcdb97c0eca11fe7ecad" ON "registry_item" ("domain") `, - ); - await queryRunner.query( - `ALTER TABLE "registry_item" ADD CONSTRAINT "FK_fb9d21ba0abb83223263df6bcb3" FOREIGN KEY ("userId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, - ); - } - async down(queryRunner) { - await queryRunner.query( - `ALTER TABLE "registry_item" DROP CONSTRAINT "FK_fb9d21ba0abb83223263df6bcb3"`, - ); - await queryRunner.query(`DROP INDEX "IDX_0a72bdfcdb97c0eca11fe7ecad"`); - await queryRunner.query(`DROP INDEX "IDX_22baca135bb8a3ea1a83d13df3"`); - await queryRunner.query(`DROP INDEX "IDX_fb9d21ba0abb83223263df6bcb"`); - await queryRunner.query(`DROP TABLE "registry_item"`); - } -} diff --git a/packages/backend/migration/1610277585759-registry2.js b/packages/backend/migration/1610277585759-registry2.js deleted file mode 100644 index a2c1fb01bf..0000000000 --- a/packages/backend/migration/1610277585759-registry2.js +++ /dev/null @@ -1,19 +0,0 @@ -export class registry21610277585759 { - constructor() { - this.name = "registry21610277585759"; - } - async up(queryRunner) { - await queryRunner.query( - `ALTER TABLE "registry_item" ADD "value" jsonb NOT NULL DEFAULT '{}'`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "registry_item"."value" IS 'The value of the RegistryItem.'`, - ); - } - async down(queryRunner) { - await queryRunner.query( - `COMMENT ON COLUMN "registry_item"."value" IS 'The value of the RegistryItem.'`, - ); - await queryRunner.query(`ALTER TABLE "registry_item" DROP COLUMN "value"`); - } -} diff --git a/packages/backend/migration/1610283021566-registry3.js b/packages/backend/migration/1610283021566-registry3.js deleted file mode 100644 index a1d55b2dc1..0000000000 --- a/packages/backend/migration/1610283021566-registry3.js +++ /dev/null @@ -1,15 +0,0 @@ -export class registry31610283021566 { - constructor() { - this.name = "registry31610283021566"; - } - async up(queryRunner) { - await queryRunner.query( - `ALTER TABLE "registry_item" ALTER COLUMN "value" DROP NOT NULL`, - ); - } - async down(queryRunner) { - await queryRunner.query( - `ALTER TABLE "registry_item" ALTER COLUMN "value" SET NOT NULL`, - ); - } -} diff --git a/packages/backend/migration/1611354329133-followersUri.js b/packages/backend/migration/1611354329133-followersUri.js deleted file mode 100644 index c7ca5c895b..0000000000 --- a/packages/backend/migration/1611354329133-followersUri.js +++ /dev/null @@ -1,19 +0,0 @@ -export class followersUri1611354329133 { - constructor() { - this.name = "followersUri1611354329133"; - } - async up(queryRunner) { - await queryRunner.query( - `ALTER TABLE "user" ADD "followersUri" varchar(512) DEFAULT NULL`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "user"."followersUri" IS 'The URI of the user Follower Collection. It will be null if the origin of the user is local.'`, - ); - } - async down(queryRunner) { - await queryRunner.query( - `COMMENT ON COLUMN "user"."followersUri" IS 'The URI of the user Follower Collection. It will be null if the origin of the user is local.'`, - ); - await queryRunner.query(`ALTER TABLE "user" DROP COLUMN "followersUri"`); - } -} diff --git a/packages/backend/migration/1611397665007-gallery.js b/packages/backend/migration/1611397665007-gallery.js deleted file mode 100644 index 1f36acbc17..0000000000 --- a/packages/backend/migration/1611397665007-gallery.js +++ /dev/null @@ -1,71 +0,0 @@ -export class gallery1611397665007 { - constructor() { - this.name = "gallery1611397665007"; - } - async up(queryRunner) { - await queryRunner.query( - `CREATE TABLE "gallery_post" ("id" character varying(32) NOT NULL, "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL, "updatedAt" TIMESTAMP WITH TIME ZONE NOT NULL, "title" character varying(256) NOT NULL, "description" character varying(2048), "userId" character varying(32) NOT NULL, "fileIds" character varying(32) array NOT NULL DEFAULT '{}'::varchar[], "isSensitive" boolean NOT NULL DEFAULT false, "likedCount" integer NOT NULL DEFAULT '0', "tags" character varying(128) array NOT NULL DEFAULT '{}'::varchar[], CONSTRAINT "PK_8e90d7b6015f2c4518881b14753" PRIMARY KEY ("id")); COMMENT ON COLUMN "gallery_post"."createdAt" IS 'The created date of the GalleryPost.'; COMMENT ON COLUMN "gallery_post"."updatedAt" IS 'The updated date of the GalleryPost.'; COMMENT ON COLUMN "gallery_post"."userId" IS 'The ID of author.'; COMMENT ON COLUMN "gallery_post"."isSensitive" IS 'Whether the post is sensitive.'`, - ); - await queryRunner.query( - `CREATE INDEX "IDX_8f1a239bd077c8864a20c62c2c" ON "gallery_post" ("createdAt") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_f631d37835adb04792e361807c" ON "gallery_post" ("updatedAt") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_985b836dddd8615e432d7043dd" ON "gallery_post" ("userId") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_3ca50563facd913c425e7a89ee" ON "gallery_post" ("fileIds") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_f2d744d9a14d0dfb8b96cb7fc5" ON "gallery_post" ("isSensitive") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_1a165c68a49d08f11caffbd206" ON "gallery_post" ("likedCount") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_05cca34b985d1b8edc1d1e28df" ON "gallery_post" ("tags") `, - ); - await queryRunner.query( - `CREATE TABLE "gallery_like" ("id" character varying(32) NOT NULL, "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL, "userId" character varying(32) NOT NULL, "postId" character varying(32) NOT NULL, CONSTRAINT "PK_853ab02be39b8de45cd720cc15f" PRIMARY KEY ("id"))`, - ); - await queryRunner.query( - `CREATE INDEX "IDX_8fd5215095473061855ceb948c" ON "gallery_like" ("userId") `, - ); - await queryRunner.query( - `CREATE UNIQUE INDEX "IDX_df1b5f4099e99fb0bc5eae53b6" ON "gallery_like" ("userId", "postId") `, - ); - await queryRunner.query( - `ALTER TABLE "gallery_post" ADD CONSTRAINT "FK_985b836dddd8615e432d7043ddb" FOREIGN KEY ("userId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, - ); - await queryRunner.query( - `ALTER TABLE "gallery_like" ADD CONSTRAINT "FK_8fd5215095473061855ceb948cf" FOREIGN KEY ("userId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, - ); - await queryRunner.query( - `ALTER TABLE "gallery_like" ADD CONSTRAINT "FK_b1cb568bfe569e47b7051699fc8" FOREIGN KEY ("postId") REFERENCES "gallery_post"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, - ); - } - async down(queryRunner) { - await queryRunner.query( - `ALTER TABLE "gallery_like" DROP CONSTRAINT "FK_b1cb568bfe569e47b7051699fc8"`, - ); - await queryRunner.query( - `ALTER TABLE "gallery_like" DROP CONSTRAINT "FK_8fd5215095473061855ceb948cf"`, - ); - await queryRunner.query( - `ALTER TABLE "gallery_post" DROP CONSTRAINT "FK_985b836dddd8615e432d7043ddb"`, - ); - await queryRunner.query(`DROP INDEX "IDX_df1b5f4099e99fb0bc5eae53b6"`); - await queryRunner.query(`DROP INDEX "IDX_8fd5215095473061855ceb948c"`); - await queryRunner.query(`DROP TABLE "gallery_like"`); - await queryRunner.query(`DROP INDEX "IDX_05cca34b985d1b8edc1d1e28df"`); - await queryRunner.query(`DROP INDEX "IDX_1a165c68a49d08f11caffbd206"`); - await queryRunner.query(`DROP INDEX "IDX_f2d744d9a14d0dfb8b96cb7fc5"`); - await queryRunner.query(`DROP INDEX "IDX_3ca50563facd913c425e7a89ee"`); - await queryRunner.query(`DROP INDEX "IDX_985b836dddd8615e432d7043dd"`); - await queryRunner.query(`DROP INDEX "IDX_f631d37835adb04792e361807c"`); - await queryRunner.query(`DROP INDEX "IDX_8f1a239bd077c8864a20c62c2c"`); - await queryRunner.query(`DROP TABLE "gallery_post"`); - } -} diff --git a/packages/backend/migration/1611547387175-objectStorageS3ForcePathStyle.js b/packages/backend/migration/1611547387175-objectStorageS3ForcePathStyle.js deleted file mode 100644 index b65ca2a577..0000000000 --- a/packages/backend/migration/1611547387175-objectStorageS3ForcePathStyle.js +++ /dev/null @@ -1,15 +0,0 @@ -export class objectStorageS3ForcePathStyle1611547387175 { - constructor() { - this.name = "objectStorageS3ForcePathStyle1611547387175"; - } - async up(queryRunner) { - await queryRunner.query( - `ALTER TABLE "meta" ADD "objectStorageS3ForcePathStyle" boolean NOT NULL DEFAULT true`, - ); - } - async down(queryRunner) { - await queryRunner.query( - `ALTER TABLE "meta" DROP COLUMN "objectStorageS3ForcePathStyle"`, - ); - } -} diff --git a/packages/backend/migration/1612619156584-announcement-email.js b/packages/backend/migration/1612619156584-announcement-email.js deleted file mode 100644 index a3b7292f8a..0000000000 --- a/packages/backend/migration/1612619156584-announcement-email.js +++ /dev/null @@ -1,15 +0,0 @@ -export class announcementEmail1612619156584 { - constructor() { - this.name = "announcementEmail1612619156584"; - } - async up(queryRunner) { - await queryRunner.query( - `ALTER TABLE "user_profile" ADD "receiveAnnouncementEmail" boolean NOT NULL DEFAULT true`, - ); - } - async down(queryRunner) { - await queryRunner.query( - `ALTER TABLE "user_profile" DROP COLUMN "receiveAnnouncementEmail"`, - ); - } -} diff --git a/packages/backend/migration/1613155914446-emailNotificationTypes.js b/packages/backend/migration/1613155914446-emailNotificationTypes.js deleted file mode 100644 index e64aada7b3..0000000000 --- a/packages/backend/migration/1613155914446-emailNotificationTypes.js +++ /dev/null @@ -1,15 +0,0 @@ -export class emailNotificationTypes1613155914446 { - constructor() { - this.name = "emailNotificationTypes1613155914446"; - } - async up(queryRunner) { - await queryRunner.query( - `ALTER TABLE "user_profile" ADD "emailNotificationTypes" jsonb NOT NULL DEFAULT '["follow","receiveFollowRequest","groupInvited"]'`, - ); - } - async down(queryRunner) { - await queryRunner.query( - `ALTER TABLE "user_profile" DROP COLUMN "emailNotificationTypes"`, - ); - } -} diff --git a/packages/backend/migration/1613181457597-user-lang.js b/packages/backend/migration/1613181457597-user-lang.js deleted file mode 100644 index aa5bf7de8d..0000000000 --- a/packages/backend/migration/1613181457597-user-lang.js +++ /dev/null @@ -1,13 +0,0 @@ -export class userLang1613181457597 { - constructor() { - this.name = "userLang1613181457597"; - } - async up(queryRunner) { - await queryRunner.query( - `ALTER TABLE "user_profile" ADD "lang" character varying(32)`, - ); - } - async down(queryRunner) { - await queryRunner.query(`ALTER TABLE "user_profile" DROP COLUMN "lang"`); - } -} diff --git a/packages/backend/migration/1613503367223-use-bigint-for-driveUsage.js b/packages/backend/migration/1613503367223-use-bigint-for-driveUsage.js deleted file mode 100644 index a8f1e33bfc..0000000000 --- a/packages/backend/migration/1613503367223-use-bigint-for-driveUsage.js +++ /dev/null @@ -1,16 +0,0 @@ -export class useBigintForDriveUsage1613503367223 { - constructor() { - this.name = "useBigintForDriveUsage1613503367223"; - } - async up(queryRunner) { - await queryRunner.query( - `ALTER TABLE "instance" ALTER COLUMN "driveUsage" TYPE bigint`, - ); - } - async down(queryRunner) { - await queryRunner.query(`ALTER TABLE "instance" DROP COLUMN "driveUsage"`); - await queryRunner.query( - `ALTER TABLE "instance" ADD "driveUsage" integer NOT NULL DEFAULT 0`, - ); - } -} diff --git a/packages/backend/migration/1615965918224-chart-v2.js b/packages/backend/migration/1615965918224-chart-v2.js deleted file mode 100644 index 0460a57f55..0000000000 --- a/packages/backend/migration/1615965918224-chart-v2.js +++ /dev/null @@ -1,508 +0,0 @@ -export class chartV21615965918224 { - constructor() { - this.name = "chartV21615965918224"; - } - async up(queryRunner) { - await queryRunner.query( - `DELETE FROM "__chart__active_users" WHERE "span" = 'day'`, - ); - await queryRunner.query( - `DELETE FROM "__chart__drive" WHERE "span" = 'day'`, - ); - await queryRunner.query( - `DELETE FROM "__chart__federation" WHERE "span" = 'day'`, - ); - await queryRunner.query( - `DELETE FROM "__chart__hashtag" WHERE "span" = 'day'`, - ); - await queryRunner.query( - `DELETE FROM "__chart__instance" WHERE "span" = 'day'`, - ); - await queryRunner.query( - `DELETE FROM "__chart__network" WHERE "span" = 'day'`, - ); - await queryRunner.query( - `DELETE FROM "__chart__notes" WHERE "span" = 'day'`, - ); - await queryRunner.query( - `DELETE FROM "__chart__per_user_drive" WHERE "span" = 'day'`, - ); - await queryRunner.query( - `DELETE FROM "__chart__per_user_following" WHERE "span" = 'day'`, - ); - await queryRunner.query( - `DELETE FROM "__chart__per_user_notes" WHERE "span" = 'day'`, - ); - await queryRunner.query( - `DELETE FROM "__chart__per_user_reaction" WHERE "span" = 'day'`, - ); - await queryRunner.query(`DELETE FROM "__chart__test" WHERE "span" = 'day'`); - await queryRunner.query( - `DELETE FROM "__chart__test_grouped" WHERE "span" = 'day'`, - ); - await queryRunner.query( - `DELETE FROM "__chart__test_unique" WHERE "span" = 'day'`, - ); - await queryRunner.query( - `DELETE FROM "__chart__users" WHERE "span" = 'day'`, - ); - await queryRunner.query(`DROP INDEX "IDX_15e91a03aeeac9dbccdf43fc06"`); - await queryRunner.query(`DROP INDEX "IDX_20f57cc8f142c131340ee16742"`); - await queryRunner.query(`DROP INDEX "IDX_c26e2c1cbb6e911e0554b27416"`); - await queryRunner.query(`DROP INDEX "IDX_3fa0d0f17ca72e3dc80999a032"`); - await queryRunner.query(`DROP INDEX "IDX_6e1df243476e20cbf86572ecc0"`); - await queryRunner.query(`DROP INDEX "IDX_06690fc959f1c9fdaf21928222"`); - await queryRunner.query(`DROP INDEX "IDX_e447064455928cf627590ef527"`); - await queryRunner.query(`DROP INDEX "IDX_2d416e6af791a82e338c79d480"`); - await queryRunner.query(`DROP INDEX "IDX_e9cd07672b37d8966cf3709283"`); - await queryRunner.query(`DROP INDEX "IDX_fcc181fb8283009c61cc4083ef"`); - await queryRunner.query(`DROP INDEX "IDX_49975586f50ed7b800fdd88fbd"`); - await queryRunner.query(`DROP INDEX "IDX_6d6f156ceefc6bc5f273a0e370"`); - await queryRunner.query(`DROP INDEX "IDX_c12f0af4a66cdd30c2287ce8aa"`); - await queryRunner.query(`DROP INDEX "IDX_d0a4f79af5a97b08f37b547197"`); - await queryRunner.query(`DROP INDEX "IDX_f5448d9633cff74208d850aabe"`); - await queryRunner.query(`DROP INDEX "IDX_f8dd01baeded2ffa833e0a610a"`); - await queryRunner.query(`DROP INDEX "IDX_08fac0eb3b11f04c200c0b40dd"`); - await queryRunner.query(`DROP INDEX "IDX_9ff6944f01acb756fdc92d7563"`); - await queryRunner.query(`DROP INDEX "IDX_e69096589f11e3baa98ddd64d0"`); - await queryRunner.query(`DROP INDEX "IDX_0c9a159c5082cbeef3ca6706b5"`); - await queryRunner.query(`DROP INDEX "IDX_924fc196c80ca24bae01dd37e4"`); - await queryRunner.query(`DROP INDEX "IDX_328f259961e60c4fa0bfcf55ca"`); - await queryRunner.query(`DROP INDEX "IDX_42ea9381f0fda8dfe0fa1c8b53"`); - await queryRunner.query(`DROP INDEX "IDX_f2aeafde2ae6fbad38e857631b"`); - await queryRunner.query(`DROP INDEX "IDX_f92dd6d03f8d994f29987f6214"`); - await queryRunner.query(`DROP INDEX "IDX_57b5458d0d3d6d1e7f13d4e57f"`); - await queryRunner.query(`DROP INDEX "IDX_4db3b84c7be0d3464714f3e0b1"`); - await queryRunner.query(`DROP INDEX "IDX_8d2cbbc8114d90d19b44d626b6"`); - await queryRunner.query(`DROP INDEX "IDX_046feeb12e9ef5f783f409866a"`); - await queryRunner.query(`DROP INDEX "IDX_f68a5ab958f9f5fa17a32ac23b"`); - await queryRunner.query(`DROP INDEX "IDX_65633a106bce43fc7c5c30a5c7"`); - await queryRunner.query(`DROP INDEX "IDX_edeb73c09c3143a81bcb34d569"`); - await queryRunner.query(`DROP INDEX "IDX_e316f01a6d24eb31db27f88262"`); - await queryRunner.query(`DROP INDEX "IDX_2be7ec6cebddc14dc11e206686"`); - await queryRunner.query(`DROP INDEX "IDX_a5133470f4825902e170328ca5"`); - await queryRunner.query(`DROP INDEX "IDX_84e661abb7bd1e51b690d4b017"`); - await queryRunner.query(`DROP INDEX "IDX_5c73bf61da4f6e6f15bae88ed1"`); - await queryRunner.query(`DROP INDEX "IDX_d70c86baedc68326be11f9c0ce"`); - await queryRunner.query(`DROP INDEX "IDX_66e1e1ecd2f29e57778af35b59"`); - await queryRunner.query(`DROP INDEX "IDX_92255988735563f0fe4aba1f05"`); - await queryRunner.query(`DROP INDEX "IDX_c5870993e25c3d5771f91f5003"`); - await queryRunner.query(`DROP INDEX "IDX_f170de677ea75ad4533de2723e"`); - await queryRunner.query(`DROP INDEX "IDX_7c184198ecf66a8d3ecb253ab3"`); - await queryRunner.query(`DROP INDEX "IDX_f091abb24193d50c653c6b77fc"`); - await queryRunner.query(`DROP INDEX "IDX_a770a57c70e668cc61590c9161"`); - await queryRunner.query( - `ALTER TABLE "__chart__active_users" DROP COLUMN "span"`, - ); - await queryRunner.query( - `DROP TYPE "public"."__chart__active_users_span_enum"`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__active_users" DROP COLUMN "unique"`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__active_users" DROP COLUMN "___local_count"`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__active_users" DROP COLUMN "___remote_count"`, - ); - await queryRunner.query(`ALTER TABLE "__chart__drive" DROP COLUMN "span"`); - await queryRunner.query(`DROP TYPE "public"."__chart__drive_span_enum"`); - await queryRunner.query( - `ALTER TABLE "__chart__drive" DROP COLUMN "unique"`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__federation" DROP COLUMN "span"`, - ); - await queryRunner.query( - `DROP TYPE "public"."__chart__federation_span_enum"`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__federation" DROP COLUMN "unique"`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__hashtag" DROP COLUMN "span"`, - ); - await queryRunner.query(`DROP TYPE "public"."__chart__hashtag_span_enum"`); - await queryRunner.query( - `ALTER TABLE "__chart__hashtag" DROP COLUMN "unique"`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__hashtag" DROP COLUMN "___local_count"`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__hashtag" DROP COLUMN "___remote_count"`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__instance" DROP COLUMN "span"`, - ); - await queryRunner.query(`DROP TYPE "public"."__chart__instance_span_enum"`); - await queryRunner.query( - `ALTER TABLE "__chart__instance" DROP COLUMN "unique"`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__network" DROP COLUMN "span"`, - ); - await queryRunner.query(`DROP TYPE "public"."__chart__network_span_enum"`); - await queryRunner.query( - `ALTER TABLE "__chart__network" DROP COLUMN "unique"`, - ); - await queryRunner.query(`ALTER TABLE "__chart__notes" DROP COLUMN "span"`); - await queryRunner.query(`DROP TYPE "public"."__chart__notes_span_enum"`); - await queryRunner.query( - `ALTER TABLE "__chart__notes" DROP COLUMN "unique"`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__per_user_drive" DROP COLUMN "span"`, - ); - await queryRunner.query( - `DROP TYPE "public"."__chart__per_user_drive_span_enum"`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__per_user_drive" DROP COLUMN "unique"`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__per_user_following" DROP COLUMN "span"`, - ); - await queryRunner.query( - `DROP TYPE "public"."__chart__per_user_following_span_enum"`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__per_user_following" DROP COLUMN "unique"`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__per_user_notes" DROP COLUMN "span"`, - ); - await queryRunner.query( - `DROP TYPE "public"."__chart__per_user_notes_span_enum"`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__per_user_notes" DROP COLUMN "unique"`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__per_user_reaction" DROP COLUMN "span"`, - ); - await queryRunner.query( - `DROP TYPE "public"."__chart__per_user_reaction_span_enum"`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__per_user_reaction" DROP COLUMN "unique"`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__test_grouped" DROP COLUMN "span"`, - ); - await queryRunner.query( - `DROP TYPE "public"."__chart__test_grouped_span_enum"`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__test_grouped" DROP COLUMN "unique"`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__test_unique" DROP COLUMN "span"`, - ); - await queryRunner.query( - `DROP TYPE "public"."__chart__test_unique_span_enum"`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__test_unique" DROP COLUMN "unique"`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__test_unique" DROP COLUMN "___foo"`, - ); - await queryRunner.query(`ALTER TABLE "__chart__test" DROP COLUMN "span"`); - await queryRunner.query(`DROP TYPE "public"."__chart__test_span_enum"`); - await queryRunner.query(`ALTER TABLE "__chart__test" DROP COLUMN "unique"`); - await queryRunner.query(`ALTER TABLE "__chart__users" DROP COLUMN "span"`); - await queryRunner.query(`DROP TYPE "public"."__chart__users_span_enum"`); - await queryRunner.query( - `ALTER TABLE "__chart__users" DROP COLUMN "unique"`, - ); - } - async down(queryRunner) { - await queryRunner.query( - `ALTER TABLE "__chart__users" ADD "unique" jsonb NOT NULL DEFAULT '{}'`, - ); - await queryRunner.query( - `CREATE TYPE "public"."__chart__users_span_enum" AS ENUM('hour', 'day')`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__users" ADD "span" "__chart__users_span_enum" NOT NULL`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__test" ADD "unique" jsonb NOT NULL DEFAULT '{}'`, - ); - await queryRunner.query( - `CREATE TYPE "public"."__chart__test_span_enum" AS ENUM('hour', 'day')`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__test" ADD "span" "__chart__test_span_enum" NOT NULL`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__test_unique" ADD "___foo" bigint NOT NULL`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__test_unique" ADD "unique" jsonb NOT NULL DEFAULT '{}'`, - ); - await queryRunner.query( - `CREATE TYPE "public"."__chart__test_unique_span_enum" AS ENUM('hour', 'day')`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__test_unique" ADD "span" "__chart__test_unique_span_enum" NOT NULL`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__test_grouped" ADD "unique" jsonb NOT NULL DEFAULT '{}'`, - ); - await queryRunner.query( - `CREATE TYPE "public"."__chart__test_grouped_span_enum" AS ENUM('hour', 'day')`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__test_grouped" ADD "span" "__chart__test_grouped_span_enum" NOT NULL`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__per_user_reaction" ADD "unique" jsonb NOT NULL DEFAULT '{}'`, - ); - await queryRunner.query( - `CREATE TYPE "public"."__chart__per_user_reaction_span_enum" AS ENUM('hour', 'day')`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__per_user_reaction" ADD "span" "__chart__per_user_reaction_span_enum" NOT NULL`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__per_user_notes" ADD "unique" jsonb NOT NULL DEFAULT '{}'`, - ); - await queryRunner.query( - `CREATE TYPE "public"."__chart__per_user_notes_span_enum" AS ENUM('hour', 'day')`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__per_user_notes" ADD "span" "__chart__per_user_notes_span_enum" NOT NULL`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__per_user_following" ADD "unique" jsonb NOT NULL DEFAULT '{}'`, - ); - await queryRunner.query( - `CREATE TYPE "public"."__chart__per_user_following_span_enum" AS ENUM('hour', 'day')`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__per_user_following" ADD "span" "__chart__per_user_following_span_enum" NOT NULL`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__per_user_drive" ADD "unique" jsonb NOT NULL DEFAULT '{}'`, - ); - await queryRunner.query( - `CREATE TYPE "public"."__chart__per_user_drive_span_enum" AS ENUM('hour', 'day')`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__per_user_drive" ADD "span" "__chart__per_user_drive_span_enum" NOT NULL`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__notes" ADD "unique" jsonb NOT NULL DEFAULT '{}'`, - ); - await queryRunner.query( - `CREATE TYPE "public"."__chart__notes_span_enum" AS ENUM('hour', 'day')`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__notes" ADD "span" "__chart__notes_span_enum" NOT NULL`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__network" ADD "unique" jsonb NOT NULL DEFAULT '{}'`, - ); - await queryRunner.query( - `CREATE TYPE "public"."__chart__network_span_enum" AS ENUM('hour', 'day')`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__network" ADD "span" "__chart__network_span_enum" NOT NULL`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__instance" ADD "unique" jsonb NOT NULL DEFAULT '{}'`, - ); - await queryRunner.query( - `CREATE TYPE "public"."__chart__instance_span_enum" AS ENUM('hour', 'day')`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__instance" ADD "span" "__chart__instance_span_enum" NOT NULL`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__hashtag" ADD "___remote_count" bigint NOT NULL`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__hashtag" ADD "___local_count" bigint NOT NULL`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__hashtag" ADD "unique" jsonb NOT NULL DEFAULT '{}'`, - ); - await queryRunner.query( - `CREATE TYPE "public"."__chart__hashtag_span_enum" AS ENUM('hour', 'day')`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__hashtag" ADD "span" "__chart__hashtag_span_enum" NOT NULL`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__federation" ADD "unique" jsonb NOT NULL DEFAULT '{}'`, - ); - await queryRunner.query( - `CREATE TYPE "public"."__chart__federation_span_enum" AS ENUM('hour', 'day')`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__federation" ADD "span" "__chart__federation_span_enum" NOT NULL`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__drive" ADD "unique" jsonb NOT NULL DEFAULT '{}'`, - ); - await queryRunner.query( - `CREATE TYPE "public"."__chart__drive_span_enum" AS ENUM('hour', 'day')`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__drive" ADD "span" "__chart__drive_span_enum" NOT NULL`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__active_users" ADD "___remote_count" bigint NOT NULL`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__active_users" ADD "___local_count" bigint NOT NULL`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__active_users" ADD "unique" jsonb NOT NULL DEFAULT '{}'`, - ); - await queryRunner.query( - `CREATE TYPE "public"."__chart__active_users_span_enum" AS ENUM('hour', 'day')`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__active_users" ADD "span" "__chart__active_users_span_enum" NOT NULL`, - ); - await queryRunner.query( - `CREATE INDEX "IDX_a770a57c70e668cc61590c9161" ON "__chart__users" ("date", "group", "span") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_f091abb24193d50c653c6b77fc" ON "__chart__users" ("date", "span") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_7c184198ecf66a8d3ecb253ab3" ON "__chart__users" ("span") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_f170de677ea75ad4533de2723e" ON "__chart__test" ("date", "group", "span") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_c5870993e25c3d5771f91f5003" ON "__chart__test" ("date", "span") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_92255988735563f0fe4aba1f05" ON "__chart__test" ("span") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_66e1e1ecd2f29e57778af35b59" ON "__chart__test_unique" ("date", "group", "span") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_d70c86baedc68326be11f9c0ce" ON "__chart__test_unique" ("date", "span") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_5c73bf61da4f6e6f15bae88ed1" ON "__chart__test_unique" ("span") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_84e661abb7bd1e51b690d4b017" ON "__chart__test_grouped" ("date", "group", "span") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_a5133470f4825902e170328ca5" ON "__chart__test_grouped" ("date", "span") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_2be7ec6cebddc14dc11e206686" ON "__chart__test_grouped" ("span") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_e316f01a6d24eb31db27f88262" ON "__chart__per_user_reaction" ("date", "group", "span") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_edeb73c09c3143a81bcb34d569" ON "__chart__per_user_reaction" ("date", "span") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_65633a106bce43fc7c5c30a5c7" ON "__chart__per_user_reaction" ("span") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_f68a5ab958f9f5fa17a32ac23b" ON "__chart__per_user_notes" ("date", "group", "span") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_046feeb12e9ef5f783f409866a" ON "__chart__per_user_notes" ("date", "span") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_8d2cbbc8114d90d19b44d626b6" ON "__chart__per_user_notes" ("span") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_4db3b84c7be0d3464714f3e0b1" ON "__chart__per_user_following" ("date", "group", "span") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_57b5458d0d3d6d1e7f13d4e57f" ON "__chart__per_user_following" ("date", "span") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_f92dd6d03f8d994f29987f6214" ON "__chart__per_user_following" ("span") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_f2aeafde2ae6fbad38e857631b" ON "__chart__per_user_drive" ("date", "group", "span") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_42ea9381f0fda8dfe0fa1c8b53" ON "__chart__per_user_drive" ("date", "span") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_328f259961e60c4fa0bfcf55ca" ON "__chart__per_user_drive" ("span") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_924fc196c80ca24bae01dd37e4" ON "__chart__notes" ("date", "group", "span") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_0c9a159c5082cbeef3ca6706b5" ON "__chart__notes" ("date", "span") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_e69096589f11e3baa98ddd64d0" ON "__chart__notes" ("span") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_9ff6944f01acb756fdc92d7563" ON "__chart__network" ("date", "group", "span") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_08fac0eb3b11f04c200c0b40dd" ON "__chart__network" ("date", "span") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_f8dd01baeded2ffa833e0a610a" ON "__chart__network" ("span") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_f5448d9633cff74208d850aabe" ON "__chart__instance" ("date", "group", "span") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_d0a4f79af5a97b08f37b547197" ON "__chart__instance" ("date", "span") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_c12f0af4a66cdd30c2287ce8aa" ON "__chart__instance" ("span") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_6d6f156ceefc6bc5f273a0e370" ON "__chart__hashtag" ("date", "group", "span") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_49975586f50ed7b800fdd88fbd" ON "__chart__hashtag" ("date", "span") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_fcc181fb8283009c61cc4083ef" ON "__chart__hashtag" ("span") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_e9cd07672b37d8966cf3709283" ON "__chart__federation" ("date", "group", "span") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_2d416e6af791a82e338c79d480" ON "__chart__federation" ("date", "span") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_e447064455928cf627590ef527" ON "__chart__federation" ("span") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_06690fc959f1c9fdaf21928222" ON "__chart__drive" ("date", "group", "span") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_6e1df243476e20cbf86572ecc0" ON "__chart__drive" ("date", "span") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_3fa0d0f17ca72e3dc80999a032" ON "__chart__drive" ("span") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_c26e2c1cbb6e911e0554b27416" ON "__chart__active_users" ("date", "group", "span") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_20f57cc8f142c131340ee16742" ON "__chart__active_users" ("date", "span") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_15e91a03aeeac9dbccdf43fc06" ON "__chart__active_users" ("span") `, - ); - } -} diff --git a/packages/backend/migration/1615966519402-chart-v2-2.js b/packages/backend/migration/1615966519402-chart-v2-2.js deleted file mode 100644 index ce75961035..0000000000 --- a/packages/backend/migration/1615966519402-chart-v2-2.js +++ /dev/null @@ -1,39 +0,0 @@ -export class chartV221615966519402 { - constructor() { - this.name = "chartV221615966519402"; - } - async up(queryRunner) { - await queryRunner.query( - `ALTER TABLE "__chart__active_users" ADD "___local_users" character varying array NOT NULL DEFAULT '{}'::varchar[]`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__active_users" ADD "___remote_users" character varying array NOT NULL DEFAULT '{}'::varchar[]`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__hashtag" ADD "___local_users" character varying array NOT NULL DEFAULT '{}'::varchar[]`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__hashtag" ADD "___remote_users" character varying array NOT NULL DEFAULT '{}'::varchar[]`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__test_unique" ADD "___foo" character varying array NOT NULL DEFAULT '{}'::varchar[]`, - ); - } - async down(queryRunner) { - await queryRunner.query( - `ALTER TABLE "__chart__test_unique" DROP COLUMN "___foo"`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__hashtag" DROP COLUMN "___remote_users"`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__hashtag" DROP COLUMN "___local_users"`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__active_users" DROP COLUMN "___remote_users"`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__active_users" DROP COLUMN "___local_users"`, - ); - } -} diff --git a/packages/backend/migration/1618637372000-user-last-active-date.js b/packages/backend/migration/1618637372000-user-last-active-date.js deleted file mode 100644 index 0211c256bc..0000000000 --- a/packages/backend/migration/1618637372000-user-last-active-date.js +++ /dev/null @@ -1,17 +0,0 @@ -export class userLastActiveDate1618637372000 { - constructor() { - this.name = "userLastActiveDate1618637372000"; - } - async up(queryRunner) { - await queryRunner.query( - `ALTER TABLE "user" ADD "lastActiveDate" TIMESTAMP WITH TIME ZONE DEFAULT NULL`, - ); - await queryRunner.query( - `CREATE INDEX "IDX_seoignmeoprigmkpodgrjmkpormg" ON "user" ("lastActiveDate") `, - ); - } - async down(queryRunner) { - await queryRunner.query(`DROP INDEX "IDX_seoignmeoprigmkpodgrjmkpormg"`); - await queryRunner.query(`ALTER TABLE "user" DROP COLUMN "lastActiveDate"`); - } -} diff --git a/packages/backend/migration/1618639857000-user-hide-online-status.js b/packages/backend/migration/1618639857000-user-hide-online-status.js deleted file mode 100644 index 8d76326084..0000000000 --- a/packages/backend/migration/1618639857000-user-hide-online-status.js +++ /dev/null @@ -1,15 +0,0 @@ -export class userHideOnlineStatus1618639857000 { - constructor() { - this.name = "userHideOnlineStatus1618639857000"; - } - async up(queryRunner) { - await queryRunner.query( - `ALTER TABLE "user" ADD "hideOnlineStatus" boolean NOT NULL DEFAULT false`, - ); - } - async down(queryRunner) { - await queryRunner.query( - `ALTER TABLE "user" DROP COLUMN "hideOnlineStatus"`, - ); - } -} diff --git a/packages/backend/migration/1619942102890-password-reset.js b/packages/backend/migration/1619942102890-password-reset.js deleted file mode 100644 index e3adeb95e7..0000000000 --- a/packages/backend/migration/1619942102890-password-reset.js +++ /dev/null @@ -1,27 +0,0 @@ -export class passwordReset1619942102890 { - constructor() { - this.name = "passwordReset1619942102890"; - } - async up(queryRunner) { - await queryRunner.query( - `CREATE TABLE "password_reset_request" ("id" character varying(32) NOT NULL, "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL, "token" character varying(256) NOT NULL, "userId" character varying(32) NOT NULL, CONSTRAINT "PK_fcf4b02eae1403a2edaf87fd074" PRIMARY KEY ("id"))`, - ); - await queryRunner.query( - `CREATE UNIQUE INDEX "IDX_0b575fa9a4cfe638a925949285" ON "password_reset_request" ("token") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_4bb7fd4a34492ae0e6cc8d30ac" ON "password_reset_request" ("userId") `, - ); - await queryRunner.query( - `ALTER TABLE "password_reset_request" ADD CONSTRAINT "FK_4bb7fd4a34492ae0e6cc8d30ac8" FOREIGN KEY ("userId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, - ); - } - async down(queryRunner) { - await queryRunner.query( - `ALTER TABLE "password_reset_request" DROP CONSTRAINT "FK_4bb7fd4a34492ae0e6cc8d30ac8"`, - ); - await queryRunner.query(`DROP INDEX "IDX_4bb7fd4a34492ae0e6cc8d30ac"`); - await queryRunner.query(`DROP INDEX "IDX_0b575fa9a4cfe638a925949285"`); - await queryRunner.query(`DROP TABLE "password_reset_request"`); - } -} diff --git a/packages/backend/migration/1620019354680-ad.js b/packages/backend/migration/1620019354680-ad.js deleted file mode 100644 index e39b381013..0000000000 --- a/packages/backend/migration/1620019354680-ad.js +++ /dev/null @@ -1,21 +0,0 @@ -export class ad1620019354680 { - constructor() { - this.name = "ad1620019354680"; - } - async up(queryRunner) { - await queryRunner.query( - `CREATE TABLE "ad" ("id" character varying(32) NOT NULL, "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL, "expiresAt" TIMESTAMP WITH TIME ZONE NOT NULL, "place" character varying(32) NOT NULL, "priority" character varying(32) NOT NULL, "url" character varying(1024) NOT NULL, "imageUrl" character varying(1024) NOT NULL, "memo" character varying(8192) NOT NULL, CONSTRAINT "PK_0193d5ef09746e88e9ea92c634d" PRIMARY KEY ("id")); COMMENT ON COLUMN "ad"."createdAt" IS 'The created date of the Ad.'; COMMENT ON COLUMN "ad"."expiresAt" IS 'The expired date of the Ad.'`, - ); - await queryRunner.query( - `CREATE INDEX "IDX_1129c2ef687fc272df040bafaa" ON "ad" ("createdAt") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_2da24ce20ad209f1d9dc032457" ON "ad" ("expiresAt") `, - ); - } - async down(queryRunner) { - await queryRunner.query(`DROP INDEX "IDX_2da24ce20ad209f1d9dc032457"`); - await queryRunner.query(`DROP INDEX "IDX_1129c2ef687fc272df040bafaa"`); - await queryRunner.query(`DROP TABLE "ad"`); - } -} diff --git a/packages/backend/migration/1620364649428-ad2.js b/packages/backend/migration/1620364649428-ad2.js deleted file mode 100644 index a61c3ef088..0000000000 --- a/packages/backend/migration/1620364649428-ad2.js +++ /dev/null @@ -1,13 +0,0 @@ -export class ad21620364649428 { - constructor() { - this.name = "ad21620364649428"; - } - async up(queryRunner) { - await queryRunner.query( - `ALTER TABLE "ad" ADD "ratio" integer NOT NULL DEFAULT '1'`, - ); - } - async down(queryRunner) { - await queryRunner.query(`ALTER TABLE "ad" DROP COLUMN "ratio"`); - } -} diff --git a/packages/backend/migration/1621479946000-add-note-indexes.js b/packages/backend/migration/1621479946000-add-note-indexes.js deleted file mode 100644 index f9ffbbff17..0000000000 --- a/packages/backend/migration/1621479946000-add-note-indexes.js +++ /dev/null @@ -1,22 +0,0 @@ -export class addNoteIndexes1621479946000 { - constructor() { - this.name = "addNoteIndexes1621479946000"; - } - async up(queryRunner) { - await queryRunner.query( - `CREATE INDEX "IDX_NOTE_MENTIONS" ON "note" USING gin ("mentions")`, - undefined, - ); - await queryRunner.query( - `CREATE INDEX "IDX_NOTE_VISIBLE_USER_IDS" ON "note" USING gin ("visibleUserIds")`, - undefined, - ); - } - async down(queryRunner) { - await queryRunner.query(`DROP INDEX "IDX_NOTE_MENTIONS"`, undefined); - await queryRunner.query( - `DROP INDEX "IDX_NOTE_VISIBLE_USER_IDS"`, - undefined, - ); - } -} diff --git a/packages/backend/migration/1622679304522-user-profile-description-length.js b/packages/backend/migration/1622679304522-user-profile-description-length.js deleted file mode 100644 index 7c761c92a1..0000000000 --- a/packages/backend/migration/1622679304522-user-profile-description-length.js +++ /dev/null @@ -1,17 +0,0 @@ -export class userProfileDescriptionLength1622679304522 { - constructor() { - this.name = "userProfileDescriptionLength1622679304522"; - } - async up(queryRunner) { - await queryRunner.query( - `ALTER TABLE "user_profile" ALTER COLUMN "description" TYPE character varying(2048)`, - undefined, - ); - } - async down(queryRunner) { - await queryRunner.query( - `ALTER TABLE "user_profile" ALTER COLUMN "description" TYPE character varying(1024)`, - undefined, - ); - } -} diff --git a/packages/backend/migration/1622681548499-log-message-length.js b/packages/backend/migration/1622681548499-log-message-length.js deleted file mode 100644 index 9dfb7ed3d2..0000000000 --- a/packages/backend/migration/1622681548499-log-message-length.js +++ /dev/null @@ -1,17 +0,0 @@ -export class logMessageLength1622681548499 { - constructor() { - this.name = "logMessageLength1622681548499"; - } - async up(queryRunner) { - await queryRunner.query( - `ALTER TABLE "log" ALTER COLUMN "message" TYPE character varying(2048)`, - undefined, - ); - } - async down(queryRunner) { - await queryRunner.query( - `ALTER TABLE "log" ALTER COLUMN "message" TYPE character varying(1024)`, - undefined, - ); - } -} diff --git a/packages/backend/migration/1626509500668-fix-remote-file-proxy.js b/packages/backend/migration/1626509500668-fix-remote-file-proxy.js deleted file mode 100644 index f79cfb0066..0000000000 --- a/packages/backend/migration/1626509500668-fix-remote-file-proxy.js +++ /dev/null @@ -1,31 +0,0 @@ -export class fixRemoteFileProxy1626509500668 { - constructor() { - this.name = "fixRemoteFileProxy1626509500668"; - } - async up(queryRunner) { - await queryRunner.query(`ALTER TABLE "user" DROP COLUMN "avatarUrl"`); - await queryRunner.query(`ALTER TABLE "user" DROP COLUMN "bannerUrl"`); - await queryRunner.query(`ALTER TABLE "user" DROP COLUMN "avatarBlurhash"`); - await queryRunner.query(`ALTER TABLE "user" DROP COLUMN "bannerBlurhash"`); - await queryRunner.query( - `ALTER TABLE "meta" DROP COLUMN "proxyRemoteFiles"`, - ); - } - async down(queryRunner) { - await queryRunner.query( - `ALTER TABLE "meta" ADD "proxyRemoteFiles" boolean NOT NULL DEFAULT false`, - ); - await queryRunner.query( - `ALTER TABLE "user" ADD "bannerBlurhash" character varying(128)`, - ); - await queryRunner.query( - `ALTER TABLE "user" ADD "avatarBlurhash" character varying(128)`, - ); - await queryRunner.query( - `ALTER TABLE "user" ADD "bannerUrl" character varying(512)`, - ); - await queryRunner.query( - `ALTER TABLE "user" ADD "avatarUrl" character varying(512)`, - ); - } -} diff --git a/packages/backend/migration/1626733991004-allowlist-secure-mode.js b/packages/backend/migration/1626733991004-allowlist-secure-mode.js deleted file mode 100644 index 6d2dd6842f..0000000000 --- a/packages/backend/migration/1626733991004-allowlist-secure-mode.js +++ /dev/null @@ -1,20 +0,0 @@ -export class allowlistSecureMode1626733991004 { - name = "allowlistSecureMode1626733991004"; - async up(queryRunner) { - await queryRunner.query( - `ALTER TABLE "meta" ADD "allowedHosts" character varying(256) [] default '{}'`, - ); - await queryRunner.query( - `ALTER TABLE "meta" ADD "secureMode" bool default false`, - ); - await queryRunner.query( - `ALTER TABLE "meta" ADD "privateMode" bool default false`, - ); - } - - async down(queryRunner) { - await queryRunner.query(`ALTER TABLE "meta" DROP COLUMN "allowedHosts"`); - await queryRunner.query(`ALTER TABLE "meta" DROP COLUMN "secureMode"`); - await queryRunner.query(`ALTER TABLE "meta" DROP COLUMN "privateMode"`); - } -} diff --git a/packages/backend/migration/1629004542760-chart-reindex.js b/packages/backend/migration/1629004542760-chart-reindex.js deleted file mode 100644 index 8cc564b32e..0000000000 --- a/packages/backend/migration/1629004542760-chart-reindex.js +++ /dev/null @@ -1,357 +0,0 @@ -export class chartReindex1629004542760 { - constructor() { - this.name = "chartReindex1629004542760"; - } - async up(queryRunner) { - await queryRunner.query( - `DELETE FROM "__chart__active_users" a USING "__chart__active_users" b WHERE a.id < b.id AND ((a.group IS NULL AND b.group IS NULL) OR a.group = b.group) AND a.date = b.date;`, - ); - await queryRunner.query( - `DELETE FROM "__chart__drive" a USING "__chart__drive" b WHERE a.id < b.id AND ((a.group IS NULL AND b.group IS NULL) OR a.group = b.group) AND a.date = b.date;`, - ); - await queryRunner.query( - `DELETE FROM "__chart__federation" a USING "__chart__federation" b WHERE a.id < b.id AND ((a.group IS NULL AND b.group IS NULL) OR a.group = b.group) AND a.date = b.date;`, - ); - await queryRunner.query( - `DELETE FROM "__chart__hashtag" a USING "__chart__hashtag" b WHERE a.id < b.id AND ((a.group IS NULL AND b.group IS NULL) OR a.group = b.group) AND a.date = b.date;`, - ); - await queryRunner.query( - `DELETE FROM "__chart__instance" a USING "__chart__instance" b WHERE a.id < b.id AND ((a.group IS NULL AND b.group IS NULL) OR a.group = b.group) AND a.date = b.date;`, - ); - await queryRunner.query( - `DELETE FROM "__chart__network" a USING "__chart__network" b WHERE a.id < b.id AND ((a.group IS NULL AND b.group IS NULL) OR a.group = b.group) AND a.date = b.date;`, - ); - await queryRunner.query( - `DELETE FROM "__chart__notes" a USING "__chart__notes" b WHERE a.id < b.id AND ((a.group IS NULL AND b.group IS NULL) OR a.group = b.group) AND a.date = b.date;`, - ); - await queryRunner.query( - `DELETE FROM "__chart__per_user_drive" a USING "__chart__per_user_drive" b WHERE a.id < b.id AND ((a.group IS NULL AND b.group IS NULL) OR a.group = b.group) AND a.date = b.date;`, - ); - await queryRunner.query( - `DELETE FROM "__chart__per_user_following" a USING "__chart__per_user_following" b WHERE a.id < b.id AND ((a.group IS NULL AND b.group IS NULL) OR a.group = b.group) AND a.date = b.date;`, - ); - await queryRunner.query( - `DELETE FROM "__chart__per_user_notes" a USING "__chart__per_user_notes" b WHERE a.id < b.id AND ((a.group IS NULL AND b.group IS NULL) OR a.group = b.group) AND a.date = b.date;`, - ); - await queryRunner.query( - `DELETE FROM "__chart__per_user_reaction" a USING "__chart__per_user_reaction" b WHERE a.id < b.id AND ((a.group IS NULL AND b.group IS NULL) OR a.group = b.group) AND a.date = b.date;`, - ); - await queryRunner.query( - `DELETE FROM "__chart__test_grouped" a USING "__chart__test_grouped" b WHERE a.id < b.id AND ((a.group IS NULL AND b.group IS NULL) OR a.group = b.group) AND a.date = b.date;`, - ); - await queryRunner.query( - `DELETE FROM "__chart__test_unique" a USING "__chart__test_unique" b WHERE a.id < b.id AND ((a.group IS NULL AND b.group IS NULL) OR a.group = b.group) AND a.date = b.date;`, - ); - await queryRunner.query( - `DELETE FROM "__chart__users" a USING "__chart__users" b WHERE a.id < b.id AND ((a.group IS NULL AND b.group IS NULL) OR a.group = b.group) AND a.date = b.date;`, - ); - await queryRunner.query(`DROP INDEX "IDX_0ad37b7ef50f4ddc84363d7ccc"`); - await queryRunner.query(`DROP INDEX "IDX_00ed5f86db1f7efafb1978bf21"`); - await queryRunner.query(`DROP INDEX "IDX_9a3ed15a30ab7e3a37702e6e08"`); - await queryRunner.query(`DROP INDEX "IDX_13565815f618a1ff53886c5b28"`); - await queryRunner.query(`DROP INDEX "IDX_7a170f67425e62a8fabb76c872"`); - await queryRunner.query(`DROP INDEX "IDX_3313d7288855ec105b5bbf6c21"`); - await queryRunner.query(`DROP INDEX "IDX_36cb699c49580d4e6c2e6159f9"`); - await queryRunner.query(`DROP INDEX "IDX_76e87c7bfc5d925fcbba405d84"`); - await queryRunner.query(`DROP INDEX "IDX_dd907becf76104e4b656659e6b"`); - await queryRunner.query(`DROP INDEX "IDX_07747a1038c05f532a718fe1de"`); - await queryRunner.query(`DROP INDEX "IDX_99a7d2faaef84a6f728d714ad6"`); - await queryRunner.query(`DROP INDEX "IDX_25a97c02003338124b2b75fdbc"`); - await queryRunner.query(`DROP INDEX "IDX_6b8f34a1a64b06014b6fb66824"`); - await queryRunner.query(`DROP INDEX "IDX_da8a46ba84ca1d8bb5a29bfb63"`); - await queryRunner.query(`DROP INDEX "IDX_39ee857ab2f23493037c6b6631"`); - await queryRunner.query(`DROP INDEX "IDX_a1efd3e0048a5f2793a47360dc"`); - await queryRunner.query(`DROP INDEX "IDX_7b5da130992ec9df96712d4290"`); - await queryRunner.query(`DROP INDEX "IDX_0a905b992fecd2b5c3fb98759e"`); - await queryRunner.query(`DROP INDEX "IDX_42eb716a37d381cdf566192b2b"`); - await queryRunner.query(`DROP INDEX "IDX_7036f2957151588b813185c794"`); - await queryRunner.query(`DROP INDEX "IDX_f09d543e3acb16c5976bdb31fa"`); - await queryRunner.query(`DROP INDEX "IDX_5f86db6492274e07c1a3cdf286"`); - await queryRunner.query(`DROP INDEX "IDX_e496ca8096d28f6b9b509264dc"`); - await queryRunner.query(`DROP INDEX "IDX_30bf67687f483ace115c5ca642"`); - await queryRunner.query(`DROP INDEX "IDX_7af07790712aa3438ff6773f3b"`); - await queryRunner.query(`DROP INDEX "IDX_4b3593098b6edc9c5afe36b18b"`); - await queryRunner.query(`DROP INDEX "IDX_b77d4dd9562c3a899d9a286fcd"`); - await queryRunner.query(`DROP INDEX "IDX_84234bd1abb873f07329681c83"`); - await queryRunner.query(`DROP INDEX "IDX_55bf20f366979f2436de99206b"`); - await queryRunner.query(`DROP INDEX "IDX_5048e9daccbbbc6d567bb142d3"`); - await queryRunner.query(`DROP INDEX "IDX_f7bf4c62059764c2c2bb40fdab"`); - await queryRunner.query(`DROP INDEX "IDX_8cf3156fd7a6b15c43459c6e3b"`); - await queryRunner.query(`DROP INDEX "IDX_229a41ad465f9205f1f5703291"`); - await queryRunner.query(`DROP INDEX "IDX_0c641990ecf47d2545df4edb75"`); - await queryRunner.query(`DROP INDEX "IDX_234dff3c0b56a6150b95431ab9"`); - await queryRunner.query(`DROP INDEX "IDX_b14489029e4b3aaf4bba5fb524"`); - await queryRunner.query(`DROP INDEX "IDX_437bab3c6061d90f6bb65fd2cc"`); - await queryRunner.query(`DROP INDEX "IDX_bbfa573a8181018851ed0b6357"`); - await queryRunner.query(`DROP INDEX "IDX_a0cd75442dd10d0643a17c4a49"`); - await queryRunner.query(`DROP INDEX "IDX_b070a906db04b44c67c6c2144d"`); - await queryRunner.query(`DROP INDEX "IDX_d41cce6aee1a50bfc062038f9b"`); - await queryRunner.query(`DROP INDEX "IDX_a319e5dbf47e8a17497623beae"`); - await queryRunner.query(`DROP INDEX "IDX_845254b3eaf708ae8a6cac3026"`); - await queryRunner.query(`DROP INDEX "IDX_ed9b95919c672a13008e9487ee"`); - await queryRunner.query(`DROP INDEX "IDX_337e9599f278bd7537fe30876f"`); - await queryRunner.query( - `CREATE UNIQUE INDEX "IDX_9a3ed15a30ab7e3a37702e6e08" ON "__chart__active_users" ("date", "group") `, - ); - await queryRunner.query( - `CREATE UNIQUE INDEX "IDX_60c5c6e7e538c09aa274ecd1cf" ON "__chart__active_users" ("date") WHERE "group" IS NULL`, - ); - await queryRunner.query( - `CREATE UNIQUE INDEX "IDX_3313d7288855ec105b5bbf6c21" ON "__chart__drive" ("date", "group") `, - ); - await queryRunner.query( - `CREATE UNIQUE INDEX "IDX_ceab80a6729f8e2e6f5b8a1a3d" ON "__chart__drive" ("date") WHERE "group" IS NULL`, - ); - await queryRunner.query( - `CREATE UNIQUE INDEX "IDX_dd907becf76104e4b656659e6b" ON "__chart__federation" ("date", "group") `, - ); - await queryRunner.query( - `CREATE UNIQUE INDEX "IDX_eddfed8fb40305a04c6f941050" ON "__chart__federation" ("date") WHERE "group" IS NULL`, - ); - await queryRunner.query( - `CREATE UNIQUE INDEX "IDX_25a97c02003338124b2b75fdbc" ON "__chart__hashtag" ("date", "group") `, - ); - await queryRunner.query( - `CREATE UNIQUE INDEX "IDX_53a3604b939e2b479eb2cfaac8" ON "__chart__hashtag" ("date") WHERE "group" IS NULL`, - ); - await queryRunner.query( - `CREATE UNIQUE INDEX "IDX_39ee857ab2f23493037c6b6631" ON "__chart__instance" ("date", "group") `, - ); - await queryRunner.query( - `CREATE UNIQUE INDEX "IDX_8111b817b9818c04d7eb8475b1" ON "__chart__instance" ("date") WHERE "group" IS NULL`, - ); - await queryRunner.query( - `CREATE UNIQUE INDEX "IDX_0a905b992fecd2b5c3fb98759e" ON "__chart__network" ("date", "group") `, - ); - await queryRunner.query( - `CREATE UNIQUE INDEX "IDX_2082327b2699ce924fa654afc5" ON "__chart__network" ("date") WHERE "group" IS NULL`, - ); - await queryRunner.query( - `CREATE UNIQUE INDEX "IDX_f09d543e3acb16c5976bdb31fa" ON "__chart__notes" ("date", "group") `, - ); - await queryRunner.query( - `CREATE UNIQUE INDEX "IDX_e60c358aaced5aab8900a4af31" ON "__chart__notes" ("date") WHERE "group" IS NULL`, - ); - await queryRunner.query( - `CREATE UNIQUE INDEX "IDX_30bf67687f483ace115c5ca642" ON "__chart__per_user_drive" ("date", "group") `, - ); - await queryRunner.query( - `CREATE UNIQUE INDEX "IDX_a9a806d466b314f253a1a611c4" ON "__chart__per_user_drive" ("date") WHERE "group" IS NULL`, - ); - await queryRunner.query( - `CREATE UNIQUE INDEX "IDX_b77d4dd9562c3a899d9a286fcd" ON "__chart__per_user_following" ("date", "group") `, - ); - await queryRunner.query( - `CREATE UNIQUE INDEX "IDX_dabbb38a51ab86ee3cab291326" ON "__chart__per_user_following" ("date") WHERE "group" IS NULL`, - ); - await queryRunner.query( - `CREATE UNIQUE INDEX "IDX_5048e9daccbbbc6d567bb142d3" ON "__chart__per_user_notes" ("date", "group") `, - ); - await queryRunner.query( - `CREATE UNIQUE INDEX "IDX_583a157ed0cf0ed1b5ec2a833f" ON "__chart__per_user_notes" ("date") WHERE "group" IS NULL`, - ); - await queryRunner.query( - `CREATE UNIQUE INDEX "IDX_229a41ad465f9205f1f5703291" ON "__chart__per_user_reaction" ("date", "group") `, - ); - await queryRunner.query( - `CREATE UNIQUE INDEX "IDX_3b7697a96f522d0478972e6d6f" ON "__chart__per_user_reaction" ("date") WHERE "group" IS NULL`, - ); - await queryRunner.query( - `CREATE UNIQUE INDEX "IDX_b14489029e4b3aaf4bba5fb524" ON "__chart__test_grouped" ("date", "group") `, - ); - await queryRunner.query( - `CREATE UNIQUE INDEX "IDX_da522b4008a9f5d7743b87ad55" ON "__chart__test_grouped" ("date") WHERE "group" IS NULL`, - ); - await queryRunner.query( - `CREATE UNIQUE INDEX "IDX_a0cd75442dd10d0643a17c4a49" ON "__chart__test_unique" ("date", "group") `, - ); - await queryRunner.query( - `CREATE UNIQUE INDEX "IDX_16effb2e888f6763673b579f80" ON "__chart__test_unique" ("date") WHERE "group" IS NULL`, - ); - await queryRunner.query( - `CREATE UNIQUE INDEX "IDX_a319e5dbf47e8a17497623beae" ON "__chart__test" ("date", "group") `, - ); - await queryRunner.query( - `CREATE UNIQUE INDEX "IDX_dab383a36f3c9db4a0c9b02cf3" ON "__chart__test" ("date") WHERE "group" IS NULL`, - ); - await queryRunner.query( - `CREATE UNIQUE INDEX "IDX_337e9599f278bd7537fe30876f" ON "__chart__users" ("date", "group") `, - ); - await queryRunner.query( - `CREATE UNIQUE INDEX "IDX_66feba81e1795d176d06c0b1e6" ON "__chart__users" ("date") WHERE "group" IS NULL`, - ); - } - async down(queryRunner) { - await queryRunner.query(`DROP INDEX "IDX_66feba81e1795d176d06c0b1e6"`); - await queryRunner.query(`DROP INDEX "IDX_337e9599f278bd7537fe30876f"`); - await queryRunner.query(`DROP INDEX "IDX_dab383a36f3c9db4a0c9b02cf3"`); - await queryRunner.query(`DROP INDEX "IDX_a319e5dbf47e8a17497623beae"`); - await queryRunner.query(`DROP INDEX "IDX_16effb2e888f6763673b579f80"`); - await queryRunner.query(`DROP INDEX "IDX_a0cd75442dd10d0643a17c4a49"`); - await queryRunner.query(`DROP INDEX "IDX_da522b4008a9f5d7743b87ad55"`); - await queryRunner.query(`DROP INDEX "IDX_b14489029e4b3aaf4bba5fb524"`); - await queryRunner.query(`DROP INDEX "IDX_3b7697a96f522d0478972e6d6f"`); - await queryRunner.query(`DROP INDEX "IDX_229a41ad465f9205f1f5703291"`); - await queryRunner.query(`DROP INDEX "IDX_583a157ed0cf0ed1b5ec2a833f"`); - await queryRunner.query(`DROP INDEX "IDX_5048e9daccbbbc6d567bb142d3"`); - await queryRunner.query(`DROP INDEX "IDX_dabbb38a51ab86ee3cab291326"`); - await queryRunner.query(`DROP INDEX "IDX_b77d4dd9562c3a899d9a286fcd"`); - await queryRunner.query(`DROP INDEX "IDX_a9a806d466b314f253a1a611c4"`); - await queryRunner.query(`DROP INDEX "IDX_30bf67687f483ace115c5ca642"`); - await queryRunner.query(`DROP INDEX "IDX_e60c358aaced5aab8900a4af31"`); - await queryRunner.query(`DROP INDEX "IDX_f09d543e3acb16c5976bdb31fa"`); - await queryRunner.query(`DROP INDEX "IDX_2082327b2699ce924fa654afc5"`); - await queryRunner.query(`DROP INDEX "IDX_0a905b992fecd2b5c3fb98759e"`); - await queryRunner.query(`DROP INDEX "IDX_8111b817b9818c04d7eb8475b1"`); - await queryRunner.query(`DROP INDEX "IDX_39ee857ab2f23493037c6b6631"`); - await queryRunner.query(`DROP INDEX "IDX_53a3604b939e2b479eb2cfaac8"`); - await queryRunner.query(`DROP INDEX "IDX_25a97c02003338124b2b75fdbc"`); - await queryRunner.query(`DROP INDEX "IDX_eddfed8fb40305a04c6f941050"`); - await queryRunner.query(`DROP INDEX "IDX_dd907becf76104e4b656659e6b"`); - await queryRunner.query(`DROP INDEX "IDX_ceab80a6729f8e2e6f5b8a1a3d"`); - await queryRunner.query(`DROP INDEX "IDX_3313d7288855ec105b5bbf6c21"`); - await queryRunner.query(`DROP INDEX "IDX_60c5c6e7e538c09aa274ecd1cf"`); - await queryRunner.query(`DROP INDEX "IDX_9a3ed15a30ab7e3a37702e6e08"`); - await queryRunner.query(`DROP INDEX "IDX_a9021cc2e1feb5f72d3db6e9f5"`); - await queryRunner.query(`DROP INDEX "IDX_f22169eb10657bded6d875ac8f"`); - await queryRunner.query(`DROP INDEX "IDX_c8cc87bd0f2f4487d17c651fbf"`); - await queryRunner.query(`DROP INDEX "IDX_754499f9b2642336433769518d"`); - await queryRunner.query(`DROP INDEX "IDX_315c779174fe8247ab324f036e"`); - await queryRunner.query(`DROP INDEX "IDX_c5d46cbfda48b1c33ed852e21b"`); - await queryRunner.query( - `CREATE INDEX "IDX_337e9599f278bd7537fe30876f" ON "__chart__users" ("date", "group") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_ed9b95919c672a13008e9487ee" ON "__chart__users" ("group") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_845254b3eaf708ae8a6cac3026" ON "__chart__users" ("date") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_a319e5dbf47e8a17497623beae" ON "__chart__test" ("date", "group") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_d41cce6aee1a50bfc062038f9b" ON "__chart__test" ("group") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_b070a906db04b44c67c6c2144d" ON "__chart__test" ("date") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_a0cd75442dd10d0643a17c4a49" ON "__chart__test_unique" ("date", "group") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_bbfa573a8181018851ed0b6357" ON "__chart__test_unique" ("group") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_437bab3c6061d90f6bb65fd2cc" ON "__chart__test_unique" ("date") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_b14489029e4b3aaf4bba5fb524" ON "__chart__test_grouped" ("date", "group") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_234dff3c0b56a6150b95431ab9" ON "__chart__test_grouped" ("group") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_0c641990ecf47d2545df4edb75" ON "__chart__test_grouped" ("date") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_229a41ad465f9205f1f5703291" ON "__chart__per_user_reaction" ("date", "group") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_8cf3156fd7a6b15c43459c6e3b" ON "__chart__per_user_reaction" ("group") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_f7bf4c62059764c2c2bb40fdab" ON "__chart__per_user_reaction" ("date") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_5048e9daccbbbc6d567bb142d3" ON "__chart__per_user_notes" ("date", "group") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_55bf20f366979f2436de99206b" ON "__chart__per_user_notes" ("group") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_84234bd1abb873f07329681c83" ON "__chart__per_user_notes" ("date") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_b77d4dd9562c3a899d9a286fcd" ON "__chart__per_user_following" ("date", "group") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_4b3593098b6edc9c5afe36b18b" ON "__chart__per_user_following" ("group") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_7af07790712aa3438ff6773f3b" ON "__chart__per_user_following" ("date") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_30bf67687f483ace115c5ca642" ON "__chart__per_user_drive" ("date", "group") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_e496ca8096d28f6b9b509264dc" ON "__chart__per_user_drive" ("group") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_5f86db6492274e07c1a3cdf286" ON "__chart__per_user_drive" ("date") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_f09d543e3acb16c5976bdb31fa" ON "__chart__notes" ("date", "group") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_7036f2957151588b813185c794" ON "__chart__notes" ("group") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_42eb716a37d381cdf566192b2b" ON "__chart__notes" ("date") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_0a905b992fecd2b5c3fb98759e" ON "__chart__network" ("date", "group") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_7b5da130992ec9df96712d4290" ON "__chart__network" ("group") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_a1efd3e0048a5f2793a47360dc" ON "__chart__network" ("date") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_39ee857ab2f23493037c6b6631" ON "__chart__instance" ("date", "group") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_da8a46ba84ca1d8bb5a29bfb63" ON "__chart__instance" ("group") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_6b8f34a1a64b06014b6fb66824" ON "__chart__instance" ("date") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_25a97c02003338124b2b75fdbc" ON "__chart__hashtag" ("date", "group") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_99a7d2faaef84a6f728d714ad6" ON "__chart__hashtag" ("group") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_07747a1038c05f532a718fe1de" ON "__chart__hashtag" ("date") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_dd907becf76104e4b656659e6b" ON "__chart__federation" ("date", "group") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_76e87c7bfc5d925fcbba405d84" ON "__chart__federation" ("group") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_36cb699c49580d4e6c2e6159f9" ON "__chart__federation" ("date") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_3313d7288855ec105b5bbf6c21" ON "__chart__drive" ("date", "group") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_7a170f67425e62a8fabb76c872" ON "__chart__drive" ("group") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_13565815f618a1ff53886c5b28" ON "__chart__drive" ("date") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_9a3ed15a30ab7e3a37702e6e08" ON "__chart__active_users" ("date", "group") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_00ed5f86db1f7efafb1978bf21" ON "__chart__active_users" ("group") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_0ad37b7ef50f4ddc84363d7ccc" ON "__chart__active_users" ("date") `, - ); - } -} diff --git a/packages/backend/migration/1629024377804-deepl-integration.js b/packages/backend/migration/1629024377804-deepl-integration.js deleted file mode 100644 index 1dd5465fba..0000000000 --- a/packages/backend/migration/1629024377804-deepl-integration.js +++ /dev/null @@ -1,13 +0,0 @@ -export class deeplIntegration1629024377804 { - constructor() { - this.name = "deeplIntegration1629024377804"; - } - async up(queryRunner) { - await queryRunner.query( - `ALTER TABLE "meta" ADD "deeplAuthKey" character varying(128)`, - ); - } - async down(queryRunner) { - await queryRunner.query(`ALTER TABLE "meta" DROP COLUMN "deeplAuthKey"`); - } -} diff --git a/packages/backend/migration/1629288472000-fix-channel-userId.js b/packages/backend/migration/1629288472000-fix-channel-userId.js deleted file mode 100644 index e02549b11a..0000000000 --- a/packages/backend/migration/1629288472000-fix-channel-userId.js +++ /dev/null @@ -1,15 +0,0 @@ -export class fixChannelUserId1629288472000 { - constructor() { - this.name = "fixChannelUserId1629288472000"; - } - async up(queryRunner) { - await queryRunner.query( - `ALTER TABLE "channel" ALTER COLUMN "userId" DROP NOT NULL;`, - ); - } - async down(queryRunner) { - await queryRunner.query( - `ALTER TABLE "channel" ALTER COLUMN "userId" SET NOT NULL;`, - ); - } -} diff --git a/packages/backend/migration/1629512953000-user-is-deleted.js b/packages/backend/migration/1629512953000-user-is-deleted.js deleted file mode 100644 index 448535276f..0000000000 --- a/packages/backend/migration/1629512953000-user-is-deleted.js +++ /dev/null @@ -1,16 +0,0 @@ -export class isUserDeleted1629512953000 { - constructor() { - this.name = "isUserDeleted1629512953000"; - } - async up(queryRunner) { - await queryRunner.query( - `ALTER TABLE "user" ADD "isDeleted" boolean NOT NULL DEFAULT false`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "user"."isDeleted" IS 'Whether the User is deleted.'`, - ); - } - async down(queryRunner) { - await queryRunner.query(`ALTER TABLE "user" DROP COLUMN "isDeleted"`); - } -} diff --git a/packages/backend/migration/1629778475000-deepl-integration2.js b/packages/backend/migration/1629778475000-deepl-integration2.js deleted file mode 100644 index 138e00d247..0000000000 --- a/packages/backend/migration/1629778475000-deepl-integration2.js +++ /dev/null @@ -1,13 +0,0 @@ -export class deeplIntegration21629778475000 { - constructor() { - this.name = "deeplIntegration21629778475000"; - } - async up(queryRunner) { - await queryRunner.query( - `ALTER TABLE "meta" ADD "deeplIsPro" boolean NOT NULL DEFAULT false`, - ); - } - async down(queryRunner) { - await queryRunner.query(`ALTER TABLE "meta" DROP COLUMN "deeplIsPro"`); - } -} diff --git a/packages/backend/migration/1629833361000-AddShowTLReplies.js b/packages/backend/migration/1629833361000-AddShowTLReplies.js deleted file mode 100644 index 78e9f417b7..0000000000 --- a/packages/backend/migration/1629833361000-AddShowTLReplies.js +++ /dev/null @@ -1,18 +0,0 @@ -export class addShowTLReplies1629833361000 { - constructor() { - this.name = "addShowTLReplies1629833361000"; - } - async up(queryRunner) { - await queryRunner.query( - `ALTER TABLE "user" ADD "showTimelineReplies" boolean NOT NULL DEFAULT false`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "user"."showTimelineReplies" IS 'Whether to show users replying to other users in the timeline.'`, - ); - } - async down(queryRunner) { - await queryRunner.query( - `ALTER TABLE "user" DROP COLUMN "showTimelineReplies"`, - ); - } -} diff --git a/packages/backend/migration/1629968054000_userInstanceBlocks.js b/packages/backend/migration/1629968054000_userInstanceBlocks.js deleted file mode 100644 index 666aaba284..0000000000 --- a/packages/backend/migration/1629968054000_userInstanceBlocks.js +++ /dev/null @@ -1,18 +0,0 @@ -export class userInstanceBlocks1629968054000 { - constructor() { - this.name = "userInstanceBlocks1629968054000"; - } - async up(queryRunner) { - await queryRunner.query( - `ALTER TABLE "user_profile" ADD "mutedInstances" jsonb NOT NULL DEFAULT '[]'`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "user_profile"."mutedInstances" IS 'List of instances muted by the user.'`, - ); - } - async down(queryRunner) { - await queryRunner.query( - `ALTER TABLE "user_profile" DROP COLUMN "mutedInstances"`, - ); - } -} diff --git a/packages/backend/migration/1633068642000-email-required-for-signup.js b/packages/backend/migration/1633068642000-email-required-for-signup.js deleted file mode 100644 index 45c0894a75..0000000000 --- a/packages/backend/migration/1633068642000-email-required-for-signup.js +++ /dev/null @@ -1,15 +0,0 @@ -export class emailRequiredForSignup1633068642000 { - constructor() { - this.name = "emailRequiredForSignup1633068642000"; - } - async up(queryRunner) { - await queryRunner.query( - `ALTER TABLE "meta" ADD "emailRequiredForSignup" boolean NOT NULL DEFAULT false`, - ); - } - async down(queryRunner) { - await queryRunner.query( - `ALTER TABLE "meta" DROP COLUMN "emailRequiredForSignup"`, - ); - } -} diff --git a/packages/backend/migration/1633071909016-user-pending.js b/packages/backend/migration/1633071909016-user-pending.js deleted file mode 100644 index b37e51629d..0000000000 --- a/packages/backend/migration/1633071909016-user-pending.js +++ /dev/null @@ -1,17 +0,0 @@ -export class userPending1633071909016 { - constructor() { - this.name = "userPending1633071909016"; - } - async up(queryRunner) { - await queryRunner.query( - `CREATE TABLE "user_pending" ("id" character varying(32) NOT NULL, "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL, "code" character varying(128) NOT NULL, "username" character varying(128) NOT NULL, "email" character varying(128) NOT NULL, "password" character varying(128) NOT NULL, CONSTRAINT "PK_d4c84e013c98ec02d19b8fbbafa" PRIMARY KEY ("id"))`, - ); - await queryRunner.query( - `CREATE UNIQUE INDEX "IDX_4e5c4c99175638ec0761714ab0" ON "user_pending" ("code") `, - ); - } - async down(queryRunner) { - await queryRunner.query(`DROP INDEX "IDX_4e5c4c99175638ec0761714ab0"`); - await queryRunner.query(`DROP TABLE "user_pending"`); - } -} diff --git a/packages/backend/migration/1634486652000-user-public-reactions.js b/packages/backend/migration/1634486652000-user-public-reactions.js deleted file mode 100644 index 95b957f11c..0000000000 --- a/packages/backend/migration/1634486652000-user-public-reactions.js +++ /dev/null @@ -1,15 +0,0 @@ -export class userPublicReactions1634486652000 { - constructor() { - this.name = "userPublicReactions1634486652000"; - } - async up(queryRunner) { - await queryRunner.query( - `ALTER TABLE "user_profile" ADD "publicReactions" boolean NOT NULL DEFAULT false`, - ); - } - async down(queryRunner) { - await queryRunner.query( - `ALTER TABLE "user_profile" DROP COLUMN "publicReactions"`, - ); - } -} diff --git a/packages/backend/migration/1634902659689-delete-log.js b/packages/backend/migration/1634902659689-delete-log.js deleted file mode 100644 index fc148f0988..0000000000 --- a/packages/backend/migration/1634902659689-delete-log.js +++ /dev/null @@ -1,9 +0,0 @@ -export class deleteLog1634902659689 { - constructor() { - this.name = "deleteLog1634902659689"; - } - async up(queryRunner) { - await queryRunner.query(`DROP TABLE "log"`); - } - async down(queryRunner) {} -} diff --git a/packages/backend/migration/1635500777168-note-thread-mute.js b/packages/backend/migration/1635500777168-note-thread-mute.js deleted file mode 100644 index 5fcfa40c07..0000000000 --- a/packages/backend/migration/1635500777168-note-thread-mute.js +++ /dev/null @@ -1,47 +0,0 @@ -export class noteThreadMute1635500777168 { - constructor() { - this.name = "noteThreadMute1635500777168"; - } - async up(queryRunner) { - await queryRunner.query( - `CREATE TABLE "note_thread_muting" ("id" character varying(32) NOT NULL, "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL, "userId" character varying(32) NOT NULL, "threadId" character varying(256) NOT NULL, CONSTRAINT "PK_ec5936d94d1a0369646d12a3a47" PRIMARY KEY ("id"))`, - ); - await queryRunner.query( - `CREATE INDEX "IDX_29c11c7deb06615076f8c95b80" ON "note_thread_muting" ("userId") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_c426394644267453e76f036926" ON "note_thread_muting" ("threadId") `, - ); - await queryRunner.query( - `CREATE UNIQUE INDEX "IDX_ae7aab18a2641d3e5f25e0c4ea" ON "note_thread_muting" ("userId", "threadId") `, - ); - await queryRunner.query( - `ALTER TABLE "note" ADD "threadId" character varying(256)`, - ); - await queryRunner.query( - `CREATE INDEX "IDX_d4ebdef929896d6dc4a3c5bb48" ON "note" ("threadId") `, - ); - await queryRunner.query( - `ALTER TABLE "note_thread_muting" ADD CONSTRAINT "FK_29c11c7deb06615076f8c95b80a" FOREIGN KEY ("userId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, - ); - } - async down(queryRunner) { - await queryRunner.query( - `ALTER TABLE "note_thread_muting" DROP CONSTRAINT "FK_29c11c7deb06615076f8c95b80a"`, - ); - await queryRunner.query( - `DROP INDEX "public"."IDX_d4ebdef929896d6dc4a3c5bb48"`, - ); - await queryRunner.query(`ALTER TABLE "note" DROP COLUMN "threadId"`); - await queryRunner.query( - `DROP INDEX "public"."IDX_ae7aab18a2641d3e5f25e0c4ea"`, - ); - await queryRunner.query( - `DROP INDEX "public"."IDX_c426394644267453e76f036926"`, - ); - await queryRunner.query( - `DROP INDEX "public"."IDX_29c11c7deb06615076f8c95b80"`, - ); - await queryRunner.query(`DROP TABLE "note_thread_muting"`); - } -} diff --git a/packages/backend/migration/1636197624383-ff-visibility.js b/packages/backend/migration/1636197624383-ff-visibility.js deleted file mode 100644 index a3af8f7186..0000000000 --- a/packages/backend/migration/1636197624383-ff-visibility.js +++ /dev/null @@ -1,21 +0,0 @@ -export class ffVisibility1636197624383 { - constructor() { - this.name = "ffVisibility1636197624383"; - } - async up(queryRunner) { - await queryRunner.query( - `CREATE TYPE "public"."user_profile_ffvisibility_enum" AS ENUM('public', 'followers', 'private')`, - ); - await queryRunner.query( - `ALTER TABLE "user_profile" ADD "ffVisibility" "public"."user_profile_ffvisibility_enum" NOT NULL DEFAULT 'public'`, - ); - } - async down(queryRunner) { - await queryRunner.query( - `ALTER TABLE "user_profile" DROP COLUMN "ffVisibility"`, - ); - await queryRunner.query( - `DROP TYPE "public"."user_profile_ffvisibility_enum"`, - ); - } -} diff --git a/packages/backend/migration/1636697408073-remove-via-mobile.js b/packages/backend/migration/1636697408073-remove-via-mobile.js deleted file mode 100644 index f862760249..0000000000 --- a/packages/backend/migration/1636697408073-remove-via-mobile.js +++ /dev/null @@ -1,13 +0,0 @@ -export class removeViaMobile1636697408073 { - name = "removeViaMobile1636697408073"; - - async up(queryRunner) { - await queryRunner.query(`ALTER TABLE "note" DROP COLUMN "viaMobile"`); - } - - async down(queryRunner) { - await queryRunner.query( - `ALTER TABLE "note" ADD "viaMobile" boolean NOT NULL DEFAULT false`, - ); - } -} diff --git a/packages/backend/migration/1637320813000-forwarded-report.js b/packages/backend/migration/1637320813000-forwarded-report.js deleted file mode 100644 index 18ec172063..0000000000 --- a/packages/backend/migration/1637320813000-forwarded-report.js +++ /dev/null @@ -1,15 +0,0 @@ -export class forwardedReport1637320813000 { - name = "forwardedReport1637320813000"; - - async up(queryRunner) { - await queryRunner.query( - `ALTER TABLE "abuse_user_report" ADD "forwarded" boolean NOT NULL DEFAULT false`, - ); - } - - async down(queryRunner) { - await queryRunner.query( - `ALTER TABLE "abuse_user_report" DROP COLUMN "forwarded"`, - ); - } -} diff --git a/packages/backend/migration/1639325650583-chart-v3.js b/packages/backend/migration/1639325650583-chart-v3.js deleted file mode 100644 index 011708c0fe..0000000000 --- a/packages/backend/migration/1639325650583-chart-v3.js +++ /dev/null @@ -1,511 +0,0 @@ -export class chartV31639325650583 { - name = "chartV31639325650583"; - - async up(queryRunner) { - await queryRunner.query( - `DELETE FROM "__chart__per_user_drive" WHERE "group" IS NULL`, - ); - - await queryRunner.query( - `DROP INDEX "public"."IDX_dd907becf76104e4b656659e6b"`, - ); - await queryRunner.query( - `DROP INDEX "public"."IDX_eddfed8fb40305a04c6f941050"`, - ); - await queryRunner.query( - `DROP INDEX "public"."IDX_f09d543e3acb16c5976bdb31fa"`, - ); - await queryRunner.query( - `DROP INDEX "public"."IDX_e60c358aaced5aab8900a4af31"`, - ); - await queryRunner.query( - `DROP INDEX "public"."IDX_337e9599f278bd7537fe30876f"`, - ); - await queryRunner.query( - `DROP INDEX "public"."IDX_66feba81e1795d176d06c0b1e6"`, - ); - await queryRunner.query( - `DROP INDEX "public"."IDX_0a905b992fecd2b5c3fb98759e"`, - ); - await queryRunner.query( - `DROP INDEX "public"."IDX_2082327b2699ce924fa654afc5"`, - ); - await queryRunner.query( - `DROP INDEX "public"."IDX_9a3ed15a30ab7e3a37702e6e08"`, - ); - await queryRunner.query( - `DROP INDEX "public"."IDX_60c5c6e7e538c09aa274ecd1cf"`, - ); - await queryRunner.query( - `DROP INDEX "public"."IDX_8111b817b9818c04d7eb8475b1"`, - ); - await queryRunner.query( - `DROP INDEX "public"."IDX_583a157ed0cf0ed1b5ec2a833f"`, - ); - await queryRunner.query( - `DROP INDEX "public"."IDX_3313d7288855ec105b5bbf6c21"`, - ); - await queryRunner.query( - `DROP INDEX "public"."IDX_ceab80a6729f8e2e6f5b8a1a3d"`, - ); - await queryRunner.query( - `DROP INDEX "public"."IDX_3b7697a96f522d0478972e6d6f"`, - ); - await queryRunner.query( - `DROP INDEX "public"."IDX_53a3604b939e2b479eb2cfaac8"`, - ); - await queryRunner.query( - `DROP INDEX "public"."IDX_dabbb38a51ab86ee3cab291326"`, - ); - await queryRunner.query( - `DROP INDEX "public"."IDX_a9a806d466b314f253a1a611c4"`, - ); - await queryRunner.query( - `CREATE TABLE "__chart_day__federation" ("id" SERIAL NOT NULL, "date" integer NOT NULL, "___instance_total" bigint NOT NULL, "___instance_inc" bigint NOT NULL, "___instance_dec" bigint NOT NULL, CONSTRAINT "UQ_617a8fe225a6e701d89e02d2c74" UNIQUE ("date"), CONSTRAINT "PK_7ca721c769f31698e0e1331e8e6" PRIMARY KEY ("id"))`, - ); - await queryRunner.query( - `CREATE UNIQUE INDEX "IDX_617a8fe225a6e701d89e02d2c7" ON "__chart_day__federation" ("date") `, - ); - await queryRunner.query( - `CREATE TABLE "__chart_day__notes" ("id" SERIAL NOT NULL, "date" integer NOT NULL, "___local_total" bigint NOT NULL, "___local_inc" bigint NOT NULL, "___local_dec" bigint NOT NULL, "___local_diffs_normal" bigint NOT NULL, "___local_diffs_reply" bigint NOT NULL, "___local_diffs_renote" bigint NOT NULL, "___remote_total" bigint NOT NULL, "___remote_inc" bigint NOT NULL, "___remote_dec" bigint NOT NULL, "___remote_diffs_normal" bigint NOT NULL, "___remote_diffs_reply" bigint NOT NULL, "___remote_diffs_renote" bigint NOT NULL, CONSTRAINT "UQ_1a527b423ad0858a1af5a056d43" UNIQUE ("date"), CONSTRAINT "PK_1fa4139e1f338272b758d05e090" PRIMARY KEY ("id"))`, - ); - await queryRunner.query( - `CREATE UNIQUE INDEX "IDX_1a527b423ad0858a1af5a056d4" ON "__chart_day__notes" ("date") `, - ); - await queryRunner.query( - `CREATE TABLE "__chart_day__users" ("id" SERIAL NOT NULL, "date" integer NOT NULL, "___local_total" bigint NOT NULL, "___local_inc" bigint NOT NULL, "___local_dec" bigint NOT NULL, "___remote_total" bigint NOT NULL, "___remote_inc" bigint NOT NULL, "___remote_dec" bigint NOT NULL, CONSTRAINT "UQ_cad6e07c20037f31cdba8a350c3" UNIQUE ("date"), CONSTRAINT "PK_d7f7185abb9851f70c4726c54bd" PRIMARY KEY ("id"))`, - ); - await queryRunner.query( - `CREATE UNIQUE INDEX "IDX_cad6e07c20037f31cdba8a350c" ON "__chart_day__users" ("date") `, - ); - await queryRunner.query( - `CREATE TABLE "__chart_day__network" ("id" SERIAL NOT NULL, "date" integer NOT NULL, "___incomingRequests" bigint NOT NULL, "___outgoingRequests" bigint NOT NULL, "___totalTime" bigint NOT NULL, "___incomingBytes" bigint NOT NULL, "___outgoingBytes" bigint NOT NULL, CONSTRAINT "UQ_8bfa548c2b31f9e07db113773ee" UNIQUE ("date"), CONSTRAINT "PK_cac499d6f471042dfed1e7e0132" PRIMARY KEY ("id"))`, - ); - await queryRunner.query( - `CREATE UNIQUE INDEX "IDX_8bfa548c2b31f9e07db113773e" ON "__chart_day__network" ("date") `, - ); - await queryRunner.query( - `CREATE TABLE "__chart_day__active_users" ("id" SERIAL NOT NULL, "date" integer NOT NULL, "___local_users" character varying array NOT NULL, "___remote_users" character varying array NOT NULL, CONSTRAINT "UQ_d5954f3df5e5e3bdfc3c03f3906" UNIQUE ("date"), CONSTRAINT "PK_b1790489b14f005ae8f404f5795" PRIMARY KEY ("id"))`, - ); - await queryRunner.query( - `CREATE UNIQUE INDEX "IDX_d5954f3df5e5e3bdfc3c03f390" ON "__chart_day__active_users" ("date") `, - ); - await queryRunner.query( - `CREATE TABLE "__chart_day__instance" ("id" SERIAL NOT NULL, "date" integer NOT NULL, "group" character varying(128) NOT NULL, "___requests_failed" bigint NOT NULL, "___requests_succeeded" bigint NOT NULL, "___requests_received" bigint NOT NULL, "___notes_total" bigint NOT NULL, "___notes_inc" bigint NOT NULL, "___notes_dec" bigint NOT NULL, "___notes_diffs_normal" bigint NOT NULL, "___notes_diffs_reply" bigint NOT NULL, "___notes_diffs_renote" bigint NOT NULL, "___users_total" bigint NOT NULL, "___users_inc" bigint NOT NULL, "___users_dec" bigint NOT NULL, "___following_total" bigint NOT NULL, "___following_inc" bigint NOT NULL, "___following_dec" bigint NOT NULL, "___followers_total" bigint NOT NULL, "___followers_inc" bigint NOT NULL, "___followers_dec" bigint NOT NULL, "___drive_totalFiles" bigint NOT NULL, "___drive_totalUsage" bigint NOT NULL, "___drive_incFiles" bigint NOT NULL, "___drive_incUsage" bigint NOT NULL, "___drive_decFiles" bigint NOT NULL, "___drive_decUsage" bigint NOT NULL, CONSTRAINT "UQ_fea7c0278325a1a2492f2d6acbf" UNIQUE ("date", "group"), CONSTRAINT "PK_479a8ff9d959274981087043023" PRIMARY KEY ("id"))`, - ); - await queryRunner.query( - `CREATE UNIQUE INDEX "IDX_fea7c0278325a1a2492f2d6acb" ON "__chart_day__instance" ("date", "group") `, - ); - await queryRunner.query( - `CREATE TABLE "__chart_day__per_user_notes" ("id" SERIAL NOT NULL, "date" integer NOT NULL, "group" character varying(128) NOT NULL, "___total" bigint NOT NULL, "___inc" bigint NOT NULL, "___dec" bigint NOT NULL, "___diffs_normal" bigint NOT NULL, "___diffs_reply" bigint NOT NULL, "___diffs_renote" bigint NOT NULL, CONSTRAINT "UQ_c5545d4b31cdc684034e33b81c3" UNIQUE ("date", "group"), CONSTRAINT "PK_58bab6b6d3ad9310cbc7460fd28" PRIMARY KEY ("id"))`, - ); - await queryRunner.query( - `CREATE UNIQUE INDEX "IDX_c5545d4b31cdc684034e33b81c" ON "__chart_day__per_user_notes" ("date", "group") `, - ); - await queryRunner.query( - `CREATE TABLE "__chart_day__drive" ("id" SERIAL NOT NULL, "date" integer NOT NULL, "___local_totalCount" bigint NOT NULL, "___local_totalSize" bigint NOT NULL, "___local_incCount" bigint NOT NULL, "___local_incSize" bigint NOT NULL, "___local_decCount" bigint NOT NULL, "___local_decSize" bigint NOT NULL, "___remote_totalCount" bigint NOT NULL, "___remote_totalSize" bigint NOT NULL, "___remote_incCount" bigint NOT NULL, "___remote_incSize" bigint NOT NULL, "___remote_decCount" bigint NOT NULL, "___remote_decSize" bigint NOT NULL, CONSTRAINT "UQ_0b60ebb3aa0065f10b0616c1171" UNIQUE ("date"), CONSTRAINT "PK_e7ec0de057c77c40fc8d8b62151" PRIMARY KEY ("id"))`, - ); - await queryRunner.query( - `CREATE UNIQUE INDEX "IDX_0b60ebb3aa0065f10b0616c117" ON "__chart_day__drive" ("date") `, - ); - await queryRunner.query( - `CREATE TABLE "__chart_day__per_user_reaction" ("id" SERIAL NOT NULL, "date" integer NOT NULL, "group" character varying(128) NOT NULL, "___local_count" bigint NOT NULL, "___remote_count" bigint NOT NULL, CONSTRAINT "UQ_d54b653660d808b118e36c184c0" UNIQUE ("date", "group"), CONSTRAINT "PK_8af24e2d51ff781a354fe595eda" PRIMARY KEY ("id"))`, - ); - await queryRunner.query( - `CREATE UNIQUE INDEX "IDX_d54b653660d808b118e36c184c" ON "__chart_day__per_user_reaction" ("date", "group") `, - ); - await queryRunner.query( - `CREATE TABLE "__chart_day__hashtag" ("id" SERIAL NOT NULL, "date" integer NOT NULL, "group" character varying(128) NOT NULL, "___local_users" character varying array NOT NULL, "___remote_users" character varying array NOT NULL, CONSTRAINT "UQ_8f589cf056ff51f09d6096f6450" UNIQUE ("date", "group"), CONSTRAINT "PK_13d5a3b089344e5557f8e0980b4" PRIMARY KEY ("id"))`, - ); - await queryRunner.query( - `CREATE UNIQUE INDEX "IDX_8f589cf056ff51f09d6096f645" ON "__chart_day__hashtag" ("date", "group") `, - ); - await queryRunner.query( - `CREATE TABLE "__chart_day__per_user_following" ("id" SERIAL NOT NULL, "date" integer NOT NULL, "group" character varying(128) NOT NULL, "___local_followings_total" bigint NOT NULL, "___local_followings_inc" bigint NOT NULL, "___local_followings_dec" bigint NOT NULL, "___local_followers_total" bigint NOT NULL, "___local_followers_inc" bigint NOT NULL, "___local_followers_dec" bigint NOT NULL, "___remote_followings_total" bigint NOT NULL, "___remote_followings_inc" bigint NOT NULL, "___remote_followings_dec" bigint NOT NULL, "___remote_followers_total" bigint NOT NULL, "___remote_followers_inc" bigint NOT NULL, "___remote_followers_dec" bigint NOT NULL, CONSTRAINT "UQ_e4849a3231f38281280ea4c0eee" UNIQUE ("date", "group"), CONSTRAINT "PK_68ce6b67da57166da66fc8fb27e" PRIMARY KEY ("id"))`, - ); - await queryRunner.query( - `CREATE UNIQUE INDEX "IDX_e4849a3231f38281280ea4c0ee" ON "__chart_day__per_user_following" ("date", "group") `, - ); - await queryRunner.query( - `CREATE TABLE "__chart_day__per_user_drive" ("id" SERIAL NOT NULL, "date" integer NOT NULL, "group" character varying(128) NOT NULL, "___totalCount" bigint NOT NULL, "___totalSize" bigint NOT NULL, "___incCount" bigint NOT NULL, "___incSize" bigint NOT NULL, "___decCount" bigint NOT NULL, "___decSize" bigint NOT NULL, CONSTRAINT "UQ_62aa5047b5aec92524f24c701d7" UNIQUE ("date", "group"), CONSTRAINT "PK_1ae135254c137011645da7f4045" PRIMARY KEY ("id"))`, - ); - await queryRunner.query( - `CREATE UNIQUE INDEX "IDX_62aa5047b5aec92524f24c701d" ON "__chart_day__per_user_drive" ("date", "group") `, - ); - await queryRunner.query( - `ALTER TABLE "__chart__federation" DROP COLUMN "group"`, - ); - await queryRunner.query(`ALTER TABLE "__chart__notes" DROP COLUMN "group"`); - await queryRunner.query(`ALTER TABLE "__chart__users" DROP COLUMN "group"`); - await queryRunner.query( - `ALTER TABLE "__chart__network" DROP COLUMN "group"`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__active_users" DROP COLUMN "group"`, - ); - await queryRunner.query(`ALTER TABLE "__chart__drive" DROP COLUMN "group"`); - await queryRunner.query( - `ALTER TABLE "__chart__federation" ADD CONSTRAINT "UQ_36cb699c49580d4e6c2e6159f97" UNIQUE ("date")`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__notes" ADD CONSTRAINT "UQ_42eb716a37d381cdf566192b2be" UNIQUE ("date")`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__users" ADD CONSTRAINT "UQ_845254b3eaf708ae8a6cac30265" UNIQUE ("date")`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__network" ADD CONSTRAINT "UQ_a1efd3e0048a5f2793a47360dc6" UNIQUE ("date")`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__active_users" ADD CONSTRAINT "UQ_0ad37b7ef50f4ddc84363d7ccca" UNIQUE ("date")`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__active_users" ALTER COLUMN "___local_users" DROP DEFAULT`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__active_users" ALTER COLUMN "___remote_users" DROP DEFAULT`, - ); - await queryRunner.query( - `DROP INDEX "public"."IDX_39ee857ab2f23493037c6b6631"`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__instance" ALTER COLUMN "group" SET NOT NULL`, - ); - await queryRunner.query( - `DROP INDEX "public"."IDX_5048e9daccbbbc6d567bb142d3"`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__per_user_notes" ALTER COLUMN "group" SET NOT NULL`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__drive" ADD CONSTRAINT "UQ_13565815f618a1ff53886c5b28a" UNIQUE ("date")`, - ); - await queryRunner.query( - `DROP INDEX "public"."IDX_229a41ad465f9205f1f5703291"`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__per_user_reaction" ALTER COLUMN "group" SET NOT NULL`, - ); - await queryRunner.query( - `DROP INDEX "public"."IDX_25a97c02003338124b2b75fdbc"`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__hashtag" ALTER COLUMN "group" SET NOT NULL`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__hashtag" ALTER COLUMN "___local_users" DROP DEFAULT`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__hashtag" ALTER COLUMN "___remote_users" DROP DEFAULT`, - ); - await queryRunner.query( - `DROP INDEX "public"."IDX_b77d4dd9562c3a899d9a286fcd"`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__per_user_following" ALTER COLUMN "group" SET NOT NULL`, - ); - await queryRunner.query( - `DROP INDEX "public"."IDX_30bf67687f483ace115c5ca642"`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__per_user_drive" ALTER COLUMN "group" SET NOT NULL`, - ); - await queryRunner.query( - `CREATE UNIQUE INDEX "IDX_36cb699c49580d4e6c2e6159f9" ON "__chart__federation" ("date") `, - ); - await queryRunner.query( - `CREATE UNIQUE INDEX "IDX_42eb716a37d381cdf566192b2b" ON "__chart__notes" ("date") `, - ); - await queryRunner.query( - `CREATE UNIQUE INDEX "IDX_845254b3eaf708ae8a6cac3026" ON "__chart__users" ("date") `, - ); - await queryRunner.query( - `CREATE UNIQUE INDEX "IDX_a1efd3e0048a5f2793a47360dc" ON "__chart__network" ("date") `, - ); - await queryRunner.query( - `CREATE UNIQUE INDEX "IDX_0ad37b7ef50f4ddc84363d7ccc" ON "__chart__active_users" ("date") `, - ); - await queryRunner.query( - `CREATE UNIQUE INDEX "IDX_39ee857ab2f23493037c6b6631" ON "__chart__instance" ("date", "group") `, - ); - await queryRunner.query( - `CREATE UNIQUE INDEX "IDX_5048e9daccbbbc6d567bb142d3" ON "__chart__per_user_notes" ("date", "group") `, - ); - await queryRunner.query( - `CREATE UNIQUE INDEX "IDX_13565815f618a1ff53886c5b28" ON "__chart__drive" ("date") `, - ); - await queryRunner.query( - `CREATE UNIQUE INDEX "IDX_229a41ad465f9205f1f5703291" ON "__chart__per_user_reaction" ("date", "group") `, - ); - await queryRunner.query( - `CREATE UNIQUE INDEX "IDX_25a97c02003338124b2b75fdbc" ON "__chart__hashtag" ("date", "group") `, - ); - await queryRunner.query( - `CREATE UNIQUE INDEX "IDX_b77d4dd9562c3a899d9a286fcd" ON "__chart__per_user_following" ("date", "group") `, - ); - await queryRunner.query( - `CREATE UNIQUE INDEX "IDX_30bf67687f483ace115c5ca642" ON "__chart__per_user_drive" ("date", "group") `, - ); - await queryRunner.query( - `ALTER TABLE "__chart__instance" ADD CONSTRAINT "UQ_39ee857ab2f23493037c6b66311" UNIQUE ("date", "group")`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__per_user_notes" ADD CONSTRAINT "UQ_5048e9daccbbbc6d567bb142d34" UNIQUE ("date", "group")`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__per_user_reaction" ADD CONSTRAINT "UQ_229a41ad465f9205f1f57032910" UNIQUE ("date", "group")`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__hashtag" ADD CONSTRAINT "UQ_25a97c02003338124b2b75fdbc8" UNIQUE ("date", "group")`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__per_user_following" ADD CONSTRAINT "UQ_b77d4dd9562c3a899d9a286fcd7" UNIQUE ("date", "group")`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__per_user_drive" ADD CONSTRAINT "UQ_30bf67687f483ace115c5ca6429" UNIQUE ("date", "group")`, - ); - } - - async down(queryRunner) { - await queryRunner.query( - `ALTER TABLE "__chart__per_user_drive" DROP CONSTRAINT "UQ_30bf67687f483ace115c5ca6429"`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__per_user_following" DROP CONSTRAINT "UQ_b77d4dd9562c3a899d9a286fcd7"`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__hashtag" DROP CONSTRAINT "UQ_25a97c02003338124b2b75fdbc8"`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__per_user_reaction" DROP CONSTRAINT "UQ_229a41ad465f9205f1f57032910"`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__per_user_notes" DROP CONSTRAINT "UQ_5048e9daccbbbc6d567bb142d34"`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__instance" DROP CONSTRAINT "UQ_39ee857ab2f23493037c6b66311"`, - ); - await queryRunner.query( - `DROP INDEX "public"."IDX_30bf67687f483ace115c5ca642"`, - ); - await queryRunner.query( - `DROP INDEX "public"."IDX_b77d4dd9562c3a899d9a286fcd"`, - ); - await queryRunner.query( - `DROP INDEX "public"."IDX_25a97c02003338124b2b75fdbc"`, - ); - await queryRunner.query( - `DROP INDEX "public"."IDX_229a41ad465f9205f1f5703291"`, - ); - await queryRunner.query( - `DROP INDEX "public"."IDX_13565815f618a1ff53886c5b28"`, - ); - await queryRunner.query( - `DROP INDEX "public"."IDX_5048e9daccbbbc6d567bb142d3"`, - ); - await queryRunner.query( - `DROP INDEX "public"."IDX_39ee857ab2f23493037c6b6631"`, - ); - await queryRunner.query( - `DROP INDEX "public"."IDX_0ad37b7ef50f4ddc84363d7ccc"`, - ); - await queryRunner.query( - `DROP INDEX "public"."IDX_a1efd3e0048a5f2793a47360dc"`, - ); - await queryRunner.query( - `DROP INDEX "public"."IDX_845254b3eaf708ae8a6cac3026"`, - ); - await queryRunner.query( - `DROP INDEX "public"."IDX_42eb716a37d381cdf566192b2b"`, - ); - await queryRunner.query( - `DROP INDEX "public"."IDX_36cb699c49580d4e6c2e6159f9"`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__per_user_drive" ALTER COLUMN "group" DROP NOT NULL`, - ); - await queryRunner.query( - `CREATE UNIQUE INDEX "IDX_30bf67687f483ace115c5ca642" ON "__chart__per_user_drive" ("date", "group") `, - ); - await queryRunner.query( - `ALTER TABLE "__chart__per_user_following" ALTER COLUMN "group" DROP NOT NULL`, - ); - await queryRunner.query( - `CREATE UNIQUE INDEX "IDX_b77d4dd9562c3a899d9a286fcd" ON "__chart__per_user_following" ("date", "group") `, - ); - await queryRunner.query( - `ALTER TABLE "__chart__hashtag" ALTER COLUMN "___remote_users" SET DEFAULT '{}'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__hashtag" ALTER COLUMN "___local_users" SET DEFAULT '{}'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__hashtag" ALTER COLUMN "group" DROP NOT NULL`, - ); - await queryRunner.query( - `CREATE UNIQUE INDEX "IDX_25a97c02003338124b2b75fdbc" ON "__chart__hashtag" ("date", "group") `, - ); - await queryRunner.query( - `ALTER TABLE "__chart__per_user_reaction" ALTER COLUMN "group" DROP NOT NULL`, - ); - await queryRunner.query( - `CREATE UNIQUE INDEX "IDX_229a41ad465f9205f1f5703291" ON "__chart__per_user_reaction" ("date", "group") `, - ); - await queryRunner.query( - `ALTER TABLE "__chart__drive" DROP CONSTRAINT "UQ_13565815f618a1ff53886c5b28a"`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__per_user_notes" ALTER COLUMN "group" DROP NOT NULL`, - ); - await queryRunner.query( - `CREATE UNIQUE INDEX "IDX_5048e9daccbbbc6d567bb142d3" ON "__chart__per_user_notes" ("date", "group") `, - ); - await queryRunner.query( - `ALTER TABLE "__chart__instance" ALTER COLUMN "group" DROP NOT NULL`, - ); - await queryRunner.query( - `CREATE UNIQUE INDEX "IDX_39ee857ab2f23493037c6b6631" ON "__chart__instance" ("date", "group") `, - ); - await queryRunner.query( - `ALTER TABLE "__chart__active_users" ALTER COLUMN "___remote_users" SET DEFAULT '{}'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__active_users" ALTER COLUMN "___local_users" SET DEFAULT '{}'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__active_users" DROP CONSTRAINT "UQ_0ad37b7ef50f4ddc84363d7ccca"`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__network" DROP CONSTRAINT "UQ_a1efd3e0048a5f2793a47360dc6"`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__users" DROP CONSTRAINT "UQ_845254b3eaf708ae8a6cac30265"`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__notes" DROP CONSTRAINT "UQ_42eb716a37d381cdf566192b2be"`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__federation" DROP CONSTRAINT "UQ_36cb699c49580d4e6c2e6159f97"`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__drive" ADD "group" character varying(128)`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__active_users" ADD "group" character varying(128)`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__network" ADD "group" character varying(128)`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__users" ADD "group" character varying(128)`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__notes" ADD "group" character varying(128)`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__federation" ADD "group" character varying(128)`, - ); - await queryRunner.query( - `DROP INDEX "public"."IDX_62aa5047b5aec92524f24c701d"`, - ); - await queryRunner.query(`DROP TABLE "__chart_day__per_user_drive"`); - await queryRunner.query( - `DROP INDEX "public"."IDX_e4849a3231f38281280ea4c0ee"`, - ); - await queryRunner.query(`DROP TABLE "__chart_day__per_user_following"`); - await queryRunner.query( - `DROP INDEX "public"."IDX_8f589cf056ff51f09d6096f645"`, - ); - await queryRunner.query(`DROP TABLE "__chart_day__hashtag"`); - await queryRunner.query( - `DROP INDEX "public"."IDX_d54b653660d808b118e36c184c"`, - ); - await queryRunner.query(`DROP TABLE "__chart_day__per_user_reaction"`); - await queryRunner.query( - `DROP INDEX "public"."IDX_0b60ebb3aa0065f10b0616c117"`, - ); - await queryRunner.query(`DROP TABLE "__chart_day__drive"`); - await queryRunner.query( - `DROP INDEX "public"."IDX_c5545d4b31cdc684034e33b81c"`, - ); - await queryRunner.query(`DROP TABLE "__chart_day__per_user_notes"`); - await queryRunner.query( - `DROP INDEX "public"."IDX_fea7c0278325a1a2492f2d6acb"`, - ); - await queryRunner.query(`DROP TABLE "__chart_day__instance"`); - await queryRunner.query( - `DROP INDEX "public"."IDX_d5954f3df5e5e3bdfc3c03f390"`, - ); - await queryRunner.query(`DROP TABLE "__chart_day__active_users"`); - await queryRunner.query( - `DROP INDEX "public"."IDX_8bfa548c2b31f9e07db113773e"`, - ); - await queryRunner.query(`DROP TABLE "__chart_day__network"`); - await queryRunner.query( - `DROP INDEX "public"."IDX_cad6e07c20037f31cdba8a350c"`, - ); - await queryRunner.query(`DROP TABLE "__chart_day__users"`); - await queryRunner.query( - `DROP INDEX "public"."IDX_1a527b423ad0858a1af5a056d4"`, - ); - await queryRunner.query(`DROP TABLE "__chart_day__notes"`); - await queryRunner.query( - `DROP INDEX "public"."IDX_617a8fe225a6e701d89e02d2c7"`, - ); - await queryRunner.query(`DROP TABLE "__chart_day__federation"`); - await queryRunner.query( - `CREATE UNIQUE INDEX "IDX_a9a806d466b314f253a1a611c4" ON "__chart__per_user_drive" ("date") WHERE ("group" IS NULL)`, - ); - await queryRunner.query( - `CREATE UNIQUE INDEX "IDX_dabbb38a51ab86ee3cab291326" ON "__chart__per_user_following" ("date") WHERE ("group" IS NULL)`, - ); - await queryRunner.query( - `CREATE UNIQUE INDEX "IDX_53a3604b939e2b479eb2cfaac8" ON "__chart__hashtag" ("date") WHERE ("group" IS NULL)`, - ); - await queryRunner.query( - `CREATE UNIQUE INDEX "IDX_3b7697a96f522d0478972e6d6f" ON "__chart__per_user_reaction" ("date") WHERE ("group" IS NULL)`, - ); - await queryRunner.query( - `CREATE UNIQUE INDEX "IDX_ceab80a6729f8e2e6f5b8a1a3d" ON "__chart__drive" ("date") WHERE ("group" IS NULL)`, - ); - await queryRunner.query( - `CREATE UNIQUE INDEX "IDX_3313d7288855ec105b5bbf6c21" ON "__chart__drive" ("date", "group") `, - ); - await queryRunner.query( - `CREATE UNIQUE INDEX "IDX_583a157ed0cf0ed1b5ec2a833f" ON "__chart__per_user_notes" ("date") WHERE ("group" IS NULL)`, - ); - await queryRunner.query( - `CREATE UNIQUE INDEX "IDX_8111b817b9818c04d7eb8475b1" ON "__chart__instance" ("date") WHERE ("group" IS NULL)`, - ); - await queryRunner.query( - `CREATE UNIQUE INDEX "IDX_60c5c6e7e538c09aa274ecd1cf" ON "__chart__active_users" ("date") WHERE ("group" IS NULL)`, - ); - await queryRunner.query( - `CREATE UNIQUE INDEX "IDX_9a3ed15a30ab7e3a37702e6e08" ON "__chart__active_users" ("date", "group") `, - ); - await queryRunner.query( - `CREATE UNIQUE INDEX "IDX_2082327b2699ce924fa654afc5" ON "__chart__network" ("date") WHERE ("group" IS NULL)`, - ); - await queryRunner.query( - `CREATE UNIQUE INDEX "IDX_0a905b992fecd2b5c3fb98759e" ON "__chart__network" ("date", "group") `, - ); - await queryRunner.query( - `CREATE UNIQUE INDEX "IDX_66feba81e1795d176d06c0b1e6" ON "__chart__users" ("date") WHERE ("group" IS NULL)`, - ); - await queryRunner.query( - `CREATE UNIQUE INDEX "IDX_337e9599f278bd7537fe30876f" ON "__chart__users" ("date", "group") `, - ); - await queryRunner.query( - `CREATE UNIQUE INDEX "IDX_e60c358aaced5aab8900a4af31" ON "__chart__notes" ("date") WHERE ("group" IS NULL)`, - ); - await queryRunner.query( - `CREATE UNIQUE INDEX "IDX_f09d543e3acb16c5976bdb31fa" ON "__chart__notes" ("date", "group") `, - ); - await queryRunner.query( - `CREATE UNIQUE INDEX "IDX_eddfed8fb40305a04c6f941050" ON "__chart__federation" ("date") WHERE ("group" IS NULL)`, - ); - await queryRunner.query( - `CREATE UNIQUE INDEX "IDX_dd907becf76104e4b656659e6b" ON "__chart__federation" ("date", "group") `, - ); - } -} diff --git a/packages/backend/migration/1642611822809-emoji-url.js b/packages/backend/migration/1642611822809-emoji-url.js deleted file mode 100644 index e1852c0025..0000000000 --- a/packages/backend/migration/1642611822809-emoji-url.js +++ /dev/null @@ -1,19 +0,0 @@ -export class emojiUrl1642611822809 { - name = "emojiUrl1642611822809"; - - async up(queryRunner) { - await queryRunner.query( - `ALTER TABLE "emoji" RENAME COLUMN "url" TO "originalUrl"`, - ); - await queryRunner.query( - `ALTER TABLE "emoji" ADD "publicUrl" character varying(512) NOT NULL DEFAULT ''`, - ); - } - - async down(queryRunner) { - await queryRunner.query(`ALTER TABLE "emoji" DROP COLUMN "publicUrl"`); - await queryRunner.query( - `ALTER TABLE "emoji" RENAME COLUMN "originalUrl" TO "url"`, - ); - } -} diff --git a/packages/backend/migration/1642613870898-drive-file-webpublic-type.js b/packages/backend/migration/1642613870898-drive-file-webpublic-type.js deleted file mode 100644 index df5ab7899b..0000000000 --- a/packages/backend/migration/1642613870898-drive-file-webpublic-type.js +++ /dev/null @@ -1,15 +0,0 @@ -export class driveFileWebpublicType1642613870898 { - name = "driveFileWebpublicType1642613870898"; - - async up(queryRunner) { - await queryRunner.query( - `ALTER TABLE "drive_file" ADD "webpublicType" character varying(128)`, - ); - } - - async down(queryRunner) { - await queryRunner.query( - `ALTER TABLE "drive_file" DROP COLUMN "webpublicType"`, - ); - } -} diff --git a/packages/backend/migration/1643963705770-chart-v4.js b/packages/backend/migration/1643963705770-chart-v4.js deleted file mode 100644 index 1e7233cc72..0000000000 --- a/packages/backend/migration/1643963705770-chart-v4.js +++ /dev/null @@ -1,165 +0,0 @@ -export class chartV41643963705770 { - name = "chartV41643963705770"; - - async up(queryRunner) { - await queryRunner.query( - `ALTER TABLE "__chart__instance" DROP COLUMN "___drive_totalUsage"`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__instance" DROP COLUMN "___drive_totalUsage"`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__drive" DROP COLUMN "___local_totalCount"`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__drive" DROP COLUMN "___local_totalSize"`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__drive" DROP COLUMN "___remote_totalCount"`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__drive" DROP COLUMN "___remote_totalSize"`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__drive" DROP COLUMN "___local_totalCount"`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__drive" DROP COLUMN "___local_totalSize"`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__drive" DROP COLUMN "___remote_totalCount"`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__drive" DROP COLUMN "___remote_totalSize"`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__active_users" DROP COLUMN "___local_users"`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__active_users" ADD "___local_users" bigint NOT NULL DEFAULT 0`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__active_users" DROP COLUMN "___remote_users"`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__active_users" ADD "___remote_users" bigint NOT NULL DEFAULT 0`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__active_users" DROP COLUMN "___local_users"`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__active_users" ADD "___local_users" bigint NOT NULL DEFAULT 0`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__active_users" DROP COLUMN "___remote_users"`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__active_users" ADD "___remote_users" bigint NOT NULL DEFAULT 0`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__hashtag" DROP COLUMN "___local_users"`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__hashtag" ADD "___local_users" bigint NOT NULL DEFAULT 0`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__hashtag" DROP COLUMN "___remote_users"`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__hashtag" ADD "___remote_users" bigint NOT NULL DEFAULT 0`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__hashtag" DROP COLUMN "___local_users"`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__hashtag" ADD "___local_users" bigint NOT NULL DEFAULT 0`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__hashtag" DROP COLUMN "___remote_users"`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__hashtag" ADD "___remote_users" bigint NOT NULL DEFAULT 0`, - ); - } - - async down(queryRunner) { - await queryRunner.query( - `ALTER TABLE "__chart_day__hashtag" DROP COLUMN "___remote_users"`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__hashtag" ADD "___remote_users" character varying array NOT NULL`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__hashtag" DROP COLUMN "___local_users"`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__hashtag" ADD "___local_users" character varying array NOT NULL`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__hashtag" DROP COLUMN "___remote_users"`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__hashtag" ADD "___remote_users" character varying array NOT NULL`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__hashtag" DROP COLUMN "___local_users"`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__hashtag" ADD "___local_users" character varying array NOT NULL`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__active_users" DROP COLUMN "___remote_users"`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__active_users" ADD "___remote_users" character varying array NOT NULL`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__active_users" DROP COLUMN "___local_users"`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__active_users" ADD "___local_users" character varying array NOT NULL`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__active_users" DROP COLUMN "___remote_users"`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__active_users" ADD "___remote_users" character varying array NOT NULL`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__active_users" DROP COLUMN "___local_users"`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__active_users" ADD "___local_users" character varying array NOT NULL`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__drive" ADD "___remote_totalSize" bigint NOT NULL`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__drive" ADD "___remote_totalCount" bigint NOT NULL`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__drive" ADD "___local_totalSize" bigint NOT NULL`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__drive" ADD "___local_totalCount" bigint NOT NULL`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__drive" ADD "___remote_totalSize" bigint NOT NULL`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__drive" ADD "___remote_totalCount" bigint NOT NULL`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__drive" ADD "___local_totalSize" bigint NOT NULL`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__drive" ADD "___local_totalCount" bigint NOT NULL`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__instance" ADD "___drive_totalUsage" bigint NOT NULL`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__instance" ADD "___drive_totalUsage" bigint NOT NULL`, - ); - } -} diff --git a/packages/backend/migration/1643966656277-chart-v5.js b/packages/backend/migration/1643966656277-chart-v5.js deleted file mode 100644 index 826f28ee34..0000000000 --- a/packages/backend/migration/1643966656277-chart-v5.js +++ /dev/null @@ -1,57 +0,0 @@ -export class chartV51643966656277 { - name = "chartV51643966656277"; - - async up(queryRunner) { - await queryRunner.query( - `ALTER TABLE "__chart__active_users" ADD "unique_temp___local_users" character varying array NOT NULL DEFAULT '{}'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__active_users" ADD "unique_temp___remote_users" character varying array NOT NULL DEFAULT '{}'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__active_users" ADD "unique_temp___local_users" character varying array NOT NULL DEFAULT '{}'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__active_users" ADD "unique_temp___remote_users" character varying array NOT NULL DEFAULT '{}'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__hashtag" ADD "unique_temp___local_users" character varying array NOT NULL DEFAULT '{}'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__hashtag" ADD "unique_temp___remote_users" character varying array NOT NULL DEFAULT '{}'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__hashtag" ADD "unique_temp___local_users" character varying array NOT NULL DEFAULT '{}'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__hashtag" ADD "unique_temp___remote_users" character varying array NOT NULL DEFAULT '{}'`, - ); - } - - async down(queryRunner) { - await queryRunner.query( - `ALTER TABLE "__chart_day__hashtag" DROP COLUMN "unique_temp___remote_users"`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__hashtag" DROP COLUMN "unique_temp___local_users"`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__hashtag" DROP COLUMN "unique_temp___remote_users"`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__hashtag" DROP COLUMN "unique_temp___local_users"`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__active_users" DROP COLUMN "unique_temp___remote_users"`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__active_users" DROP COLUMN "unique_temp___local_users"`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__active_users" DROP COLUMN "unique_temp___remote_users"`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__active_users" DROP COLUMN "unique_temp___local_users"`, - ); - } -} diff --git a/packages/backend/migration/1643967331284-chart-v6.js b/packages/backend/migration/1643967331284-chart-v6.js deleted file mode 100644 index 9dfbf24bec..0000000000 --- a/packages/backend/migration/1643967331284-chart-v6.js +++ /dev/null @@ -1,1005 +0,0 @@ -export class chartV61643967331284 { - name = "chartV61643967331284"; - - async up(queryRunner) { - await queryRunner.query( - `ALTER TABLE "__chart__federation" ALTER COLUMN "___instance_total" SET DEFAULT '0'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__federation" ALTER COLUMN "___instance_inc" SET DEFAULT '0'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__federation" ALTER COLUMN "___instance_dec" SET DEFAULT '0'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__federation" ALTER COLUMN "___instance_total" SET DEFAULT '0'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__federation" ALTER COLUMN "___instance_inc" SET DEFAULT '0'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__federation" ALTER COLUMN "___instance_dec" SET DEFAULT '0'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__notes" ALTER COLUMN "___local_total" SET DEFAULT '0'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__notes" ALTER COLUMN "___local_inc" SET DEFAULT '0'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__notes" ALTER COLUMN "___local_dec" SET DEFAULT '0'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__notes" ALTER COLUMN "___local_diffs_normal" SET DEFAULT '0'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__notes" ALTER COLUMN "___local_diffs_reply" SET DEFAULT '0'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__notes" ALTER COLUMN "___local_diffs_renote" SET DEFAULT '0'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__notes" ALTER COLUMN "___remote_total" SET DEFAULT '0'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__notes" ALTER COLUMN "___remote_inc" SET DEFAULT '0'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__notes" ALTER COLUMN "___remote_dec" SET DEFAULT '0'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__notes" ALTER COLUMN "___remote_diffs_normal" SET DEFAULT '0'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__notes" ALTER COLUMN "___remote_diffs_reply" SET DEFAULT '0'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__notes" ALTER COLUMN "___remote_diffs_renote" SET DEFAULT '0'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__notes" ALTER COLUMN "___local_total" SET DEFAULT '0'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__notes" ALTER COLUMN "___local_inc" SET DEFAULT '0'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__notes" ALTER COLUMN "___local_dec" SET DEFAULT '0'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__notes" ALTER COLUMN "___local_diffs_normal" SET DEFAULT '0'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__notes" ALTER COLUMN "___local_diffs_reply" SET DEFAULT '0'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__notes" ALTER COLUMN "___local_diffs_renote" SET DEFAULT '0'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__notes" ALTER COLUMN "___remote_total" SET DEFAULT '0'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__notes" ALTER COLUMN "___remote_inc" SET DEFAULT '0'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__notes" ALTER COLUMN "___remote_dec" SET DEFAULT '0'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__notes" ALTER COLUMN "___remote_diffs_normal" SET DEFAULT '0'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__notes" ALTER COLUMN "___remote_diffs_reply" SET DEFAULT '0'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__notes" ALTER COLUMN "___remote_diffs_renote" SET DEFAULT '0'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__users" ALTER COLUMN "___local_total" SET DEFAULT '0'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__users" ALTER COLUMN "___local_inc" SET DEFAULT '0'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__users" ALTER COLUMN "___local_dec" SET DEFAULT '0'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__users" ALTER COLUMN "___remote_total" SET DEFAULT '0'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__users" ALTER COLUMN "___remote_inc" SET DEFAULT '0'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__users" ALTER COLUMN "___remote_dec" SET DEFAULT '0'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__users" ALTER COLUMN "___local_total" SET DEFAULT '0'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__users" ALTER COLUMN "___local_inc" SET DEFAULT '0'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__users" ALTER COLUMN "___local_dec" SET DEFAULT '0'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__users" ALTER COLUMN "___remote_total" SET DEFAULT '0'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__users" ALTER COLUMN "___remote_inc" SET DEFAULT '0'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__users" ALTER COLUMN "___remote_dec" SET DEFAULT '0'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__network" ALTER COLUMN "___incomingRequests" SET DEFAULT '0'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__network" ALTER COLUMN "___outgoingRequests" SET DEFAULT '0'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__network" ALTER COLUMN "___totalTime" SET DEFAULT '0'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__network" ALTER COLUMN "___incomingBytes" SET DEFAULT '0'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__network" ALTER COLUMN "___outgoingBytes" SET DEFAULT '0'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__network" ALTER COLUMN "___incomingRequests" SET DEFAULT '0'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__network" ALTER COLUMN "___outgoingRequests" SET DEFAULT '0'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__network" ALTER COLUMN "___totalTime" SET DEFAULT '0'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__network" ALTER COLUMN "___incomingBytes" SET DEFAULT '0'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__network" ALTER COLUMN "___outgoingBytes" SET DEFAULT '0'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__instance" ALTER COLUMN "___requests_failed" SET DEFAULT '0'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__instance" ALTER COLUMN "___requests_succeeded" SET DEFAULT '0'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__instance" ALTER COLUMN "___requests_received" SET DEFAULT '0'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__instance" ALTER COLUMN "___notes_total" SET DEFAULT '0'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__instance" ALTER COLUMN "___notes_inc" SET DEFAULT '0'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__instance" ALTER COLUMN "___notes_dec" SET DEFAULT '0'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__instance" ALTER COLUMN "___notes_diffs_normal" SET DEFAULT '0'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__instance" ALTER COLUMN "___notes_diffs_reply" SET DEFAULT '0'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__instance" ALTER COLUMN "___notes_diffs_renote" SET DEFAULT '0'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__instance" ALTER COLUMN "___users_total" SET DEFAULT '0'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__instance" ALTER COLUMN "___users_inc" SET DEFAULT '0'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__instance" ALTER COLUMN "___users_dec" SET DEFAULT '0'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__instance" ALTER COLUMN "___following_total" SET DEFAULT '0'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__instance" ALTER COLUMN "___following_inc" SET DEFAULT '0'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__instance" ALTER COLUMN "___following_dec" SET DEFAULT '0'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__instance" ALTER COLUMN "___followers_total" SET DEFAULT '0'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__instance" ALTER COLUMN "___followers_inc" SET DEFAULT '0'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__instance" ALTER COLUMN "___followers_dec" SET DEFAULT '0'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__instance" ALTER COLUMN "___drive_totalFiles" SET DEFAULT '0'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__instance" ALTER COLUMN "___drive_incFiles" SET DEFAULT '0'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__instance" ALTER COLUMN "___drive_decFiles" SET DEFAULT '0'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__instance" ALTER COLUMN "___drive_incUsage" SET DEFAULT '0'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__instance" ALTER COLUMN "___drive_decUsage" SET DEFAULT '0'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__instance" ALTER COLUMN "___requests_failed" SET DEFAULT '0'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__instance" ALTER COLUMN "___requests_succeeded" SET DEFAULT '0'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__instance" ALTER COLUMN "___requests_received" SET DEFAULT '0'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__instance" ALTER COLUMN "___notes_total" SET DEFAULT '0'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__instance" ALTER COLUMN "___notes_inc" SET DEFAULT '0'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__instance" ALTER COLUMN "___notes_dec" SET DEFAULT '0'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__instance" ALTER COLUMN "___notes_diffs_normal" SET DEFAULT '0'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__instance" ALTER COLUMN "___notes_diffs_reply" SET DEFAULT '0'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__instance" ALTER COLUMN "___notes_diffs_renote" SET DEFAULT '0'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__instance" ALTER COLUMN "___users_total" SET DEFAULT '0'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__instance" ALTER COLUMN "___users_inc" SET DEFAULT '0'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__instance" ALTER COLUMN "___users_dec" SET DEFAULT '0'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__instance" ALTER COLUMN "___following_total" SET DEFAULT '0'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__instance" ALTER COLUMN "___following_inc" SET DEFAULT '0'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__instance" ALTER COLUMN "___following_dec" SET DEFAULT '0'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__instance" ALTER COLUMN "___followers_total" SET DEFAULT '0'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__instance" ALTER COLUMN "___followers_inc" SET DEFAULT '0'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__instance" ALTER COLUMN "___followers_dec" SET DEFAULT '0'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__instance" ALTER COLUMN "___drive_totalFiles" SET DEFAULT '0'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__instance" ALTER COLUMN "___drive_incFiles" SET DEFAULT '0'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__instance" ALTER COLUMN "___drive_decFiles" SET DEFAULT '0'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__instance" ALTER COLUMN "___drive_incUsage" SET DEFAULT '0'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__instance" ALTER COLUMN "___drive_decUsage" SET DEFAULT '0'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__per_user_notes" ALTER COLUMN "___total" SET DEFAULT '0'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__per_user_notes" ALTER COLUMN "___inc" SET DEFAULT '0'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__per_user_notes" ALTER COLUMN "___dec" SET DEFAULT '0'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__per_user_notes" ALTER COLUMN "___diffs_normal" SET DEFAULT '0'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__per_user_notes" ALTER COLUMN "___diffs_reply" SET DEFAULT '0'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__per_user_notes" ALTER COLUMN "___diffs_renote" SET DEFAULT '0'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__per_user_notes" ALTER COLUMN "___total" SET DEFAULT '0'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__per_user_notes" ALTER COLUMN "___inc" SET DEFAULT '0'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__per_user_notes" ALTER COLUMN "___dec" SET DEFAULT '0'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__per_user_notes" ALTER COLUMN "___diffs_normal" SET DEFAULT '0'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__per_user_notes" ALTER COLUMN "___diffs_reply" SET DEFAULT '0'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__per_user_notes" ALTER COLUMN "___diffs_renote" SET DEFAULT '0'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__drive" ALTER COLUMN "___local_incCount" SET DEFAULT '0'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__drive" ALTER COLUMN "___local_incSize" SET DEFAULT '0'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__drive" ALTER COLUMN "___local_decCount" SET DEFAULT '0'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__drive" ALTER COLUMN "___local_decSize" SET DEFAULT '0'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__drive" ALTER COLUMN "___remote_incCount" SET DEFAULT '0'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__drive" ALTER COLUMN "___remote_incSize" SET DEFAULT '0'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__drive" ALTER COLUMN "___remote_decCount" SET DEFAULT '0'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__drive" ALTER COLUMN "___remote_decSize" SET DEFAULT '0'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__drive" ALTER COLUMN "___local_incCount" SET DEFAULT '0'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__drive" ALTER COLUMN "___local_incSize" SET DEFAULT '0'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__drive" ALTER COLUMN "___local_decCount" SET DEFAULT '0'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__drive" ALTER COLUMN "___local_decSize" SET DEFAULT '0'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__drive" ALTER COLUMN "___remote_incCount" SET DEFAULT '0'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__drive" ALTER COLUMN "___remote_incSize" SET DEFAULT '0'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__drive" ALTER COLUMN "___remote_decCount" SET DEFAULT '0'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__drive" ALTER COLUMN "___remote_decSize" SET DEFAULT '0'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__per_user_reaction" ALTER COLUMN "___local_count" SET DEFAULT '0'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__per_user_reaction" ALTER COLUMN "___remote_count" SET DEFAULT '0'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__per_user_reaction" ALTER COLUMN "___local_count" SET DEFAULT '0'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__per_user_reaction" ALTER COLUMN "___remote_count" SET DEFAULT '0'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__per_user_following" ALTER COLUMN "___local_followings_total" SET DEFAULT '0'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__per_user_following" ALTER COLUMN "___local_followings_inc" SET DEFAULT '0'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__per_user_following" ALTER COLUMN "___local_followings_dec" SET DEFAULT '0'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__per_user_following" ALTER COLUMN "___local_followers_total" SET DEFAULT '0'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__per_user_following" ALTER COLUMN "___local_followers_inc" SET DEFAULT '0'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__per_user_following" ALTER COLUMN "___local_followers_dec" SET DEFAULT '0'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__per_user_following" ALTER COLUMN "___remote_followings_total" SET DEFAULT '0'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__per_user_following" ALTER COLUMN "___remote_followings_inc" SET DEFAULT '0'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__per_user_following" ALTER COLUMN "___remote_followings_dec" SET DEFAULT '0'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__per_user_following" ALTER COLUMN "___remote_followers_total" SET DEFAULT '0'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__per_user_following" ALTER COLUMN "___remote_followers_inc" SET DEFAULT '0'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__per_user_following" ALTER COLUMN "___remote_followers_dec" SET DEFAULT '0'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__per_user_following" ALTER COLUMN "___local_followings_total" SET DEFAULT '0'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__per_user_following" ALTER COLUMN "___local_followings_inc" SET DEFAULT '0'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__per_user_following" ALTER COLUMN "___local_followings_dec" SET DEFAULT '0'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__per_user_following" ALTER COLUMN "___local_followers_total" SET DEFAULT '0'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__per_user_following" ALTER COLUMN "___local_followers_inc" SET DEFAULT '0'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__per_user_following" ALTER COLUMN "___local_followers_dec" SET DEFAULT '0'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__per_user_following" ALTER COLUMN "___remote_followings_total" SET DEFAULT '0'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__per_user_following" ALTER COLUMN "___remote_followings_inc" SET DEFAULT '0'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__per_user_following" ALTER COLUMN "___remote_followings_dec" SET DEFAULT '0'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__per_user_following" ALTER COLUMN "___remote_followers_total" SET DEFAULT '0'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__per_user_following" ALTER COLUMN "___remote_followers_inc" SET DEFAULT '0'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__per_user_following" ALTER COLUMN "___remote_followers_dec" SET DEFAULT '0'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__per_user_drive" ALTER COLUMN "___totalCount" SET DEFAULT '0'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__per_user_drive" ALTER COLUMN "___totalSize" SET DEFAULT '0'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__per_user_drive" ALTER COLUMN "___incCount" SET DEFAULT '0'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__per_user_drive" ALTER COLUMN "___incSize" SET DEFAULT '0'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__per_user_drive" ALTER COLUMN "___decCount" SET DEFAULT '0'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__per_user_drive" ALTER COLUMN "___decSize" SET DEFAULT '0'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__per_user_drive" ALTER COLUMN "___totalCount" SET DEFAULT '0'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__per_user_drive" ALTER COLUMN "___totalSize" SET DEFAULT '0'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__per_user_drive" ALTER COLUMN "___incCount" SET DEFAULT '0'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__per_user_drive" ALTER COLUMN "___incSize" SET DEFAULT '0'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__per_user_drive" ALTER COLUMN "___decCount" SET DEFAULT '0'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__per_user_drive" ALTER COLUMN "___decSize" SET DEFAULT '0'`, - ); - } - - async down(queryRunner) { - await queryRunner.query( - `ALTER TABLE "__chart_day__per_user_drive" ALTER COLUMN "___decSize" DROP DEFAULT`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__per_user_drive" ALTER COLUMN "___decCount" DROP DEFAULT`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__per_user_drive" ALTER COLUMN "___incSize" DROP DEFAULT`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__per_user_drive" ALTER COLUMN "___incCount" DROP DEFAULT`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__per_user_drive" ALTER COLUMN "___totalSize" DROP DEFAULT`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__per_user_drive" ALTER COLUMN "___totalCount" DROP DEFAULT`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__per_user_drive" ALTER COLUMN "___decSize" DROP DEFAULT`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__per_user_drive" ALTER COLUMN "___decCount" DROP DEFAULT`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__per_user_drive" ALTER COLUMN "___incSize" DROP DEFAULT`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__per_user_drive" ALTER COLUMN "___incCount" DROP DEFAULT`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__per_user_drive" ALTER COLUMN "___totalSize" DROP DEFAULT`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__per_user_drive" ALTER COLUMN "___totalCount" DROP DEFAULT`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__per_user_following" ALTER COLUMN "___remote_followers_dec" DROP DEFAULT`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__per_user_following" ALTER COLUMN "___remote_followers_inc" DROP DEFAULT`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__per_user_following" ALTER COLUMN "___remote_followers_total" DROP DEFAULT`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__per_user_following" ALTER COLUMN "___remote_followings_dec" DROP DEFAULT`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__per_user_following" ALTER COLUMN "___remote_followings_inc" DROP DEFAULT`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__per_user_following" ALTER COLUMN "___remote_followings_total" DROP DEFAULT`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__per_user_following" ALTER COLUMN "___local_followers_dec" DROP DEFAULT`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__per_user_following" ALTER COLUMN "___local_followers_inc" DROP DEFAULT`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__per_user_following" ALTER COLUMN "___local_followers_total" DROP DEFAULT`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__per_user_following" ALTER COLUMN "___local_followings_dec" DROP DEFAULT`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__per_user_following" ALTER COLUMN "___local_followings_inc" DROP DEFAULT`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__per_user_following" ALTER COLUMN "___local_followings_total" DROP DEFAULT`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__per_user_following" ALTER COLUMN "___remote_followers_dec" DROP DEFAULT`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__per_user_following" ALTER COLUMN "___remote_followers_inc" DROP DEFAULT`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__per_user_following" ALTER COLUMN "___remote_followers_total" DROP DEFAULT`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__per_user_following" ALTER COLUMN "___remote_followings_dec" DROP DEFAULT`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__per_user_following" ALTER COLUMN "___remote_followings_inc" DROP DEFAULT`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__per_user_following" ALTER COLUMN "___remote_followings_total" DROP DEFAULT`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__per_user_following" ALTER COLUMN "___local_followers_dec" DROP DEFAULT`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__per_user_following" ALTER COLUMN "___local_followers_inc" DROP DEFAULT`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__per_user_following" ALTER COLUMN "___local_followers_total" DROP DEFAULT`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__per_user_following" ALTER COLUMN "___local_followings_dec" DROP DEFAULT`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__per_user_following" ALTER COLUMN "___local_followings_inc" DROP DEFAULT`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__per_user_following" ALTER COLUMN "___local_followings_total" DROP DEFAULT`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__per_user_reaction" ALTER COLUMN "___remote_count" DROP DEFAULT`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__per_user_reaction" ALTER COLUMN "___local_count" DROP DEFAULT`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__per_user_reaction" ALTER COLUMN "___remote_count" DROP DEFAULT`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__per_user_reaction" ALTER COLUMN "___local_count" DROP DEFAULT`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__drive" ALTER COLUMN "___remote_decSize" DROP DEFAULT`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__drive" ALTER COLUMN "___remote_decCount" DROP DEFAULT`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__drive" ALTER COLUMN "___remote_incSize" DROP DEFAULT`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__drive" ALTER COLUMN "___remote_incCount" DROP DEFAULT`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__drive" ALTER COLUMN "___local_decSize" DROP DEFAULT`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__drive" ALTER COLUMN "___local_decCount" DROP DEFAULT`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__drive" ALTER COLUMN "___local_incSize" DROP DEFAULT`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__drive" ALTER COLUMN "___local_incCount" DROP DEFAULT`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__drive" ALTER COLUMN "___remote_decSize" DROP DEFAULT`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__drive" ALTER COLUMN "___remote_decCount" DROP DEFAULT`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__drive" ALTER COLUMN "___remote_incSize" DROP DEFAULT`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__drive" ALTER COLUMN "___remote_incCount" DROP DEFAULT`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__drive" ALTER COLUMN "___local_decSize" DROP DEFAULT`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__drive" ALTER COLUMN "___local_decCount" DROP DEFAULT`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__drive" ALTER COLUMN "___local_incSize" DROP DEFAULT`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__drive" ALTER COLUMN "___local_incCount" DROP DEFAULT`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__per_user_notes" ALTER COLUMN "___diffs_renote" DROP DEFAULT`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__per_user_notes" ALTER COLUMN "___diffs_reply" DROP DEFAULT`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__per_user_notes" ALTER COLUMN "___diffs_normal" DROP DEFAULT`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__per_user_notes" ALTER COLUMN "___dec" DROP DEFAULT`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__per_user_notes" ALTER COLUMN "___inc" DROP DEFAULT`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__per_user_notes" ALTER COLUMN "___total" DROP DEFAULT`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__per_user_notes" ALTER COLUMN "___diffs_renote" DROP DEFAULT`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__per_user_notes" ALTER COLUMN "___diffs_reply" DROP DEFAULT`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__per_user_notes" ALTER COLUMN "___diffs_normal" DROP DEFAULT`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__per_user_notes" ALTER COLUMN "___dec" DROP DEFAULT`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__per_user_notes" ALTER COLUMN "___inc" DROP DEFAULT`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__per_user_notes" ALTER COLUMN "___total" DROP DEFAULT`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__instance" ALTER COLUMN "___drive_decUsage" DROP DEFAULT`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__instance" ALTER COLUMN "___drive_incUsage" DROP DEFAULT`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__instance" ALTER COLUMN "___drive_decFiles" DROP DEFAULT`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__instance" ALTER COLUMN "___drive_incFiles" DROP DEFAULT`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__instance" ALTER COLUMN "___drive_totalFiles" DROP DEFAULT`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__instance" ALTER COLUMN "___followers_dec" DROP DEFAULT`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__instance" ALTER COLUMN "___followers_inc" DROP DEFAULT`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__instance" ALTER COLUMN "___followers_total" DROP DEFAULT`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__instance" ALTER COLUMN "___following_dec" DROP DEFAULT`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__instance" ALTER COLUMN "___following_inc" DROP DEFAULT`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__instance" ALTER COLUMN "___following_total" DROP DEFAULT`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__instance" ALTER COLUMN "___users_dec" DROP DEFAULT`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__instance" ALTER COLUMN "___users_inc" DROP DEFAULT`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__instance" ALTER COLUMN "___users_total" DROP DEFAULT`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__instance" ALTER COLUMN "___notes_diffs_renote" DROP DEFAULT`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__instance" ALTER COLUMN "___notes_diffs_reply" DROP DEFAULT`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__instance" ALTER COLUMN "___notes_diffs_normal" DROP DEFAULT`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__instance" ALTER COLUMN "___notes_dec" DROP DEFAULT`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__instance" ALTER COLUMN "___notes_inc" DROP DEFAULT`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__instance" ALTER COLUMN "___notes_total" DROP DEFAULT`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__instance" ALTER COLUMN "___requests_received" DROP DEFAULT`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__instance" ALTER COLUMN "___requests_succeeded" DROP DEFAULT`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__instance" ALTER COLUMN "___requests_failed" DROP DEFAULT`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__instance" ALTER COLUMN "___drive_decUsage" DROP DEFAULT`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__instance" ALTER COLUMN "___drive_incUsage" DROP DEFAULT`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__instance" ALTER COLUMN "___drive_decFiles" DROP DEFAULT`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__instance" ALTER COLUMN "___drive_incFiles" DROP DEFAULT`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__instance" ALTER COLUMN "___drive_totalFiles" DROP DEFAULT`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__instance" ALTER COLUMN "___followers_dec" DROP DEFAULT`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__instance" ALTER COLUMN "___followers_inc" DROP DEFAULT`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__instance" ALTER COLUMN "___followers_total" DROP DEFAULT`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__instance" ALTER COLUMN "___following_dec" DROP DEFAULT`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__instance" ALTER COLUMN "___following_inc" DROP DEFAULT`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__instance" ALTER COLUMN "___following_total" DROP DEFAULT`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__instance" ALTER COLUMN "___users_dec" DROP DEFAULT`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__instance" ALTER COLUMN "___users_inc" DROP DEFAULT`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__instance" ALTER COLUMN "___users_total" DROP DEFAULT`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__instance" ALTER COLUMN "___notes_diffs_renote" DROP DEFAULT`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__instance" ALTER COLUMN "___notes_diffs_reply" DROP DEFAULT`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__instance" ALTER COLUMN "___notes_diffs_normal" DROP DEFAULT`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__instance" ALTER COLUMN "___notes_dec" DROP DEFAULT`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__instance" ALTER COLUMN "___notes_inc" DROP DEFAULT`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__instance" ALTER COLUMN "___notes_total" DROP DEFAULT`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__instance" ALTER COLUMN "___requests_received" DROP DEFAULT`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__instance" ALTER COLUMN "___requests_succeeded" DROP DEFAULT`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__instance" ALTER COLUMN "___requests_failed" DROP DEFAULT`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__network" ALTER COLUMN "___outgoingBytes" DROP DEFAULT`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__network" ALTER COLUMN "___incomingBytes" DROP DEFAULT`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__network" ALTER COLUMN "___totalTime" DROP DEFAULT`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__network" ALTER COLUMN "___outgoingRequests" DROP DEFAULT`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__network" ALTER COLUMN "___incomingRequests" DROP DEFAULT`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__network" ALTER COLUMN "___outgoingBytes" DROP DEFAULT`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__network" ALTER COLUMN "___incomingBytes" DROP DEFAULT`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__network" ALTER COLUMN "___totalTime" DROP DEFAULT`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__network" ALTER COLUMN "___outgoingRequests" DROP DEFAULT`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__network" ALTER COLUMN "___incomingRequests" DROP DEFAULT`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__users" ALTER COLUMN "___remote_dec" DROP DEFAULT`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__users" ALTER COLUMN "___remote_inc" DROP DEFAULT`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__users" ALTER COLUMN "___remote_total" DROP DEFAULT`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__users" ALTER COLUMN "___local_dec" DROP DEFAULT`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__users" ALTER COLUMN "___local_inc" DROP DEFAULT`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__users" ALTER COLUMN "___local_total" DROP DEFAULT`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__users" ALTER COLUMN "___remote_dec" DROP DEFAULT`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__users" ALTER COLUMN "___remote_inc" DROP DEFAULT`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__users" ALTER COLUMN "___remote_total" DROP DEFAULT`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__users" ALTER COLUMN "___local_dec" DROP DEFAULT`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__users" ALTER COLUMN "___local_inc" DROP DEFAULT`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__users" ALTER COLUMN "___local_total" DROP DEFAULT`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__notes" ALTER COLUMN "___remote_diffs_renote" DROP DEFAULT`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__notes" ALTER COLUMN "___remote_diffs_reply" DROP DEFAULT`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__notes" ALTER COLUMN "___remote_diffs_normal" DROP DEFAULT`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__notes" ALTER COLUMN "___remote_dec" DROP DEFAULT`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__notes" ALTER COLUMN "___remote_inc" DROP DEFAULT`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__notes" ALTER COLUMN "___remote_total" DROP DEFAULT`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__notes" ALTER COLUMN "___local_diffs_renote" DROP DEFAULT`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__notes" ALTER COLUMN "___local_diffs_reply" DROP DEFAULT`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__notes" ALTER COLUMN "___local_diffs_normal" DROP DEFAULT`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__notes" ALTER COLUMN "___local_dec" DROP DEFAULT`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__notes" ALTER COLUMN "___local_inc" DROP DEFAULT`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__notes" ALTER COLUMN "___local_total" DROP DEFAULT`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__notes" ALTER COLUMN "___remote_diffs_renote" DROP DEFAULT`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__notes" ALTER COLUMN "___remote_diffs_reply" DROP DEFAULT`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__notes" ALTER COLUMN "___remote_diffs_normal" DROP DEFAULT`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__notes" ALTER COLUMN "___remote_dec" DROP DEFAULT`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__notes" ALTER COLUMN "___remote_inc" DROP DEFAULT`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__notes" ALTER COLUMN "___remote_total" DROP DEFAULT`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__notes" ALTER COLUMN "___local_diffs_renote" DROP DEFAULT`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__notes" ALTER COLUMN "___local_diffs_reply" DROP DEFAULT`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__notes" ALTER COLUMN "___local_diffs_normal" DROP DEFAULT`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__notes" ALTER COLUMN "___local_dec" DROP DEFAULT`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__notes" ALTER COLUMN "___local_inc" DROP DEFAULT`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__notes" ALTER COLUMN "___local_total" DROP DEFAULT`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__federation" ALTER COLUMN "___instance_dec" DROP DEFAULT`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__federation" ALTER COLUMN "___instance_inc" DROP DEFAULT`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__federation" ALTER COLUMN "___instance_total" DROP DEFAULT`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__federation" ALTER COLUMN "___instance_dec" DROP DEFAULT`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__federation" ALTER COLUMN "___instance_inc" DROP DEFAULT`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__federation" ALTER COLUMN "___instance_total" DROP DEFAULT`, - ); - } -} diff --git a/packages/backend/migration/1644010796173-convert-hard-mutes.js b/packages/backend/migration/1644010796173-convert-hard-mutes.js deleted file mode 100644 index 39c5b080fd..0000000000 --- a/packages/backend/migration/1644010796173-convert-hard-mutes.js +++ /dev/null @@ -1,70 +0,0 @@ -import RE2 from "re2"; - -export class convertHardMutes1644010796173 { - name = "convertHardMutes1644010796173"; - - async up(queryRunner) { - let entries = await queryRunner.query( - `SELECT "userId", "mutedWords" FROM "user_profile" WHERE "userHost" IS NULL`, - ); - for (let i = 0; i < entries.length; i++) { - let words = entries[i].mutedWords - .map((line) => { - if (typeof line === "string") return []; - const regexp = line.join(" ").match(/^\/(.+)\/(.*)$/); - if (regexp) { - // convert regexp's - try { - new RE2(regexp[1], regexp[2]); - return `/${regexp[1]}/${regexp[2]}`; - } catch (err) { - // invalid regex, ignore it - return []; - } - } else { - // remove empty segments - return line.filter((x) => x !== ""); - } - }) - // remove empty lines - .filter((x) => !(Array.isArray(x) && x.length === 0)); - - await queryRunner.connection - .createQueryBuilder() - .update("user_profile") - .set({ - mutedWords: words, - }) - .where("userId = :id", { id: entries[i].userId }) - .execute(); - } - } - - async down(queryRunner) { - let entries = await queryRunner.query( - `SELECT "userId", "mutedWords" FROM "user_profile"`, - ); - for (let i = 0; i < entries.length; i++) { - let words = entries[i].mutedWords - .map((line) => { - if (Array.isArray(line)) { - return line; - } else { - // do not split regex at spaces again - return [line]; - } - }) - // remove empty lines - .filter((x) => !(Array.isArray(x) && x.length === 0)); - - await queryRunner.connection - .createQueryBuilder() - .update("user_profile") - .set({ - mutedWords: words, - }) - .where("userId = :id", { id: entries[i].userId }) - .execute(); - } - } -} diff --git a/packages/backend/migration/1644058404077-chart-v7.js b/packages/backend/migration/1644058404077-chart-v7.js deleted file mode 100644 index ab48c9ab38..0000000000 --- a/packages/backend/migration/1644058404077-chart-v7.js +++ /dev/null @@ -1,1470 +0,0 @@ -export class chartV71644058404077 { - name = "chartV71644058404077"; - - async up(queryRunner) { - await queryRunner.query( - `UPDATE "__chart__federation" SET "___instance_total"=2147483647 WHERE "___instance_total" > 2147483647`, - ); - await queryRunner.query( - `UPDATE "__chart__federation" SET "___instance_inc"=32767 WHERE "___instance_inc" > 32767`, - ); - await queryRunner.query( - `UPDATE "__chart__federation" SET "___instance_dec"=32767 WHERE "___instance_dec" > 32767`, - ); - await queryRunner.query( - `UPDATE "__chart_day__federation" SET "___instance_total"=2147483647 WHERE "___instance_total" > 2147483647`, - ); - await queryRunner.query( - `UPDATE "__chart_day__federation" SET "___instance_inc"=32767 WHERE "___instance_inc" > 32767`, - ); - await queryRunner.query( - `UPDATE "__chart_day__federation" SET "___instance_dec"=32767 WHERE "___instance_dec" > 32767`, - ); - await queryRunner.query( - `UPDATE "__chart__notes" SET "___local_total"=2147483647 WHERE "___local_total" > 2147483647`, - ); - await queryRunner.query( - `UPDATE "__chart__notes" SET "___local_inc"=2147483647 WHERE "___local_inc" > 2147483647`, - ); - await queryRunner.query( - `UPDATE "__chart__notes" SET "___local_dec"=2147483647 WHERE "___local_dec" > 2147483647`, - ); - await queryRunner.query( - `UPDATE "__chart__notes" SET "___local_diffs_normal"=2147483647 WHERE "___local_diffs_normal" > 2147483647`, - ); - await queryRunner.query( - `UPDATE "__chart__notes" SET "___local_diffs_reply"=2147483647 WHERE "___local_diffs_reply" > 2147483647`, - ); - await queryRunner.query( - `UPDATE "__chart__notes" SET "___local_diffs_renote"=2147483647 WHERE "___local_diffs_renote" > 2147483647`, - ); - await queryRunner.query( - `UPDATE "__chart__notes" SET "___remote_total"=2147483647 WHERE "___remote_total" > 2147483647`, - ); - await queryRunner.query( - `UPDATE "__chart__notes" SET "___remote_inc"=2147483647 WHERE "___remote_inc" > 2147483647`, - ); - await queryRunner.query( - `UPDATE "__chart__notes" SET "___remote_dec"=2147483647 WHERE "___remote_dec" > 2147483647`, - ); - await queryRunner.query( - `UPDATE "__chart__notes" SET "___remote_diffs_normal"=2147483647 WHERE "___remote_diffs_normal" > 2147483647`, - ); - await queryRunner.query( - `UPDATE "__chart__notes" SET "___remote_diffs_reply"=2147483647 WHERE "___remote_diffs_reply" > 2147483647`, - ); - await queryRunner.query( - `UPDATE "__chart__notes" SET "___remote_diffs_renote"=2147483647 WHERE "___remote_diffs_renote" > 2147483647`, - ); - await queryRunner.query( - `UPDATE "__chart_day__notes" SET "___local_total"=2147483647 WHERE "___local_total" > 2147483647`, - ); - await queryRunner.query( - `UPDATE "__chart_day__notes" SET "___local_inc"=2147483647 WHERE "___local_inc" > 2147483647`, - ); - await queryRunner.query( - `UPDATE "__chart_day__notes" SET "___local_dec"=2147483647 WHERE "___local_dec" > 2147483647`, - ); - await queryRunner.query( - `UPDATE "__chart_day__notes" SET "___local_diffs_normal"=2147483647 WHERE "___local_diffs_normal" > 2147483647`, - ); - await queryRunner.query( - `UPDATE "__chart_day__notes" SET "___local_diffs_reply"=2147483647 WHERE "___local_diffs_reply" > 2147483647`, - ); - await queryRunner.query( - `UPDATE "__chart_day__notes" SET "___local_diffs_renote"=2147483647 WHERE "___local_diffs_renote" > 2147483647`, - ); - await queryRunner.query( - `UPDATE "__chart_day__notes" SET "___remote_total"=2147483647 WHERE "___remote_total" > 2147483647`, - ); - await queryRunner.query( - `UPDATE "__chart_day__notes" SET "___remote_inc"=2147483647 WHERE "___remote_inc" > 2147483647`, - ); - await queryRunner.query( - `UPDATE "__chart_day__notes" SET "___remote_dec"=2147483647 WHERE "___remote_dec" > 2147483647`, - ); - await queryRunner.query( - `UPDATE "__chart_day__notes" SET "___remote_diffs_normal"=2147483647 WHERE "___remote_diffs_normal" > 2147483647`, - ); - await queryRunner.query( - `UPDATE "__chart_day__notes" SET "___remote_diffs_reply"=2147483647 WHERE "___remote_diffs_reply" > 2147483647`, - ); - await queryRunner.query( - `UPDATE "__chart_day__notes" SET "___remote_diffs_renote"=2147483647 WHERE "___remote_diffs_renote" > 2147483647`, - ); - await queryRunner.query( - `UPDATE "__chart__users" SET "___local_total"=2147483647 WHERE "___local_total" > 2147483647`, - ); - await queryRunner.query( - `UPDATE "__chart__users" SET "___local_inc"=32767 WHERE "___local_inc" > 32767`, - ); - await queryRunner.query( - `UPDATE "__chart__users" SET "___local_dec"=32767 WHERE "___local_dec" > 32767`, - ); - await queryRunner.query( - `UPDATE "__chart__users" SET "___remote_total"=2147483647 WHERE "___remote_total" > 2147483647`, - ); - await queryRunner.query( - `UPDATE "__chart__users" SET "___remote_inc"=32767 WHERE "___remote_inc" > 32767`, - ); - await queryRunner.query( - `UPDATE "__chart__users" SET "___remote_dec"=32767 WHERE "___remote_dec" > 32767`, - ); - await queryRunner.query( - `UPDATE "__chart_day__users" SET "___local_total"=2147483647 WHERE "___local_total" > 2147483647`, - ); - await queryRunner.query( - `UPDATE "__chart_day__users" SET "___local_inc"=32767 WHERE "___local_inc" > 32767`, - ); - await queryRunner.query( - `UPDATE "__chart_day__users" SET "___local_dec"=32767 WHERE "___local_dec" > 32767`, - ); - await queryRunner.query( - `UPDATE "__chart_day__users" SET "___remote_total"=2147483647 WHERE "___remote_total" > 2147483647`, - ); - await queryRunner.query( - `UPDATE "__chart_day__users" SET "___remote_inc"=32767 WHERE "___remote_inc" > 32767`, - ); - await queryRunner.query( - `UPDATE "__chart_day__users" SET "___remote_dec"=32767 WHERE "___remote_dec" > 32767`, - ); - await queryRunner.query( - `UPDATE "__chart__network" SET "___incomingRequests"=2147483647 WHERE "___incomingRequests" > 2147483647`, - ); - await queryRunner.query( - `UPDATE "__chart__network" SET "___outgoingRequests"=2147483647 WHERE "___outgoingRequests" > 2147483647`, - ); - await queryRunner.query( - `UPDATE "__chart__network" SET "___totalTime"=2147483647 WHERE "___totalTime" > 2147483647`, - ); - await queryRunner.query( - `UPDATE "__chart__network" SET "___incomingBytes"=2147483647 WHERE "___incomingBytes" > 2147483647`, - ); - await queryRunner.query( - `UPDATE "__chart__network" SET "___outgoingBytes"=2147483647 WHERE "___outgoingBytes" > 2147483647`, - ); - await queryRunner.query( - `UPDATE "__chart_day__network" SET "___incomingRequests"=2147483647 WHERE "___incomingRequests" > 2147483647`, - ); - await queryRunner.query( - `UPDATE "__chart_day__network" SET "___outgoingRequests"=2147483647 WHERE "___outgoingRequests" > 2147483647`, - ); - await queryRunner.query( - `UPDATE "__chart_day__network" SET "___totalTime"=2147483647 WHERE "___totalTime" > 2147483647`, - ); - await queryRunner.query( - `UPDATE "__chart_day__network" SET "___incomingBytes"=2147483647 WHERE "___incomingBytes" > 2147483647`, - ); - await queryRunner.query( - `UPDATE "__chart_day__network" SET "___outgoingBytes"=2147483647 WHERE "___outgoingBytes" > 2147483647`, - ); - await queryRunner.query( - `UPDATE "__chart__instance" SET "___requests_failed"=32767 WHERE "___requests_failed" > 32767`, - ); - await queryRunner.query( - `UPDATE "__chart__instance" SET "___requests_succeeded"=32767 WHERE "___requests_succeeded" > 32767`, - ); - await queryRunner.query( - `UPDATE "__chart__instance" SET "___requests_received"=32767 WHERE "___requests_received" > 32767`, - ); - await queryRunner.query( - `UPDATE "__chart__instance" SET "___notes_total"=2147483647 WHERE "___notes_total" > 2147483647`, - ); - await queryRunner.query( - `UPDATE "__chart__instance" SET "___notes_inc"=2147483647 WHERE "___notes_inc" > 2147483647`, - ); - await queryRunner.query( - `UPDATE "__chart__instance" SET "___notes_dec"=2147483647 WHERE "___notes_dec" > 2147483647`, - ); - await queryRunner.query( - `UPDATE "__chart__instance" SET "___notes_diffs_normal"=2147483647 WHERE "___notes_diffs_normal" > 2147483647`, - ); - await queryRunner.query( - `UPDATE "__chart__instance" SET "___notes_diffs_reply"=2147483647 WHERE "___notes_diffs_reply" > 2147483647`, - ); - await queryRunner.query( - `UPDATE "__chart__instance" SET "___notes_diffs_renote"=2147483647 WHERE "___notes_diffs_renote" > 2147483647`, - ); - await queryRunner.query( - `UPDATE "__chart__instance" SET "___users_total"=2147483647 WHERE "___users_total" > 2147483647`, - ); - await queryRunner.query( - `UPDATE "__chart__instance" SET "___users_inc"=32767 WHERE "___users_inc" > 32767`, - ); - await queryRunner.query( - `UPDATE "__chart__instance" SET "___users_dec"=32767 WHERE "___users_dec" > 32767`, - ); - await queryRunner.query( - `UPDATE "__chart__instance" SET "___following_total"=2147483647 WHERE "___following_total" > 2147483647`, - ); - await queryRunner.query( - `UPDATE "__chart__instance" SET "___following_inc"=32767 WHERE "___following_inc" > 32767`, - ); - await queryRunner.query( - `UPDATE "__chart__instance" SET "___following_dec"=32767 WHERE "___following_dec" > 32767`, - ); - await queryRunner.query( - `UPDATE "__chart__instance" SET "___followers_total"=2147483647 WHERE "___followers_total" > 2147483647`, - ); - await queryRunner.query( - `UPDATE "__chart__instance" SET "___followers_inc"=32767 WHERE "___followers_inc" > 32767`, - ); - await queryRunner.query( - `UPDATE "__chart__instance" SET "___followers_dec"=32767 WHERE "___followers_dec" > 32767`, - ); - await queryRunner.query( - `UPDATE "__chart__instance" SET "___drive_totalFiles"=2147483647 WHERE "___drive_totalFiles" > 2147483647`, - ); - await queryRunner.query( - `UPDATE "__chart__instance" SET "___drive_incFiles"=2147483647 WHERE "___drive_incFiles" > 2147483647`, - ); - await queryRunner.query( - `UPDATE "__chart__instance" SET "___drive_decFiles"=2147483647 WHERE "___drive_decFiles" > 2147483647`, - ); - await queryRunner.query( - `UPDATE "__chart__instance" SET "___drive_incUsage"=2147483647 WHERE "___drive_incUsage" > 2147483647`, - ); - await queryRunner.query( - `UPDATE "__chart__instance" SET "___drive_decUsage"=2147483647 WHERE "___drive_decUsage" > 2147483647`, - ); - await queryRunner.query( - `UPDATE "__chart_day__instance" SET "___requests_failed"=32767 WHERE "___requests_failed" > 32767`, - ); - await queryRunner.query( - `UPDATE "__chart_day__instance" SET "___requests_succeeded"=32767 WHERE "___requests_succeeded" > 32767`, - ); - await queryRunner.query( - `UPDATE "__chart_day__instance" SET "___requests_received"=32767 WHERE "___requests_received" > 32767`, - ); - await queryRunner.query( - `UPDATE "__chart_day__instance" SET "___notes_total"=2147483647 WHERE "___notes_total" > 2147483647`, - ); - await queryRunner.query( - `UPDATE "__chart_day__instance" SET "___notes_inc"=2147483647 WHERE "___notes_inc" > 2147483647`, - ); - await queryRunner.query( - `UPDATE "__chart_day__instance" SET "___notes_dec"=2147483647 WHERE "___notes_dec" > 2147483647`, - ); - await queryRunner.query( - `UPDATE "__chart_day__instance" SET "___notes_diffs_normal"=2147483647 WHERE "___notes_diffs_normal" > 2147483647`, - ); - await queryRunner.query( - `UPDATE "__chart_day__instance" SET "___notes_diffs_reply"=2147483647 WHERE "___notes_diffs_reply" > 2147483647`, - ); - await queryRunner.query( - `UPDATE "__chart_day__instance" SET "___notes_diffs_renote"=2147483647 WHERE "___notes_diffs_renote" > 2147483647`, - ); - await queryRunner.query( - `UPDATE "__chart_day__instance" SET "___users_total"=2147483647 WHERE "___users_total" > 2147483647`, - ); - await queryRunner.query( - `UPDATE "__chart_day__instance" SET "___users_inc"=32767 WHERE "___users_inc" > 32767`, - ); - await queryRunner.query( - `UPDATE "__chart_day__instance" SET "___users_dec"=32767 WHERE "___users_dec" > 32767`, - ); - await queryRunner.query( - `UPDATE "__chart_day__instance" SET "___following_total"=2147483647 WHERE "___following_total" > 2147483647`, - ); - await queryRunner.query( - `UPDATE "__chart_day__instance" SET "___following_inc"=32767 WHERE "___following_inc" > 32767`, - ); - await queryRunner.query( - `UPDATE "__chart_day__instance" SET "___following_dec"=32767 WHERE "___following_dec" > 32767`, - ); - await queryRunner.query( - `UPDATE "__chart_day__instance" SET "___followers_total"=2147483647 WHERE "___followers_total" > 2147483647`, - ); - await queryRunner.query( - `UPDATE "__chart_day__instance" SET "___followers_inc"=32767 WHERE "___followers_inc" > 32767`, - ); - await queryRunner.query( - `UPDATE "__chart_day__instance" SET "___followers_dec"=32767 WHERE "___followers_dec" > 32767`, - ); - await queryRunner.query( - `UPDATE "__chart_day__instance" SET "___drive_totalFiles"=2147483647 WHERE "___drive_totalFiles" > 2147483647`, - ); - await queryRunner.query( - `UPDATE "__chart_day__instance" SET "___drive_incFiles"=2147483647 WHERE "___drive_incFiles" > 2147483647`, - ); - await queryRunner.query( - `UPDATE "__chart_day__instance" SET "___drive_decFiles"=2147483647 WHERE "___drive_decFiles" > 2147483647`, - ); - await queryRunner.query( - `UPDATE "__chart_day__instance" SET "___drive_incUsage"=2147483647 WHERE "___drive_incUsage" > 2147483647`, - ); - await queryRunner.query( - `UPDATE "__chart_day__instance" SET "___drive_decUsage"=2147483647 WHERE "___drive_decUsage" > 2147483647`, - ); - await queryRunner.query( - `UPDATE "__chart__per_user_notes" SET "___total"=2147483647 WHERE "___total" > 2147483647`, - ); - await queryRunner.query( - `UPDATE "__chart__per_user_notes" SET "___inc"=32767 WHERE "___inc" > 32767`, - ); - await queryRunner.query( - `UPDATE "__chart__per_user_notes" SET "___dec"=32767 WHERE "___dec" > 32767`, - ); - await queryRunner.query( - `UPDATE "__chart__per_user_notes" SET "___diffs_normal"=32767 WHERE "___diffs_normal" > 32767`, - ); - await queryRunner.query( - `UPDATE "__chart__per_user_notes" SET "___diffs_reply"=32767 WHERE "___diffs_reply" > 32767`, - ); - await queryRunner.query( - `UPDATE "__chart__per_user_notes" SET "___diffs_renote"=32767 WHERE "___diffs_renote" > 32767`, - ); - await queryRunner.query( - `UPDATE "__chart_day__per_user_notes" SET "___total"=2147483647 WHERE "___total" > 2147483647`, - ); - await queryRunner.query( - `UPDATE "__chart_day__per_user_notes" SET "___inc"=32767 WHERE "___inc" > 32767`, - ); - await queryRunner.query( - `UPDATE "__chart_day__per_user_notes" SET "___dec"=32767 WHERE "___dec" > 32767`, - ); - await queryRunner.query( - `UPDATE "__chart_day__per_user_notes" SET "___diffs_normal"=32767 WHERE "___diffs_normal" > 32767`, - ); - await queryRunner.query( - `UPDATE "__chart_day__per_user_notes" SET "___diffs_reply"=32767 WHERE "___diffs_reply" > 32767`, - ); - await queryRunner.query( - `UPDATE "__chart_day__per_user_notes" SET "___diffs_renote"=32767 WHERE "___diffs_renote" > 32767`, - ); - await queryRunner.query( - `UPDATE "__chart__drive" SET "___local_incCount"=2147483647 WHERE "___local_incCount" > 2147483647`, - ); - await queryRunner.query( - `UPDATE "__chart__drive" SET "___local_incSize"=2147483647 WHERE "___local_incSize" > 2147483647`, - ); - await queryRunner.query( - `UPDATE "__chart__drive" SET "___local_decCount"=2147483647 WHERE "___local_decCount" > 2147483647`, - ); - await queryRunner.query( - `UPDATE "__chart__drive" SET "___local_decSize"=2147483647 WHERE "___local_decSize" > 2147483647`, - ); - await queryRunner.query( - `UPDATE "__chart__drive" SET "___remote_incCount"=2147483647 WHERE "___remote_incCount" > 2147483647`, - ); - await queryRunner.query( - `UPDATE "__chart__drive" SET "___remote_incSize"=2147483647 WHERE "___remote_incSize" > 2147483647`, - ); - await queryRunner.query( - `UPDATE "__chart__drive" SET "___remote_decCount"=2147483647 WHERE "___remote_decCount" > 2147483647`, - ); - await queryRunner.query( - `UPDATE "__chart__drive" SET "___remote_decSize"=2147483647 WHERE "___remote_decSize" > 2147483647`, - ); - await queryRunner.query( - `UPDATE "__chart_day__drive" SET "___local_incCount"=2147483647 WHERE "___local_incCount" > 2147483647`, - ); - await queryRunner.query( - `UPDATE "__chart_day__drive" SET "___local_incSize"=2147483647 WHERE "___local_incSize" > 2147483647`, - ); - await queryRunner.query( - `UPDATE "__chart_day__drive" SET "___local_decCount"=2147483647 WHERE "___local_decCount" > 2147483647`, - ); - await queryRunner.query( - `UPDATE "__chart_day__drive" SET "___local_decSize"=2147483647 WHERE "___local_decSize" > 2147483647`, - ); - await queryRunner.query( - `UPDATE "__chart_day__drive" SET "___remote_incCount"=2147483647 WHERE "___remote_incCount" > 2147483647`, - ); - await queryRunner.query( - `UPDATE "__chart_day__drive" SET "___remote_incSize"=2147483647 WHERE "___remote_incSize" > 2147483647`, - ); - await queryRunner.query( - `UPDATE "__chart_day__drive" SET "___remote_decCount"=2147483647 WHERE "___remote_decCount" > 2147483647`, - ); - await queryRunner.query( - `UPDATE "__chart_day__drive" SET "___remote_decSize"=2147483647 WHERE "___remote_decSize" > 2147483647`, - ); - await queryRunner.query( - `UPDATE "__chart__per_user_reaction" SET "___local_count"=32767 WHERE "___local_count" > 32767`, - ); - await queryRunner.query( - `UPDATE "__chart__per_user_reaction" SET "___remote_count"=32767 WHERE "___remote_count" > 32767`, - ); - await queryRunner.query( - `UPDATE "__chart_day__per_user_reaction" SET "___local_count"=32767 WHERE "___local_count" > 32767`, - ); - await queryRunner.query( - `UPDATE "__chart_day__per_user_reaction" SET "___remote_count"=32767 WHERE "___remote_count" > 32767`, - ); - await queryRunner.query( - `UPDATE "__chart__per_user_following" SET "___local_followings_total"=2147483647 WHERE "___local_followings_total" > 2147483647`, - ); - await queryRunner.query( - `UPDATE "__chart__per_user_following" SET "___local_followings_inc"=32767 WHERE "___local_followings_inc" > 32767`, - ); - await queryRunner.query( - `UPDATE "__chart__per_user_following" SET "___local_followings_dec"=32767 WHERE "___local_followings_dec" > 32767`, - ); - await queryRunner.query( - `UPDATE "__chart__per_user_following" SET "___local_followers_total"=2147483647 WHERE "___local_followers_total" > 2147483647`, - ); - await queryRunner.query( - `UPDATE "__chart__per_user_following" SET "___local_followers_inc"=32767 WHERE "___local_followers_inc" > 32767`, - ); - await queryRunner.query( - `UPDATE "__chart__per_user_following" SET "___local_followers_dec"=32767 WHERE "___local_followers_dec" > 32767`, - ); - await queryRunner.query( - `UPDATE "__chart__per_user_following" SET "___remote_followings_total"=2147483647 WHERE "___remote_followings_total" > 2147483647`, - ); - await queryRunner.query( - `UPDATE "__chart__per_user_following" SET "___remote_followings_inc"=32767 WHERE "___remote_followings_inc" > 32767`, - ); - await queryRunner.query( - `UPDATE "__chart__per_user_following" SET "___remote_followings_dec"=32767 WHERE "___remote_followings_dec" > 32767`, - ); - await queryRunner.query( - `UPDATE "__chart__per_user_following" SET "___remote_followers_total"=2147483647 WHERE "___remote_followers_total" > 2147483647`, - ); - await queryRunner.query( - `UPDATE "__chart__per_user_following" SET "___remote_followers_inc"=32767 WHERE "___remote_followers_inc" > 32767`, - ); - await queryRunner.query( - `UPDATE "__chart__per_user_following" SET "___remote_followers_dec"=32767 WHERE "___remote_followers_dec" > 32767`, - ); - await queryRunner.query( - `UPDATE "__chart_day__per_user_following" SET "___local_followings_total"=2147483647 WHERE "___local_followings_total" > 2147483647`, - ); - await queryRunner.query( - `UPDATE "__chart_day__per_user_following" SET "___local_followings_inc"=32767 WHERE "___local_followings_inc" > 32767`, - ); - await queryRunner.query( - `UPDATE "__chart_day__per_user_following" SET "___local_followings_dec"=32767 WHERE "___local_followings_dec" > 32767`, - ); - await queryRunner.query( - `UPDATE "__chart_day__per_user_following" SET "___local_followers_total"=2147483647 WHERE "___local_followers_total" > 2147483647`, - ); - await queryRunner.query( - `UPDATE "__chart_day__per_user_following" SET "___local_followers_inc"=32767 WHERE "___local_followers_inc" > 32767`, - ); - await queryRunner.query( - `UPDATE "__chart_day__per_user_following" SET "___local_followers_dec"=32767 WHERE "___local_followers_dec" > 32767`, - ); - await queryRunner.query( - `UPDATE "__chart_day__per_user_following" SET "___remote_followings_total"=2147483647 WHERE "___remote_followings_total" > 2147483647`, - ); - await queryRunner.query( - `UPDATE "__chart_day__per_user_following" SET "___remote_followings_inc"=32767 WHERE "___remote_followings_inc" > 32767`, - ); - await queryRunner.query( - `UPDATE "__chart_day__per_user_following" SET "___remote_followings_dec"=32767 WHERE "___remote_followings_dec" > 32767`, - ); - await queryRunner.query( - `UPDATE "__chart_day__per_user_following" SET "___remote_followers_total"=2147483647 WHERE "___remote_followers_total" > 2147483647`, - ); - await queryRunner.query( - `UPDATE "__chart_day__per_user_following" SET "___remote_followers_inc"=32767 WHERE "___remote_followers_inc" > 32767`, - ); - await queryRunner.query( - `UPDATE "__chart_day__per_user_following" SET "___remote_followers_dec"=32767 WHERE "___remote_followers_dec" > 32767`, - ); - await queryRunner.query(`TRUNCATE TABLE "__chart__per_user_drive"`); - await queryRunner.query(`TRUNCATE TABLE "__chart_day__per_user_drive"`); - - await queryRunner.query( - `ALTER TABLE "__chart__federation" ALTER COLUMN "___instance_total" TYPE integer USING "___instance_total"::integer`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__federation" ALTER COLUMN "___instance_inc" TYPE smallint USING "___instance_inc"::smallint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__federation" ALTER COLUMN "___instance_dec" TYPE smallint USING "___instance_dec"::smallint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__federation" ALTER COLUMN "___instance_total" TYPE integer USING "___instance_total"::integer`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__federation" ALTER COLUMN "___instance_inc" TYPE smallint USING "___instance_inc"::smallint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__federation" ALTER COLUMN "___instance_dec" TYPE smallint USING "___instance_dec"::smallint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__notes" ALTER COLUMN "___local_total" TYPE integer USING "___local_total"::integer`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__notes" ALTER COLUMN "___local_inc" TYPE integer USING "___local_inc"::integer`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__notes" ALTER COLUMN "___local_dec" TYPE integer USING "___local_dec"::integer`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__notes" ALTER COLUMN "___local_diffs_normal" TYPE integer USING "___local_diffs_normal"::integer`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__notes" ALTER COLUMN "___local_diffs_reply" TYPE integer USING "___local_diffs_reply"::integer`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__notes" ALTER COLUMN "___local_diffs_renote" TYPE integer USING "___local_diffs_renote"::integer`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__notes" ALTER COLUMN "___remote_total" TYPE integer USING "___remote_total"::integer`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__notes" ALTER COLUMN "___remote_inc" TYPE integer USING "___remote_inc"::integer`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__notes" ALTER COLUMN "___remote_dec" TYPE integer USING "___remote_dec"::integer`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__notes" ALTER COLUMN "___remote_diffs_normal" TYPE integer USING "___remote_diffs_normal"::integer`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__notes" ALTER COLUMN "___remote_diffs_reply" TYPE integer USING "___remote_diffs_reply"::integer`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__notes" ALTER COLUMN "___remote_diffs_renote" TYPE integer USING "___remote_diffs_renote"::integer`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__notes" ALTER COLUMN "___local_total" TYPE integer USING "___local_total"::integer`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__notes" ALTER COLUMN "___local_inc" TYPE integer USING "___local_inc"::integer`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__notes" ALTER COLUMN "___local_dec" TYPE integer USING "___local_dec"::integer`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__notes" ALTER COLUMN "___local_diffs_normal" TYPE integer USING "___local_diffs_normal"::integer`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__notes" ALTER COLUMN "___local_diffs_reply" TYPE integer USING "___local_diffs_reply"::integer`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__notes" ALTER COLUMN "___local_diffs_renote" TYPE integer USING "___local_diffs_renote"::integer`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__notes" ALTER COLUMN "___remote_total" TYPE integer USING "___remote_total"::integer`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__notes" ALTER COLUMN "___remote_inc" TYPE integer USING "___remote_inc"::integer`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__notes" ALTER COLUMN "___remote_dec" TYPE integer USING "___remote_dec"::integer`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__notes" ALTER COLUMN "___remote_diffs_normal" TYPE integer USING "___remote_diffs_normal"::integer`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__notes" ALTER COLUMN "___remote_diffs_reply" TYPE integer USING "___remote_diffs_reply"::integer`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__notes" ALTER COLUMN "___remote_diffs_renote" TYPE integer USING "___remote_diffs_renote"::integer`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__users" ALTER COLUMN "___local_total" TYPE integer USING "___local_total"::integer`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__users" ALTER COLUMN "___local_inc" TYPE smallint USING "___local_inc"::smallint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__users" ALTER COLUMN "___local_dec" TYPE smallint USING "___local_dec"::smallint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__users" ALTER COLUMN "___remote_total" TYPE integer USING "___remote_total"::integer`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__users" ALTER COLUMN "___remote_inc" TYPE smallint USING "___remote_inc"::smallint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__users" ALTER COLUMN "___remote_dec" TYPE smallint USING "___remote_dec"::smallint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__users" ALTER COLUMN "___local_total" TYPE integer USING "___local_total"::integer`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__users" ALTER COLUMN "___local_inc" TYPE smallint USING "___local_inc"::smallint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__users" ALTER COLUMN "___local_dec" TYPE smallint USING "___local_dec"::smallint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__users" ALTER COLUMN "___remote_total" TYPE integer USING "___remote_total"::integer`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__users" ALTER COLUMN "___remote_inc" TYPE smallint USING "___remote_inc"::smallint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__users" ALTER COLUMN "___remote_dec" TYPE smallint USING "___remote_dec"::smallint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__network" ALTER COLUMN "___incomingRequests" TYPE integer USING "___incomingRequests"::integer`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__network" ALTER COLUMN "___outgoingRequests" TYPE integer USING "___outgoingRequests"::integer`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__network" ALTER COLUMN "___totalTime" TYPE integer USING "___totalTime"::integer`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__network" ALTER COLUMN "___incomingBytes" TYPE integer USING "___incomingBytes"::integer`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__network" ALTER COLUMN "___outgoingBytes" TYPE integer USING "___outgoingBytes"::integer`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__network" ALTER COLUMN "___incomingRequests" TYPE integer USING "___incomingRequests"::integer`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__network" ALTER COLUMN "___outgoingRequests" TYPE integer USING "___outgoingRequests"::integer`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__network" ALTER COLUMN "___totalTime" TYPE integer USING "___totalTime"::integer`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__network" ALTER COLUMN "___incomingBytes" TYPE integer USING "___incomingBytes"::integer`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__network" ALTER COLUMN "___outgoingBytes" TYPE integer USING "___outgoingBytes"::integer`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__instance" ALTER COLUMN "___requests_failed" TYPE smallint USING "___requests_failed"::smallint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__instance" ALTER COLUMN "___requests_succeeded" TYPE smallint USING "___requests_succeeded"::smallint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__instance" ALTER COLUMN "___requests_received" TYPE smallint USING "___requests_received"::smallint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__instance" ALTER COLUMN "___notes_total" TYPE integer USING "___notes_total"::integer`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__instance" ALTER COLUMN "___notes_inc" TYPE integer USING "___notes_inc"::integer`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__instance" ALTER COLUMN "___notes_dec" TYPE integer USING "___notes_dec"::integer`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__instance" ALTER COLUMN "___notes_diffs_normal" TYPE integer USING "___notes_diffs_normal"::integer`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__instance" ALTER COLUMN "___notes_diffs_reply" TYPE integer USING "___notes_diffs_reply"::integer`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__instance" ALTER COLUMN "___notes_diffs_renote" TYPE integer USING "___notes_diffs_renote"::integer`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__instance" ALTER COLUMN "___users_total" TYPE integer USING "___users_total"::integer`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__instance" ALTER COLUMN "___users_inc" TYPE smallint USING "___users_inc"::smallint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__instance" ALTER COLUMN "___users_dec" TYPE smallint USING "___users_dec"::smallint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__instance" ALTER COLUMN "___following_total" TYPE integer USING "___following_total"::integer`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__instance" ALTER COLUMN "___following_inc" TYPE smallint USING "___following_inc"::smallint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__instance" ALTER COLUMN "___following_dec" TYPE smallint USING "___following_dec"::smallint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__instance" ALTER COLUMN "___followers_total" TYPE integer USING "___followers_total"::integer`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__instance" ALTER COLUMN "___followers_inc" TYPE smallint USING "___followers_inc"::smallint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__instance" ALTER COLUMN "___followers_dec" TYPE smallint USING "___followers_dec"::smallint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__instance" ALTER COLUMN "___drive_totalFiles" TYPE integer USING "___drive_totalFiles"::integer`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__instance" ALTER COLUMN "___drive_incFiles" TYPE integer USING "___drive_incFiles"::integer`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__instance" ALTER COLUMN "___drive_decFiles" TYPE integer USING "___drive_decFiles"::integer`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__instance" ALTER COLUMN "___drive_incUsage" TYPE integer USING "___drive_incUsage"::integer`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__instance" ALTER COLUMN "___drive_decUsage" TYPE integer USING "___drive_decUsage"::integer`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__instance" ALTER COLUMN "___requests_failed" TYPE smallint USING "___requests_failed"::smallint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__instance" ALTER COLUMN "___requests_succeeded" TYPE smallint USING "___requests_succeeded"::smallint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__instance" ALTER COLUMN "___requests_received" TYPE smallint USING "___requests_received"::smallint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__instance" ALTER COLUMN "___notes_total" TYPE integer USING "___notes_total"::integer`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__instance" ALTER COLUMN "___notes_inc" TYPE integer USING "___notes_inc"::integer`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__instance" ALTER COLUMN "___notes_dec" TYPE integer USING "___notes_dec"::integer`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__instance" ALTER COLUMN "___notes_diffs_normal" TYPE integer USING "___notes_diffs_normal"::integer`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__instance" ALTER COLUMN "___notes_diffs_reply" TYPE integer USING "___notes_diffs_reply"::integer`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__instance" ALTER COLUMN "___notes_diffs_renote" TYPE integer USING "___notes_diffs_renote"::integer`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__instance" ALTER COLUMN "___users_total" TYPE integer USING "___users_total"::integer`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__instance" ALTER COLUMN "___users_inc" TYPE smallint USING "___users_inc"::smallint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__instance" ALTER COLUMN "___users_dec" TYPE smallint USING "___users_dec"::smallint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__instance" ALTER COLUMN "___following_total" TYPE integer USING "___following_total"::integer`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__instance" ALTER COLUMN "___following_inc" TYPE smallint USING "___following_inc"::smallint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__instance" ALTER COLUMN "___following_dec" TYPE smallint USING "___following_dec"::smallint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__instance" ALTER COLUMN "___followers_total" TYPE integer USING "___followers_total"::integer`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__instance" ALTER COLUMN "___followers_inc" TYPE smallint USING "___followers_inc"::smallint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__instance" ALTER COLUMN "___followers_dec" TYPE smallint USING "___followers_dec"::smallint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__instance" ALTER COLUMN "___drive_totalFiles" TYPE integer USING "___drive_totalFiles"::integer`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__instance" ALTER COLUMN "___drive_incFiles" TYPE integer USING "___drive_incFiles"::integer`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__instance" ALTER COLUMN "___drive_decFiles" TYPE integer USING "___drive_decFiles"::integer`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__instance" ALTER COLUMN "___drive_incUsage" TYPE integer USING "___drive_incUsage"::integer`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__instance" ALTER COLUMN "___drive_decUsage" TYPE integer USING "___drive_decUsage"::integer`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__per_user_notes" ALTER COLUMN "___total" TYPE integer USING "___total"::integer`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__per_user_notes" ALTER COLUMN "___inc" TYPE smallint USING "___inc"::smallint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__per_user_notes" ALTER COLUMN "___dec" TYPE smallint USING "___dec"::smallint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__per_user_notes" ALTER COLUMN "___diffs_normal" TYPE smallint USING "___diffs_normal"::smallint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__per_user_notes" ALTER COLUMN "___diffs_reply" TYPE smallint USING "___diffs_reply"::smallint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__per_user_notes" ALTER COLUMN "___diffs_renote" TYPE smallint USING "___diffs_renote"::smallint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__per_user_notes" ALTER COLUMN "___total" TYPE integer USING "___total"::integer`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__per_user_notes" ALTER COLUMN "___inc" TYPE smallint USING "___inc"::smallint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__per_user_notes" ALTER COLUMN "___dec" TYPE smallint USING "___dec"::smallint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__per_user_notes" ALTER COLUMN "___diffs_normal" TYPE smallint USING "___diffs_normal"::smallint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__per_user_notes" ALTER COLUMN "___diffs_reply" TYPE smallint USING "___diffs_reply"::smallint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__per_user_notes" ALTER COLUMN "___diffs_renote" TYPE smallint USING "___diffs_renote"::smallint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__drive" ALTER COLUMN "___local_incCount" TYPE integer USING "___local_incCount"::integer`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__drive" ALTER COLUMN "___local_incSize" TYPE integer USING "___local_incSize"::integer`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__drive" ALTER COLUMN "___local_decCount" TYPE integer USING "___local_decCount"::integer`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__drive" ALTER COLUMN "___local_decSize" TYPE integer USING "___local_decSize"::integer`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__drive" ALTER COLUMN "___remote_incCount" TYPE integer USING "___remote_incCount"::integer`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__drive" ALTER COLUMN "___remote_incSize" TYPE integer USING "___remote_incSize"::integer`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__drive" ALTER COLUMN "___remote_decCount" TYPE integer USING "___remote_decCount"::integer`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__drive" ALTER COLUMN "___remote_decSize" TYPE integer USING "___remote_decSize"::integer`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__drive" ALTER COLUMN "___local_incCount" TYPE integer USING "___local_incCount"::integer`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__drive" ALTER COLUMN "___local_incSize" TYPE integer USING "___local_incSize"::integer`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__drive" ALTER COLUMN "___local_decCount" TYPE integer USING "___local_decCount"::integer`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__drive" ALTER COLUMN "___local_decSize" TYPE integer USING "___local_decSize"::integer`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__drive" ALTER COLUMN "___remote_incCount" TYPE integer USING "___remote_incCount"::integer`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__drive" ALTER COLUMN "___remote_incSize" TYPE integer USING "___remote_incSize"::integer`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__drive" ALTER COLUMN "___remote_decCount" TYPE integer USING "___remote_decCount"::integer`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__drive" ALTER COLUMN "___remote_decSize" TYPE integer USING "___remote_decSize"::integer`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__per_user_reaction" ALTER COLUMN "___local_count" TYPE smallint USING "___local_count"::smallint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__per_user_reaction" ALTER COLUMN "___remote_count" TYPE smallint USING "___remote_count"::smallint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__per_user_reaction" ALTER COLUMN "___local_count" TYPE smallint USING "___local_count"::smallint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__per_user_reaction" ALTER COLUMN "___remote_count" TYPE smallint USING "___remote_count"::smallint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__per_user_following" ALTER COLUMN "___local_followings_total" TYPE integer USING "___local_followings_total"::integer`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__per_user_following" ALTER COLUMN "___local_followings_inc" TYPE smallint USING "___local_followings_inc"::smallint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__per_user_following" ALTER COLUMN "___local_followings_dec" TYPE smallint USING "___local_followings_dec"::smallint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__per_user_following" ALTER COLUMN "___local_followers_total" TYPE integer USING "___local_followers_total"::integer`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__per_user_following" ALTER COLUMN "___local_followers_inc" TYPE smallint USING "___local_followers_inc"::smallint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__per_user_following" ALTER COLUMN "___local_followers_dec" TYPE smallint USING "___local_followers_dec"::smallint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__per_user_following" ALTER COLUMN "___remote_followings_total" TYPE integer USING "___remote_followings_total"::integer`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__per_user_following" ALTER COLUMN "___remote_followings_inc" TYPE smallint USING "___remote_followings_inc"::smallint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__per_user_following" ALTER COLUMN "___remote_followings_dec" TYPE smallint USING "___remote_followings_dec"::smallint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__per_user_following" ALTER COLUMN "___remote_followers_total" TYPE integer USING "___remote_followers_total"::integer`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__per_user_following" ALTER COLUMN "___remote_followers_inc" TYPE smallint USING "___remote_followers_inc"::smallint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__per_user_following" ALTER COLUMN "___remote_followers_dec" TYPE smallint USING "___remote_followers_dec"::smallint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__per_user_following" ALTER COLUMN "___local_followings_total" TYPE integer USING "___local_followings_total"::integer`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__per_user_following" ALTER COLUMN "___local_followings_inc" TYPE smallint USING "___local_followings_inc"::smallint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__per_user_following" ALTER COLUMN "___local_followings_dec" TYPE smallint USING "___local_followings_dec"::smallint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__per_user_following" ALTER COLUMN "___local_followers_total" TYPE integer USING "___local_followers_total"::integer`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__per_user_following" ALTER COLUMN "___local_followers_inc" TYPE smallint USING "___local_followers_inc"::smallint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__per_user_following" ALTER COLUMN "___local_followers_dec" TYPE smallint USING "___local_followers_dec"::smallint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__per_user_following" ALTER COLUMN "___remote_followings_total" TYPE integer USING "___remote_followings_total"::integer`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__per_user_following" ALTER COLUMN "___remote_followings_inc" TYPE smallint USING "___remote_followings_inc"::smallint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__per_user_following" ALTER COLUMN "___remote_followings_dec" TYPE smallint USING "___remote_followings_dec"::smallint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__per_user_following" ALTER COLUMN "___remote_followers_total" TYPE integer USING "___remote_followers_total"::integer`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__per_user_following" ALTER COLUMN "___remote_followers_inc" TYPE smallint USING "___remote_followers_inc"::smallint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__per_user_following" ALTER COLUMN "___remote_followers_dec" TYPE smallint USING "___remote_followers_dec"::smallint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__per_user_drive" ALTER COLUMN "___totalCount" TYPE integer USING "___totalCount"::integer`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__per_user_drive" ALTER COLUMN "___totalSize" TYPE integer USING "___totalSize"::integer`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__per_user_drive" ALTER COLUMN "___incCount" TYPE smallint USING "___incCount"::smallint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__per_user_drive" ALTER COLUMN "___incSize" TYPE integer USING "___incSize"::integer`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__per_user_drive" ALTER COLUMN "___decCount" TYPE smallint USING "___decCount"::smallint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__per_user_drive" ALTER COLUMN "___decSize" TYPE integer USING "___decSize"::integer`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__per_user_drive" ALTER COLUMN "___totalCount" TYPE integer USING "___totalCount"::integer`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__per_user_drive" ALTER COLUMN "___totalSize" TYPE integer USING "___totalSize"::integer`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__per_user_drive" ALTER COLUMN "___incCount" TYPE smallint USING "___incCount"::smallint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__per_user_drive" ALTER COLUMN "___incSize" TYPE integer USING "___incSize"::integer`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__per_user_drive" ALTER COLUMN "___decCount" TYPE smallint USING "___decCount"::smallint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__per_user_drive" ALTER COLUMN "___decSize" TYPE integer USING "___decSize"::integer`, - ); - } - - async down(queryRunner) { - await queryRunner.query( - `ALTER TABLE "__chart__federation" ALTER COLUMN "___instance_total" TYPE bigint USING "___instance_total"::bigint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__federation" ALTER COLUMN "___instance_inc" TYPE bigint USING "___instance_inc"::bigint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__federation" ALTER COLUMN "___instance_dec" TYPE bigint USING "___instance_dec"::bigint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__federation" ALTER COLUMN "___instance_total" TYPE bigint USING "___instance_total"::bigint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__federation" ALTER COLUMN "___instance_inc" TYPE bigint USING "___instance_inc"::bigint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__federation" ALTER COLUMN "___instance_dec" TYPE bigint USING "___instance_dec"::bigint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__notes" ALTER COLUMN "___local_total" TYPE bigint USING "___local_total"::bigint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__notes" ALTER COLUMN "___local_inc" TYPE bigint USING "___local_inc"::bigint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__notes" ALTER COLUMN "___local_dec" TYPE bigint USING "___local_dec"::bigint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__notes" ALTER COLUMN "___local_diffs_normal" TYPE bigint USING "___local_diffs_normal"::bigint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__notes" ALTER COLUMN "___local_diffs_reply" TYPE bigint USING "___local_diffs_reply"::bigint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__notes" ALTER COLUMN "___local_diffs_renote" TYPE bigint USING "___local_diffs_renote"::bigint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__notes" ALTER COLUMN "___remote_total" TYPE bigint USING "___remote_total"::bigint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__notes" ALTER COLUMN "___remote_inc" TYPE bigint USING "___remote_inc"::bigint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__notes" ALTER COLUMN "___remote_dec" TYPE bigint USING "___remote_dec"::bigint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__notes" ALTER COLUMN "___remote_diffs_normal" TYPE bigint USING "___remote_diffs_normal"::bigint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__notes" ALTER COLUMN "___remote_diffs_reply" TYPE bigint USING "___remote_diffs_reply"::bigint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__notes" ALTER COLUMN "___remote_diffs_renote" TYPE bigint USING "___remote_diffs_renote"::bigint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__notes" ALTER COLUMN "___local_total" TYPE bigint USING "___local_total"::bigint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__notes" ALTER COLUMN "___local_inc" TYPE bigint USING "___local_inc"::bigint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__notes" ALTER COLUMN "___local_dec" TYPE bigint USING "___local_dec"::bigint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__notes" ALTER COLUMN "___local_diffs_normal" TYPE bigint USING "___local_diffs_normal"::bigint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__notes" ALTER COLUMN "___local_diffs_reply" TYPE bigint USING "___local_diffs_reply"::bigint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__notes" ALTER COLUMN "___local_diffs_renote" TYPE bigint USING "___local_diffs_renote"::bigint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__notes" ALTER COLUMN "___remote_total" TYPE bigint USING "___remote_total"::bigint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__notes" ALTER COLUMN "___remote_inc" TYPE bigint USING "___remote_inc"::bigint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__notes" ALTER COLUMN "___remote_dec" TYPE bigint USING "___remote_dec"::bigint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__notes" ALTER COLUMN "___remote_diffs_normal" TYPE bigint USING "___remote_diffs_normal"::bigint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__notes" ALTER COLUMN "___remote_diffs_reply" TYPE bigint USING "___remote_diffs_reply"::bigint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__notes" ALTER COLUMN "___remote_diffs_renote" TYPE bigint USING "___remote_diffs_renote"::bigint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__users" ALTER COLUMN "___local_total" TYPE bigint USING "___local_total"::bigint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__users" ALTER COLUMN "___local_inc" TYPE bigint USING "___local_inc"::bigint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__users" ALTER COLUMN "___local_dec" TYPE bigint USING "___local_dec"::bigint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__users" ALTER COLUMN "___remote_total" TYPE bigint USING "___remote_total"::bigint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__users" ALTER COLUMN "___remote_inc" TYPE bigint USING "___remote_inc"::bigint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__users" ALTER COLUMN "___remote_dec" TYPE bigint USING "___remote_dec"::bigint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__users" ALTER COLUMN "___local_total" TYPE bigint USING "___local_total"::bigint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__users" ALTER COLUMN "___local_inc" TYPE bigint USING "___local_inc"::bigint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__users" ALTER COLUMN "___local_dec" TYPE bigint USING "___local_dec"::bigint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__users" ALTER COLUMN "___remote_total" TYPE bigint USING "___remote_total"::bigint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__users" ALTER COLUMN "___remote_inc" TYPE bigint USING "___remote_inc"::bigint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__users" ALTER COLUMN "___remote_dec" TYPE bigint USING "___remote_dec"::bigint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__network" ALTER COLUMN "___incomingRequests" TYPE bigint USING "___incomingRequests"::bigint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__network" ALTER COLUMN "___outgoingRequests" TYPE bigint USING "___outgoingRequests"::bigint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__network" ALTER COLUMN "___totalTime" TYPE bigint USING "___totalTime"::bigint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__network" ALTER COLUMN "___incomingBytes" TYPE bigint USING "___incomingBytes"::bigint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__network" ALTER COLUMN "___outgoingBytes" TYPE bigint USING "___outgoingBytes"::bigint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__network" ALTER COLUMN "___incomingRequests" TYPE bigint USING "___incomingRequests"::bigint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__network" ALTER COLUMN "___outgoingRequests" TYPE bigint USING "___outgoingRequests"::bigint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__network" ALTER COLUMN "___totalTime" TYPE bigint USING "___totalTime"::bigint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__network" ALTER COLUMN "___incomingBytes" TYPE bigint USING "___incomingBytes"::bigint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__network" ALTER COLUMN "___outgoingBytes" TYPE bigint USING "___outgoingBytes"::bigint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__instance" ALTER COLUMN "___requests_failed" TYPE bigint USING "___requests_failed"::bigint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__instance" ALTER COLUMN "___requests_succeeded" TYPE bigint USING "___requests_succeeded"::bigint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__instance" ALTER COLUMN "___requests_received" TYPE bigint USING "___requests_received"::bigint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__instance" ALTER COLUMN "___notes_total" TYPE bigint USING "___notes_total"::bigint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__instance" ALTER COLUMN "___notes_inc" TYPE bigint USING "___notes_inc"::bigint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__instance" ALTER COLUMN "___notes_dec" TYPE bigint USING "___notes_dec"::bigint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__instance" ALTER COLUMN "___notes_diffs_normal" TYPE bigint USING "___notes_diffs_normal"::bigint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__instance" ALTER COLUMN "___notes_diffs_reply" TYPE bigint USING "___notes_diffs_reply"::bigint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__instance" ALTER COLUMN "___notes_diffs_renote" TYPE bigint USING "___notes_diffs_renote"::bigint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__instance" ALTER COLUMN "___users_total" TYPE bigint USING "___users_total"::bigint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__instance" ALTER COLUMN "___users_inc" TYPE bigint USING "___users_inc"::bigint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__instance" ALTER COLUMN "___users_dec" TYPE bigint USING "___users_dec"::bigint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__instance" ALTER COLUMN "___following_total" TYPE bigint USING "___following_total"::bigint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__instance" ALTER COLUMN "___following_inc" TYPE bigint USING "___following_inc"::bigint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__instance" ALTER COLUMN "___following_dec" TYPE bigint USING "___following_dec"::bigint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__instance" ALTER COLUMN "___followers_total" TYPE bigint USING "___followers_total"::bigint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__instance" ALTER COLUMN "___followers_inc" TYPE bigint USING "___followers_inc"::bigint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__instance" ALTER COLUMN "___followers_dec" TYPE bigint USING "___followers_dec"::bigint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__instance" ALTER COLUMN "___drive_totalFiles" TYPE bigint USING "___drive_totalFiles"::bigint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__instance" ALTER COLUMN "___drive_incFiles" TYPE bigint USING "___drive_incFiles"::bigint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__instance" ALTER COLUMN "___drive_decFiles" TYPE bigint USING "___drive_decFiles"::bigint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__instance" ALTER COLUMN "___drive_incUsage" TYPE bigint USING "___drive_incUsage"::bigint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__instance" ALTER COLUMN "___drive_decUsage" TYPE bigint USING "___drive_decUsage"::bigint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__instance" ALTER COLUMN "___requests_failed" TYPE bigint USING "___requests_failed"::bigint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__instance" ALTER COLUMN "___requests_succeeded" TYPE bigint USING "___requests_succeeded"::bigint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__instance" ALTER COLUMN "___requests_received" TYPE bigint USING "___requests_received"::bigint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__instance" ALTER COLUMN "___notes_total" TYPE bigint USING "___notes_total"::bigint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__instance" ALTER COLUMN "___notes_inc" TYPE bigint USING "___notes_inc"::bigint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__instance" ALTER COLUMN "___notes_dec" TYPE bigint USING "___notes_dec"::bigint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__instance" ALTER COLUMN "___notes_diffs_normal" TYPE bigint USING "___notes_diffs_normal"::bigint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__instance" ALTER COLUMN "___notes_diffs_reply" TYPE bigint USING "___notes_diffs_reply"::bigint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__instance" ALTER COLUMN "___notes_diffs_renote" TYPE bigint USING "___notes_diffs_renote"::bigint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__instance" ALTER COLUMN "___users_total" TYPE bigint USING "___users_total"::bigint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__instance" ALTER COLUMN "___users_inc" TYPE bigint USING "___users_inc"::bigint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__instance" ALTER COLUMN "___users_dec" TYPE bigint USING "___users_dec"::bigint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__instance" ALTER COLUMN "___following_total" TYPE bigint USING "___following_total"::bigint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__instance" ALTER COLUMN "___following_inc" TYPE bigint USING "___following_inc"::bigint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__instance" ALTER COLUMN "___following_dec" TYPE bigint USING "___following_dec"::bigint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__instance" ALTER COLUMN "___followers_total" TYPE bigint USING "___followers_total"::bigint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__instance" ALTER COLUMN "___followers_inc" TYPE bigint USING "___followers_inc"::bigint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__instance" ALTER COLUMN "___followers_dec" TYPE bigint USING "___followers_dec"::bigint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__instance" ALTER COLUMN "___drive_totalFiles" TYPE bigint USING "___drive_totalFiles"::bigint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__instance" ALTER COLUMN "___drive_incFiles" TYPE bigint USING "___drive_incFiles"::bigint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__instance" ALTER COLUMN "___drive_decFiles" TYPE bigint USING "___drive_decFiles"::bigint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__instance" ALTER COLUMN "___drive_incUsage" TYPE bigint USING "___drive_incUsage"::bigint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__instance" ALTER COLUMN "___drive_decUsage" TYPE bigint USING "___drive_decUsage"::bigint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__per_user_notes" ALTER COLUMN "___total" TYPE bigint USING "___total"::bigint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__per_user_notes" ALTER COLUMN "___inc" TYPE bigint USING "___inc"::bigint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__per_user_notes" ALTER COLUMN "___dec" TYPE bigint USING "___dec"::bigint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__per_user_notes" ALTER COLUMN "___diffs_normal" TYPE bigint USING "___diffs_normal"::bigint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__per_user_notes" ALTER COLUMN "___diffs_reply" TYPE bigint USING "___diffs_reply"::bigint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__per_user_notes" ALTER COLUMN "___diffs_renote" TYPE bigint USING "___diffs_renote"::bigint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__per_user_notes" ALTER COLUMN "___total" TYPE bigint USING "___total"::bigint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__per_user_notes" ALTER COLUMN "___inc" TYPE bigint USING "___inc"::bigint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__per_user_notes" ALTER COLUMN "___dec" TYPE bigint USING "___dec"::bigint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__per_user_notes" ALTER COLUMN "___diffs_normal" TYPE bigint USING "___diffs_normal"::bigint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__per_user_notes" ALTER COLUMN "___diffs_reply" TYPE bigint USING "___diffs_reply"::bigint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__per_user_notes" ALTER COLUMN "___diffs_renote" TYPE bigint USING "___diffs_renote"::bigint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__drive" ALTER COLUMN "___local_incCount" TYPE bigint USING "___local_incCount"::bigint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__drive" ALTER COLUMN "___local_incSize" TYPE bigint USING "___local_incSize"::bigint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__drive" ALTER COLUMN "___local_decCount" TYPE bigint USING "___local_decCount"::bigint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__drive" ALTER COLUMN "___local_decSize" TYPE bigint USING "___local_decSize"::bigint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__drive" ALTER COLUMN "___remote_incCount" TYPE bigint USING "___remote_incCount"::bigint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__drive" ALTER COLUMN "___remote_incSize" TYPE bigint USING "___remote_incSize"::bigint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__drive" ALTER COLUMN "___remote_decCount" TYPE bigint USING "___remote_decCount"::bigint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__drive" ALTER COLUMN "___remote_decSize" TYPE bigint USING "___remote_decSize"::bigint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__drive" ALTER COLUMN "___local_incCount" TYPE bigint USING "___local_incCount"::bigint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__drive" ALTER COLUMN "___local_incSize" TYPE bigint USING "___local_incSize"::bigint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__drive" ALTER COLUMN "___local_decCount" TYPE bigint USING "___local_decCount"::bigint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__drive" ALTER COLUMN "___local_decSize" TYPE bigint USING "___local_decSize"::bigint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__drive" ALTER COLUMN "___remote_incCount" TYPE bigint USING "___remote_incCount"::bigint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__drive" ALTER COLUMN "___remote_incSize" TYPE bigint USING "___remote_incSize"::bigint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__drive" ALTER COLUMN "___remote_decCount" TYPE bigint USING "___remote_decCount"::bigint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__drive" ALTER COLUMN "___remote_decSize" TYPE bigint USING "___remote_decSize"::bigint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__per_user_reaction" ALTER COLUMN "___local_count" TYPE bigint USING "___local_count"::bigint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__per_user_reaction" ALTER COLUMN "___remote_count" TYPE bigint USING "___remote_count"::bigint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__per_user_reaction" ALTER COLUMN "___local_count" TYPE bigint USING "___local_count"::bigint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__per_user_reaction" ALTER COLUMN "___remote_count" TYPE bigint USING "___remote_count"::bigint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__per_user_following" ALTER COLUMN "___local_followings_total" TYPE bigint USING "___local_followings_total"::bigint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__per_user_following" ALTER COLUMN "___local_followings_inc" TYPE bigint USING "___local_followings_inc"::bigint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__per_user_following" ALTER COLUMN "___local_followings_dec" TYPE bigint USING "___local_followings_dec"::bigint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__per_user_following" ALTER COLUMN "___local_followers_total" TYPE bigint USING "___local_followers_total"::bigint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__per_user_following" ALTER COLUMN "___local_followers_inc" TYPE bigint USING "___local_followers_inc"::bigint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__per_user_following" ALTER COLUMN "___local_followers_dec" TYPE bigint USING "___local_followers_dec"::bigint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__per_user_following" ALTER COLUMN "___remote_followings_total" TYPE bigint USING "___remote_followings_total"::bigint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__per_user_following" ALTER COLUMN "___remote_followings_inc" TYPE bigint USING "___remote_followings_inc"::bigint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__per_user_following" ALTER COLUMN "___remote_followings_dec" TYPE bigint USING "___remote_followings_dec"::bigint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__per_user_following" ALTER COLUMN "___remote_followers_total" TYPE bigint USING "___remote_followers_total"::bigint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__per_user_following" ALTER COLUMN "___remote_followers_inc" TYPE bigint USING "___remote_followers_inc"::bigint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__per_user_following" ALTER COLUMN "___remote_followers_dec" TYPE bigint USING "___remote_followers_dec"::bigint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__per_user_following" ALTER COLUMN "___local_followings_total" TYPE bigint USING "___local_followings_total"::bigint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__per_user_following" ALTER COLUMN "___local_followings_inc" TYPE bigint USING "___local_followings_inc"::bigint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__per_user_following" ALTER COLUMN "___local_followings_dec" TYPE bigint USING "___local_followings_dec"::bigint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__per_user_following" ALTER COLUMN "___local_followers_total" TYPE bigint USING "___local_followers_total"::bigint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__per_user_following" ALTER COLUMN "___local_followers_inc" TYPE bigint USING "___local_followers_inc"::bigint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__per_user_following" ALTER COLUMN "___local_followers_dec" TYPE bigint USING "___local_followers_dec"::bigint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__per_user_following" ALTER COLUMN "___remote_followings_total" TYPE bigint USING "___remote_followings_total"::bigint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__per_user_following" ALTER COLUMN "___remote_followings_inc" TYPE bigint USING "___remote_followings_inc"::bigint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__per_user_following" ALTER COLUMN "___remote_followings_dec" TYPE bigint USING "___remote_followings_dec"::bigint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__per_user_following" ALTER COLUMN "___remote_followers_total" TYPE bigint USING "___remote_followers_total"::bigint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__per_user_following" ALTER COLUMN "___remote_followers_inc" TYPE bigint USING "___remote_followers_inc"::bigint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__per_user_following" ALTER COLUMN "___remote_followers_dec" TYPE bigint USING "___remote_followers_dec"::bigint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__per_user_drive" ALTER COLUMN "___totalCount" TYPE bigint USING "___totalCount"::bigint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__per_user_drive" ALTER COLUMN "___totalSize" TYPE bigint USING "___totalSize"::bigint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__per_user_drive" ALTER COLUMN "___incCount" TYPE bigint USING "___incCount"::bigint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__per_user_drive" ALTER COLUMN "___incSize" TYPE bigint USING "___incSize"::bigint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__per_user_drive" ALTER COLUMN "___decCount" TYPE bigint USING "___decCount"::bigint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__per_user_drive" ALTER COLUMN "___decSize" TYPE bigint USING "___decSize"::bigint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__per_user_drive" ALTER COLUMN "___totalCount" TYPE bigint USING "___totalCount"::bigint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__per_user_drive" ALTER COLUMN "___totalSize" TYPE bigint USING "___totalSize"::bigint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__per_user_drive" ALTER COLUMN "___incCount" TYPE bigint USING "___incCount"::bigint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__per_user_drive" ALTER COLUMN "___incSize" TYPE bigint USING "___incSize"::bigint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__per_user_drive" ALTER COLUMN "___decCount" TYPE bigint USING "___decCount"::bigint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__per_user_drive" ALTER COLUMN "___decSize" TYPE bigint USING "___decSize"::bigint`, - ); - } -} diff --git a/packages/backend/migration/1644059847460-chart-v8.js b/packages/backend/migration/1644059847460-chart-v8.js deleted file mode 100644 index f9357c8ca1..0000000000 --- a/packages/backend/migration/1644059847460-chart-v8.js +++ /dev/null @@ -1,46 +0,0 @@ -export class chartV81644059847460 { - name = "chartV81644059847460"; - - async up(queryRunner) { - await queryRunner.query( - `UPDATE "__chart__active_users" SET "___local_users"=2147483647 WHERE "___local_users" > 2147483647`, - ); - await queryRunner.query( - `UPDATE "__chart__active_users" SET "___remote_users"=2147483647 WHERE "___remote_users" > 2147483647`, - ); - await queryRunner.query( - `UPDATE "__chart_day__active_users" SET "___local_users"=2147483647 WHERE "___local_users" > 2147483647`, - ); - await queryRunner.query( - `UPDATE "__chart_day__active_users" SET "___remote_users"=2147483647 WHERE "___remote_users" > 2147483647`, - ); - - await queryRunner.query( - `ALTER TABLE "__chart__active_users" ALTER COLUMN "___local_users" TYPE integer USING "___local_users"::integer`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__active_users" ALTER COLUMN "___remote_users" TYPE integer USING "___remote_users"::integer`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__active_users" ALTER COLUMN "___local_users" TYPE integer USING "___local_users"::integer`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__active_users" ALTER COLUMN "___remote_users" TYPE integer USING "___remote_users"::integer`, - ); - } - - async down(queryRunner) { - await queryRunner.query( - `ALTER TABLE "__chart__active_users" ALTER COLUMN "___local_users" TYPE bigint USING "___local_users"::bigint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__active_users" ALTER COLUMN "___remote_users" TYPE bigint USING "___remote_users"::bigint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__active_users" ALTER COLUMN "___local_users" TYPE bigint USING "___local_users"::bigint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__active_users" ALTER COLUMN "___remote_users" TYPE bigint USING "___remote_users"::bigint`, - ); - } -} diff --git a/packages/backend/migration/1644060125705-chart-v9.js b/packages/backend/migration/1644060125705-chart-v9.js deleted file mode 100644 index 7d7934e319..0000000000 --- a/packages/backend/migration/1644060125705-chart-v9.js +++ /dev/null @@ -1,46 +0,0 @@ -export class chartV91644060125705 { - name = "chartV91644060125705"; - - async up(queryRunner) { - await queryRunner.query( - `UPDATE "__chart__hashtag" SET "___local_users"=2147483647 WHERE "___local_users" > 2147483647`, - ); - await queryRunner.query( - `UPDATE "__chart__hashtag" SET "___remote_users"=2147483647 WHERE "___remote_users" > 2147483647`, - ); - await queryRunner.query( - `UPDATE "__chart_day__hashtag" SET "___local_users"=2147483647 WHERE "___local_users" > 2147483647`, - ); - await queryRunner.query( - `UPDATE "__chart_day__hashtag" SET "___remote_users"=2147483647 WHERE "___remote_users" > 2147483647`, - ); - - await queryRunner.query( - `ALTER TABLE "__chart__hashtag" ALTER COLUMN "___local_users" TYPE integer USING "___local_users"::integer`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__hashtag" ALTER COLUMN "___remote_users" TYPE integer USING "___remote_users"::integer`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__hashtag" ALTER COLUMN "___local_users" TYPE integer USING "___local_users"::integer`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__hashtag" ALTER COLUMN "___remote_users" TYPE integer USING "___remote_users"::integer`, - ); - } - - async down(queryRunner) { - await queryRunner.query( - `ALTER TABLE "__chart__hashtag" ALTER COLUMN "___local_users" TYPE bigint USING "___local_users"::bigint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__hashtag" ALTER COLUMN "___remote_users" TYPE bigint USING "___remote_users"::bigint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__hashtag" ALTER COLUMN "___local_users" TYPE bigint USING "___local_users"::bigint`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__hashtag" ALTER COLUMN "___remote_users" TYPE bigint USING "___remote_users"::bigint`, - ); - } -} diff --git a/packages/backend/migration/1644073149413-chart-v10.js b/packages/backend/migration/1644073149413-chart-v10.js deleted file mode 100644 index 8038dad156..0000000000 --- a/packages/backend/migration/1644073149413-chart-v10.js +++ /dev/null @@ -1,77 +0,0 @@ -export class chartV101644073149413 { - name = "chartV101644073149413"; - - async up(queryRunner) { - await queryRunner.query( - `CREATE TABLE "__chart__ap_request" ("id" SERIAL NOT NULL, "date" integer NOT NULL, "___deliverFailed" integer NOT NULL DEFAULT '0', "___deliverSucceeded" integer NOT NULL DEFAULT '0', "___inboxReceived" integer NOT NULL DEFAULT '0', CONSTRAINT "UQ_e56f4beac5746d44bc3e19c80d0" UNIQUE ("date"), CONSTRAINT "PK_56a25cd447c7ee08876b3baf8d8" PRIMARY KEY ("id"))`, - ); - await queryRunner.query( - `CREATE UNIQUE INDEX "IDX_e56f4beac5746d44bc3e19c80d" ON "__chart__ap_request" ("date") `, - ); - await queryRunner.query( - `CREATE TABLE "__chart_day__ap_request" ("id" SERIAL NOT NULL, "date" integer NOT NULL, "___deliverFailed" integer NOT NULL DEFAULT '0', "___deliverSucceeded" integer NOT NULL DEFAULT '0', "___inboxReceived" integer NOT NULL DEFAULT '0', CONSTRAINT "UQ_a848f66d6cec11980a5dd595822" UNIQUE ("date"), CONSTRAINT "PK_9318b49daee320194e23f712e69" PRIMARY KEY ("id"))`, - ); - await queryRunner.query( - `CREATE UNIQUE INDEX "IDX_a848f66d6cec11980a5dd59582" ON "__chart_day__ap_request" ("date") `, - ); - await queryRunner.query( - `ALTER TABLE "__chart__federation" ADD "unique_temp___deliveredInstances" character varying array NOT NULL DEFAULT '{}'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__federation" ADD "___deliveredInstances" smallint NOT NULL DEFAULT '0'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__federation" ADD "unique_temp___inboxInstances" character varying array NOT NULL DEFAULT '{}'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__federation" ADD "___inboxInstances" smallint NOT NULL DEFAULT '0'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__federation" ADD "unique_temp___deliveredInstances" character varying array NOT NULL DEFAULT '{}'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__federation" ADD "___deliveredInstances" smallint NOT NULL DEFAULT '0'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__federation" ADD "unique_temp___inboxInstances" character varying array NOT NULL DEFAULT '{}'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__federation" ADD "___inboxInstances" smallint NOT NULL DEFAULT '0'`, - ); - } - - async down(queryRunner) { - await queryRunner.query( - `ALTER TABLE "__chart_day__federation" DROP COLUMN "___inboxInstances"`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__federation" DROP COLUMN "unique_temp___inboxInstances"`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__federation" DROP COLUMN "___deliveredInstances"`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__federation" DROP COLUMN "unique_temp___deliveredInstances"`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__federation" DROP COLUMN "___inboxInstances"`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__federation" DROP COLUMN "unique_temp___inboxInstances"`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__federation" DROP COLUMN "___deliveredInstances"`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__federation" DROP COLUMN "unique_temp___deliveredInstances"`, - ); - await queryRunner.query( - `DROP INDEX "public"."IDX_a848f66d6cec11980a5dd59582"`, - ); - await queryRunner.query(`DROP TABLE "__chart_day__ap_request"`); - await queryRunner.query( - `DROP INDEX "public"."IDX_e56f4beac5746d44bc3e19c80d"`, - ); - await queryRunner.query(`DROP TABLE "__chart__ap_request"`); - } -} diff --git a/packages/backend/migration/1644095659741-chart-v11.js b/packages/backend/migration/1644095659741-chart-v11.js deleted file mode 100644 index 8db122d4f1..0000000000 --- a/packages/backend/migration/1644095659741-chart-v11.js +++ /dev/null @@ -1,249 +0,0 @@ -export class chartV111644095659741 { - name = "chartV111644095659741"; - - async up(queryRunner) { - await queryRunner.query( - `ALTER TABLE "__chart__active_users" DROP COLUMN "___local_users"`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__active_users" DROP COLUMN "___remote_users"`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__active_users" DROP COLUMN "unique_temp___local_users"`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__active_users" DROP COLUMN "unique_temp___remote_users"`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__active_users" DROP COLUMN "___local_users"`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__active_users" DROP COLUMN "___remote_users"`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__active_users" DROP COLUMN "unique_temp___local_users"`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__active_users" DROP COLUMN "unique_temp___remote_users"`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__active_users" ADD "unique_temp___users" character varying array NOT NULL DEFAULT '{}'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__active_users" ADD "___users" integer NOT NULL DEFAULT '0'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__active_users" ADD "unique_temp___notedUsers" character varying array NOT NULL DEFAULT '{}'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__active_users" ADD "___notedUsers" smallint NOT NULL DEFAULT '0'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__active_users" ADD "unique_temp___registeredWithinWeek" character varying array NOT NULL DEFAULT '{}'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__active_users" ADD "___registeredWithinWeek" smallint NOT NULL DEFAULT '0'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__active_users" ADD "unique_temp___registeredWithinMonth" character varying array NOT NULL DEFAULT '{}'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__active_users" ADD "___registeredWithinMonth" smallint NOT NULL DEFAULT '0'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__active_users" ADD "unique_temp___registeredWithinYear" character varying array NOT NULL DEFAULT '{}'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__active_users" ADD "___registeredWithinYear" smallint NOT NULL DEFAULT '0'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__active_users" ADD "unique_temp___registeredOutsideWeek" character varying array NOT NULL DEFAULT '{}'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__active_users" ADD "___registeredOutsideWeek" smallint NOT NULL DEFAULT '0'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__active_users" ADD "unique_temp___registeredOutsideMonth" character varying array NOT NULL DEFAULT '{}'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__active_users" ADD "___registeredOutsideMonth" smallint NOT NULL DEFAULT '0'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__active_users" ADD "unique_temp___registeredOutsideYear" character varying array NOT NULL DEFAULT '{}'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__active_users" ADD "___registeredOutsideYear" smallint NOT NULL DEFAULT '0'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__active_users" ADD "unique_temp___users" character varying array NOT NULL DEFAULT '{}'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__active_users" ADD "___users" integer NOT NULL DEFAULT '0'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__active_users" ADD "unique_temp___notedUsers" character varying array NOT NULL DEFAULT '{}'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__active_users" ADD "___notedUsers" smallint NOT NULL DEFAULT '0'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__active_users" ADD "unique_temp___registeredWithinWeek" character varying array NOT NULL DEFAULT '{}'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__active_users" ADD "___registeredWithinWeek" smallint NOT NULL DEFAULT '0'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__active_users" ADD "unique_temp___registeredWithinMonth" character varying array NOT NULL DEFAULT '{}'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__active_users" ADD "___registeredWithinMonth" smallint NOT NULL DEFAULT '0'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__active_users" ADD "unique_temp___registeredWithinYear" character varying array NOT NULL DEFAULT '{}'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__active_users" ADD "___registeredWithinYear" smallint NOT NULL DEFAULT '0'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__active_users" ADD "unique_temp___registeredOutsideWeek" character varying array NOT NULL DEFAULT '{}'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__active_users" ADD "___registeredOutsideWeek" smallint NOT NULL DEFAULT '0'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__active_users" ADD "unique_temp___registeredOutsideMonth" character varying array NOT NULL DEFAULT '{}'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__active_users" ADD "___registeredOutsideMonth" smallint NOT NULL DEFAULT '0'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__active_users" ADD "unique_temp___registeredOutsideYear" character varying array NOT NULL DEFAULT '{}'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__active_users" ADD "___registeredOutsideYear" smallint NOT NULL DEFAULT '0'`, - ); - } - - async down(queryRunner) { - await queryRunner.query( - `ALTER TABLE "__chart_day__active_users" DROP COLUMN "___registeredOutsideYear"`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__active_users" DROP COLUMN "unique_temp___registeredOutsideYear"`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__active_users" DROP COLUMN "___registeredOutsideMonth"`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__active_users" DROP COLUMN "unique_temp___registeredOutsideMonth"`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__active_users" DROP COLUMN "___registeredOutsideWeek"`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__active_users" DROP COLUMN "unique_temp___registeredOutsideWeek"`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__active_users" DROP COLUMN "___registeredWithinYear"`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__active_users" DROP COLUMN "unique_temp___registeredWithinYear"`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__active_users" DROP COLUMN "___registeredWithinMonth"`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__active_users" DROP COLUMN "unique_temp___registeredWithinMonth"`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__active_users" DROP COLUMN "___registeredWithinWeek"`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__active_users" DROP COLUMN "unique_temp___registeredWithinWeek"`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__active_users" DROP COLUMN "___notedUsers"`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__active_users" DROP COLUMN "unique_temp___notedUsers"`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__active_users" DROP COLUMN "___users"`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__active_users" DROP COLUMN "unique_temp___users"`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__active_users" DROP COLUMN "___registeredOutsideYear"`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__active_users" DROP COLUMN "unique_temp___registeredOutsideYear"`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__active_users" DROP COLUMN "___registeredOutsideMonth"`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__active_users" DROP COLUMN "unique_temp___registeredOutsideMonth"`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__active_users" DROP COLUMN "___registeredOutsideWeek"`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__active_users" DROP COLUMN "unique_temp___registeredOutsideWeek"`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__active_users" DROP COLUMN "___registeredWithinYear"`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__active_users" DROP COLUMN "unique_temp___registeredWithinYear"`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__active_users" DROP COLUMN "___registeredWithinMonth"`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__active_users" DROP COLUMN "unique_temp___registeredWithinMonth"`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__active_users" DROP COLUMN "___registeredWithinWeek"`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__active_users" DROP COLUMN "unique_temp___registeredWithinWeek"`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__active_users" DROP COLUMN "___notedUsers"`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__active_users" DROP COLUMN "unique_temp___notedUsers"`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__active_users" DROP COLUMN "___users"`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__active_users" DROP COLUMN "unique_temp___users"`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__active_users" ADD "unique_temp___remote_users" character varying array NOT NULL DEFAULT '{}'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__active_users" ADD "unique_temp___local_users" character varying array NOT NULL DEFAULT '{}'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__active_users" ADD "___remote_users" integer NOT NULL DEFAULT '0'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__active_users" ADD "___local_users" integer NOT NULL DEFAULT '0'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__active_users" ADD "unique_temp___remote_users" character varying array NOT NULL DEFAULT '{}'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__active_users" ADD "unique_temp___local_users" character varying array NOT NULL DEFAULT '{}'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__active_users" ADD "___remote_users" integer NOT NULL DEFAULT '0'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__active_users" ADD "___local_users" integer NOT NULL DEFAULT '0'`, - ); - } -} diff --git a/packages/backend/migration/1644328606241-chart-v12.js b/packages/backend/migration/1644328606241-chart-v12.js deleted file mode 100644 index ea363e12fd..0000000000 --- a/packages/backend/migration/1644328606241-chart-v12.js +++ /dev/null @@ -1,57 +0,0 @@ -export class chartV121644328606241 { - name = "chartV121644328606241"; - - async up(queryRunner) { - await queryRunner.query( - `ALTER TABLE "__chart__notes" ADD "___local_diffs_withFile" integer NOT NULL DEFAULT '0'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__notes" ADD "___remote_diffs_withFile" integer NOT NULL DEFAULT '0'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__notes" ADD "___local_diffs_withFile" integer NOT NULL DEFAULT '0'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__notes" ADD "___remote_diffs_withFile" integer NOT NULL DEFAULT '0'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__instance" ADD "___notes_diffs_withFile" integer NOT NULL DEFAULT '0'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__instance" ADD "___notes_diffs_withFile" integer NOT NULL DEFAULT '0'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__per_user_notes" ADD "___diffs_withFile" smallint NOT NULL DEFAULT '0'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__per_user_notes" ADD "___diffs_withFile" smallint NOT NULL DEFAULT '0'`, - ); - } - - async down(queryRunner) { - await queryRunner.query( - `ALTER TABLE "__chart_day__per_user_notes" DROP COLUMN "___diffs_withFile"`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__per_user_notes" DROP COLUMN "___diffs_withFile"`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__instance" DROP COLUMN "___notes_diffs_withFile"`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__instance" DROP COLUMN "___notes_diffs_withFile"`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__notes" DROP COLUMN "___remote_diffs_withFile"`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__notes" DROP COLUMN "___local_diffs_withFile"`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__notes" DROP COLUMN "___remote_diffs_withFile"`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__notes" DROP COLUMN "___local_diffs_withFile"`, - ); - } -} diff --git a/packages/backend/migration/1644331238153-chart-v13.js b/packages/backend/migration/1644331238153-chart-v13.js deleted file mode 100644 index cbb1830f50..0000000000 --- a/packages/backend/migration/1644331238153-chart-v13.js +++ /dev/null @@ -1,33 +0,0 @@ -export class chartV131644331238153 { - name = "chartV131644331238153"; - - async up(queryRunner) { - await queryRunner.query( - `ALTER TABLE "__chart__federation" ADD "unique_temp___stalled" character varying array NOT NULL DEFAULT '{}'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__federation" ADD "___stalled" smallint NOT NULL DEFAULT '0'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__federation" ADD "unique_temp___stalled" character varying array NOT NULL DEFAULT '{}'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__federation" ADD "___stalled" smallint NOT NULL DEFAULT '0'`, - ); - } - - async down(queryRunner) { - await queryRunner.query( - `ALTER TABLE "__chart_day__federation" DROP COLUMN "___stalled"`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__federation" DROP COLUMN "unique_temp___stalled"`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__federation" DROP COLUMN "___stalled"`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__federation" DROP COLUMN "unique_temp___stalled"`, - ); - } -} diff --git a/packages/backend/migration/1644344266289-chart-v14.js b/packages/backend/migration/1644344266289-chart-v14.js deleted file mode 100644 index 6e6c030833..0000000000 --- a/packages/backend/migration/1644344266289-chart-v14.js +++ /dev/null @@ -1,117 +0,0 @@ -export class chartV141644344266289 { - name = "chartV141644344266289"; - - async up(queryRunner) { - await queryRunner.query( - `ALTER TABLE "__chart__active_users" DROP COLUMN "unique_temp___users"`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__active_users" DROP COLUMN "___users"`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__active_users" DROP COLUMN "unique_temp___notedUsers"`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__active_users" DROP COLUMN "___notedUsers"`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__active_users" DROP COLUMN "unique_temp___users"`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__active_users" DROP COLUMN "___users"`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__active_users" DROP COLUMN "unique_temp___notedUsers"`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__active_users" DROP COLUMN "___notedUsers"`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__active_users" ADD "___readWrite" smallint NOT NULL DEFAULT '0'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__active_users" ADD "unique_temp___read" character varying array NOT NULL DEFAULT '{}'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__active_users" ADD "___read" smallint NOT NULL DEFAULT '0'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__active_users" ADD "unique_temp___write" character varying array NOT NULL DEFAULT '{}'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__active_users" ADD "___write" smallint NOT NULL DEFAULT '0'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__active_users" ADD "___readWrite" smallint NOT NULL DEFAULT '0'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__active_users" ADD "unique_temp___read" character varying array NOT NULL DEFAULT '{}'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__active_users" ADD "___read" smallint NOT NULL DEFAULT '0'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__active_users" ADD "unique_temp___write" character varying array NOT NULL DEFAULT '{}'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__active_users" ADD "___write" smallint NOT NULL DEFAULT '0'`, - ); - } - - async down(queryRunner) { - await queryRunner.query( - `ALTER TABLE "__chart_day__active_users" DROP COLUMN "___write"`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__active_users" DROP COLUMN "unique_temp___write"`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__active_users" DROP COLUMN "___read"`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__active_users" DROP COLUMN "unique_temp___read"`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__active_users" DROP COLUMN "___readWrite"`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__active_users" DROP COLUMN "___write"`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__active_users" DROP COLUMN "unique_temp___write"`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__active_users" DROP COLUMN "___read"`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__active_users" DROP COLUMN "unique_temp___read"`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__active_users" DROP COLUMN "___readWrite"`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__active_users" ADD "___notedUsers" smallint NOT NULL DEFAULT '0'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__active_users" ADD "unique_temp___notedUsers" character varying array NOT NULL DEFAULT '{}'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__active_users" ADD "___users" integer NOT NULL DEFAULT '0'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__active_users" ADD "unique_temp___users" character varying array NOT NULL DEFAULT '{}'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__active_users" ADD "___notedUsers" smallint NOT NULL DEFAULT '0'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__active_users" ADD "unique_temp___notedUsers" character varying array NOT NULL DEFAULT '{}'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__active_users" ADD "___users" integer NOT NULL DEFAULT '0'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__active_users" ADD "unique_temp___users" character varying array NOT NULL DEFAULT '{}'`, - ); - } -} diff --git a/packages/backend/migration/1644395759931-instance-theme-color.js b/packages/backend/migration/1644395759931-instance-theme-color.js deleted file mode 100644 index 1e0ee04bc2..0000000000 --- a/packages/backend/migration/1644395759931-instance-theme-color.js +++ /dev/null @@ -1,13 +0,0 @@ -export class instanceThemeColor1644395759931 { - name = "instanceThemeColor1644395759931"; - - async up(queryRunner) { - await queryRunner.query( - `ALTER TABLE "meta" ADD "themeColor" character varying(512)`, - ); - } - - async down(queryRunner) { - await queryRunner.query(`ALTER TABLE "meta" DROP COLUMN "themeColor"`); - } -} diff --git a/packages/backend/migration/1644481657998-chart-v15.js b/packages/backend/migration/1644481657998-chart-v15.js deleted file mode 100644 index a8e1b89cb1..0000000000 --- a/packages/backend/migration/1644481657998-chart-v15.js +++ /dev/null @@ -1,69 +0,0 @@ -export class chartV151644481657998 { - name = "chartV151644481657998"; - - async up(queryRunner) { - await queryRunner.query( - `ALTER TABLE "__chart__federation" DROP COLUMN "___instance_total"`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__federation" DROP COLUMN "___instance_inc"`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__federation" DROP COLUMN "___instance_dec"`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__federation" DROP COLUMN "___instance_total"`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__federation" DROP COLUMN "___instance_inc"`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__federation" DROP COLUMN "___instance_dec"`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__federation" ADD "___sub" smallint NOT NULL DEFAULT '0'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__federation" ADD "___pub" smallint NOT NULL DEFAULT '0'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__federation" ADD "___sub" smallint NOT NULL DEFAULT '0'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__federation" ADD "___pub" smallint NOT NULL DEFAULT '0'`, - ); - } - - async down(queryRunner) { - await queryRunner.query( - `ALTER TABLE "__chart_day__federation" DROP COLUMN "___pub"`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__federation" DROP COLUMN "___sub"`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__federation" DROP COLUMN "___pub"`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__federation" DROP COLUMN "___sub"`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__federation" ADD "___instance_dec" smallint NOT NULL DEFAULT '0'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__federation" ADD "___instance_inc" smallint NOT NULL DEFAULT '0'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__federation" ADD "___instance_total" integer NOT NULL DEFAULT '0'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__federation" ADD "___instance_dec" smallint NOT NULL DEFAULT '0'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__federation" ADD "___instance_inc" smallint NOT NULL DEFAULT '0'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__federation" ADD "___instance_total" integer NOT NULL DEFAULT '0'`, - ); - } -} diff --git a/packages/backend/migration/1644551208096-following-indexes.js b/packages/backend/migration/1644551208096-following-indexes.js deleted file mode 100644 index b06f764e58..0000000000 --- a/packages/backend/migration/1644551208096-following-indexes.js +++ /dev/null @@ -1,21 +0,0 @@ -export class followingIndexes1644551208096 { - name = "followingIndexes1644551208096"; - - async up(queryRunner) { - await queryRunner.query( - `CREATE INDEX "IDX_4ccd2239268ebbd1b35e318754" ON "following" ("followerHost") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_fcdafee716dfe9c3b5fde90f30" ON "following" ("followeeHost") `, - ); - } - - async down(queryRunner) { - await queryRunner.query( - `DROP INDEX "public"."IDX_fcdafee716dfe9c3b5fde90f30"`, - ); - await queryRunner.query( - `DROP INDEX "public"."IDX_4ccd2239268ebbd1b35e318754"`, - ); - } -} diff --git a/packages/backend/migration/1645340161439-remove-max-note-text-length.js b/packages/backend/migration/1645340161439-remove-max-note-text-length.js deleted file mode 100644 index d17ef8c124..0000000000 --- a/packages/backend/migration/1645340161439-remove-max-note-text-length.js +++ /dev/null @@ -1,15 +0,0 @@ -export class removeMaxNoteTextLength1645340161439 { - name = "removeMaxNoteTextLength1645340161439"; - - async up(queryRunner) { - await queryRunner.query( - `ALTER TABLE "meta" DROP COLUMN "maxNoteTextLength"`, - ); - } - - async down(queryRunner) { - await queryRunner.query( - `ALTER TABLE "meta" ADD "maxNoteTextLength" integer NOT NULL DEFAULT '500'`, - ); - } -} diff --git a/packages/backend/migration/1645599900873-federation-chart-pubsub.js b/packages/backend/migration/1645599900873-federation-chart-pubsub.js deleted file mode 100644 index 58e2b4c00d..0000000000 --- a/packages/backend/migration/1645599900873-federation-chart-pubsub.js +++ /dev/null @@ -1,21 +0,0 @@ -export class federationChartPubsub1645599900873 { - name = "federationChartPubsub1645599900873"; - - async up(queryRunner) { - await queryRunner.query( - `ALTER TABLE "__chart__federation" ADD "___pubsub" smallint NOT NULL DEFAULT '0'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__federation" ADD "___pubsub" smallint NOT NULL DEFAULT '0'`, - ); - } - - async down(queryRunner) { - await queryRunner.query( - `ALTER TABLE "__chart_day__federation" DROP COLUMN "___pubsub"`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__federation" DROP COLUMN "___pubsub"`, - ); - } -} diff --git a/packages/backend/migration/1646143552768-instance-default-theme.js b/packages/backend/migration/1646143552768-instance-default-theme.js deleted file mode 100644 index d97efcaa6e..0000000000 --- a/packages/backend/migration/1646143552768-instance-default-theme.js +++ /dev/null @@ -1,21 +0,0 @@ -export class instanceDefaultTheme1646143552768 { - name = "instanceDefaultTheme1646143552768"; - - async up(queryRunner) { - await queryRunner.query( - `ALTER TABLE "meta" ADD "defaultLightTheme" character varying(8192)`, - ); - await queryRunner.query( - `ALTER TABLE "meta" ADD "defaultDarkTheme" character varying(8192)`, - ); - } - - async down(queryRunner) { - await queryRunner.query( - `ALTER TABLE "meta" DROP COLUMN "defaultDarkTheme"`, - ); - await queryRunner.query( - `ALTER TABLE "meta" DROP COLUMN "defaultLightTheme"`, - ); - } -} diff --git a/packages/backend/migration/1646387162108-mute-expires-at.js b/packages/backend/migration/1646387162108-mute-expires-at.js deleted file mode 100644 index 52fe101bd1..0000000000 --- a/packages/backend/migration/1646387162108-mute-expires-at.js +++ /dev/null @@ -1,19 +0,0 @@ -export class muteExpiresAt1646387162108 { - name = "muteExpiresAt1646387162108"; - - async up(queryRunner) { - await queryRunner.query( - `ALTER TABLE "muting" ADD "expiresAt" TIMESTAMP WITH TIME ZONE`, - ); - await queryRunner.query( - `CREATE INDEX "IDX_c1fd1c3dfb0627aa36c253fd14" ON "muting" ("expiresAt") `, - ); - } - - async down(queryRunner) { - await queryRunner.query( - `DROP INDEX "public"."IDX_c1fd1c3dfb0627aa36c253fd14"`, - ); - await queryRunner.query(`ALTER TABLE "muting" DROP COLUMN "expiresAt"`); - } -} diff --git a/packages/backend/migration/1646549089451-poll-ended-notification.js b/packages/backend/migration/1646549089451-poll-ended-notification.js deleted file mode 100644 index cc96a62a7e..0000000000 --- a/packages/backend/migration/1646549089451-poll-ended-notification.js +++ /dev/null @@ -1,29 +0,0 @@ -export class pollEndedNotification1646549089451 { - name = "pollEndedNotification1646549089451"; - - async up(queryRunner) { - await queryRunner.query( - `ALTER TYPE "public"."notification_type_enum" RENAME TO "notification_type_enum_old"`, - ); - await queryRunner.query( - `CREATE TYPE "public"."notification_type_enum" AS ENUM('follow', 'mention', 'reply', 'renote', 'quote', 'reaction', 'pollVote', 'pollEnded', 'receiveFollowRequest', 'followRequestAccepted', 'groupInvited', 'app')`, - ); - await queryRunner.query( - `ALTER TABLE "notification" ALTER COLUMN "type" TYPE "public"."notification_type_enum" USING "type"::"text"::"public"."notification_type_enum"`, - ); - await queryRunner.query(`DROP TYPE "public"."notification_type_enum_old"`); - } - - async down(queryRunner) { - await queryRunner.query( - `CREATE TYPE "public"."notification_type_enum_old" AS ENUM('follow', 'mention', 'reply', 'renote', 'quote', 'reaction', 'pollVote', 'receiveFollowRequest', 'followRequestAccepted', 'groupInvited', 'app')`, - ); - await queryRunner.query( - `ALTER TABLE "notification" ALTER COLUMN "type" TYPE "public"."notification_type_enum_old" USING "type"::"text"::"public"."notification_type_enum_old"`, - ); - await queryRunner.query(`DROP TYPE "public"."notification_type_enum"`); - await queryRunner.query( - `ALTER TYPE "public"."notification_type_enum_old" RENAME TO "notification_type_enum"`, - ); - } -} diff --git a/packages/backend/migration/1646633030285-chart-federation-active.js b/packages/backend/migration/1646633030285-chart-federation-active.js deleted file mode 100644 index 3cb2dffe3f..0000000000 --- a/packages/backend/migration/1646633030285-chart-federation-active.js +++ /dev/null @@ -1,21 +0,0 @@ -export class chartFederationActive1646633030285 { - name = "chartFederationActive1646633030285"; - - async up(queryRunner) { - await queryRunner.query( - `ALTER TABLE "__chart__federation" ADD "___active" smallint NOT NULL DEFAULT '0'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__federation" ADD "___active" smallint NOT NULL DEFAULT '0'`, - ); - } - - async down(queryRunner) { - await queryRunner.query( - `ALTER TABLE "__chart_day__federation" DROP COLUMN "___active"`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__federation" DROP COLUMN "___active"`, - ); - } -} diff --git a/packages/backend/migration/1646655454495-remove-instance-drive-columns.js b/packages/backend/migration/1646655454495-remove-instance-drive-columns.js deleted file mode 100644 index 12f56bc2d7..0000000000 --- a/packages/backend/migration/1646655454495-remove-instance-drive-columns.js +++ /dev/null @@ -1,17 +0,0 @@ -export class removeInstanceDriveColumns1646655454495 { - name = "removeInstanceDriveColumns1646655454495"; - - async up(queryRunner) { - await queryRunner.query(`ALTER TABLE "instance" DROP COLUMN "driveUsage"`); - await queryRunner.query(`ALTER TABLE "instance" DROP COLUMN "driveFiles"`); - } - - async down(queryRunner) { - await queryRunner.query( - `ALTER TABLE "instance" ADD "driveFiles" integer NOT NULL DEFAULT '0'`, - ); - await queryRunner.query( - `ALTER TABLE "instance" ADD "driveUsage" bigint NOT NULL DEFAULT '0'`, - ); - } -} diff --git a/packages/backend/migration/1646732390560-chart-federation-active-sub-pub.js b/packages/backend/migration/1646732390560-chart-federation-active-sub-pub.js deleted file mode 100644 index e34b9a22e9..0000000000 --- a/packages/backend/migration/1646732390560-chart-federation-active-sub-pub.js +++ /dev/null @@ -1,45 +0,0 @@ -export class chartFederationActiveSubPub1646732390560 { - name = "chartFederationActiveSubPub1646732390560"; - - async up(queryRunner) { - await queryRunner.query( - `ALTER TABLE "__chart__federation" DROP COLUMN "___active"`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__federation" DROP COLUMN "___active"`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__federation" ADD "___subActive" smallint NOT NULL DEFAULT '0'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__federation" ADD "___pubActive" smallint NOT NULL DEFAULT '0'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__federation" ADD "___subActive" smallint NOT NULL DEFAULT '0'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__federation" ADD "___pubActive" smallint NOT NULL DEFAULT '0'`, - ); - } - - async down(queryRunner) { - await queryRunner.query( - `ALTER TABLE "__chart_day__federation" DROP COLUMN "___pubActive"`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__federation" DROP COLUMN "___subActive"`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__federation" DROP COLUMN "___pubActive"`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__federation" DROP COLUMN "___subActive"`, - ); - await queryRunner.query( - `ALTER TABLE "__chart_day__federation" ADD "___active" smallint NOT NULL DEFAULT '0'`, - ); - await queryRunner.query( - `ALTER TABLE "__chart__federation" ADD "___active" smallint NOT NULL DEFAULT '0'`, - ); - } -} diff --git a/packages/backend/migration/1648548247382-webhook.js b/packages/backend/migration/1648548247382-webhook.js deleted file mode 100644 index 3e7160e2b2..0000000000 --- a/packages/backend/migration/1648548247382-webhook.js +++ /dev/null @@ -1,37 +0,0 @@ -export class webhook1648548247382 { - name = "webhook1648548247382"; - - async up(queryRunner) { - await queryRunner.query( - `CREATE TABLE "webhook" ("id" character varying(32) NOT NULL, "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL, "userId" character varying(32) NOT NULL, "name" character varying(128) NOT NULL, "on" character varying(128) array NOT NULL DEFAULT '{}', "url" character varying(1024) NOT NULL, "secret" character varying(1024) NOT NULL, "active" boolean NOT NULL DEFAULT true, CONSTRAINT "PK_e6765510c2d078db49632b59020" PRIMARY KEY ("id")); COMMENT ON COLUMN "webhook"."createdAt" IS 'The created date of the Antenna.'; COMMENT ON COLUMN "webhook"."userId" IS 'The owner ID.'; COMMENT ON COLUMN "webhook"."name" IS 'The name of the Antenna.'`, - ); - await queryRunner.query( - `CREATE INDEX "IDX_f272c8c8805969e6a6449c77b3" ON "webhook" ("userId") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_8063a0586ed1dfbe86e982d961" ON "webhook" ("on") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_5a056076f76b2efe08216ba655" ON "webhook" ("active") `, - ); - await queryRunner.query( - `ALTER TABLE "webhook" ADD CONSTRAINT "FK_f272c8c8805969e6a6449c77b3c" FOREIGN KEY ("userId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, - ); - } - - async down(queryRunner) { - await queryRunner.query( - `ALTER TABLE "webhook" DROP CONSTRAINT "FK_f272c8c8805969e6a6449c77b3c"`, - ); - await queryRunner.query( - `DROP INDEX "public"."IDX_5a056076f76b2efe08216ba655"`, - ); - await queryRunner.query( - `DROP INDEX "public"."IDX_8063a0586ed1dfbe86e982d961"`, - ); - await queryRunner.query( - `DROP INDEX "public"."IDX_f272c8c8805969e6a6449c77b3"`, - ); - await queryRunner.query(`DROP TABLE "webhook"`); - } -} diff --git a/packages/backend/migration/1648816172177-webhook-2.js b/packages/backend/migration/1648816172177-webhook-2.js deleted file mode 100644 index a4ab4ef8f8..0000000000 --- a/packages/backend/migration/1648816172177-webhook-2.js +++ /dev/null @@ -1,15 +0,0 @@ -export class webhook21648816172177 { - name = "webhook21648816172177"; - - async up(queryRunner) { - await queryRunner.query( - `ALTER TABLE "webhook" ADD "latestSentAt" TIMESTAMP WITH TIME ZONE`, - ); - await queryRunner.query(`ALTER TABLE "webhook" ADD "latestStatus" integer`); - } - - async down(queryRunner) { - await queryRunner.query(`ALTER TABLE "webhook" DROP COLUMN "latestStatus"`); - await queryRunner.query(`ALTER TABLE "webhook" DROP COLUMN "latestSentAt"`); - } -} diff --git a/packages/backend/migration/1651224615271-foreign-key.js b/packages/backend/migration/1651224615271-foreign-key.js deleted file mode 100644 index 7e6bc79623..0000000000 --- a/packages/backend/migration/1651224615271-foreign-key.js +++ /dev/null @@ -1,187 +0,0 @@ -export class foreignKeyReports1651224615271 { - name = "foreignKeyReports1651224615271"; - - async up(queryRunner) { - await Promise.all([ - queryRunner.query( - `ALTER INDEX "public"."IDX_seoignmeoprigmkpodgrjmkpormg" RENAME TO "IDX_c8cc87bd0f2f4487d17c651fbf"`, - ), - queryRunner.query( - `DROP INDEX "public"."IDX_note_on_channelId_and_id_desc"`, - ), - - // remove unnecessary default null, see also down - queryRunner.query( - `ALTER TABLE "user" ALTER COLUMN "followersUri" DROP DEFAULT`, - ), - queryRunner.query( - `ALTER TABLE "access_token" ALTER COLUMN "session" DROP DEFAULT`, - ), - queryRunner.query( - `ALTER TABLE "access_token" ALTER COLUMN "appId" DROP DEFAULT`, - ), - queryRunner.query( - `ALTER TABLE "access_token" ALTER COLUMN "name" DROP DEFAULT`, - ), - queryRunner.query( - `ALTER TABLE "access_token" ALTER COLUMN "description" DROP DEFAULT`, - ), - queryRunner.query( - `ALTER TABLE "access_token" ALTER COLUMN "iconUrl" DROP DEFAULT`, - ), - queryRunner.query( - `ALTER TABLE "instance" ALTER COLUMN "softwareName" DROP DEFAULT`, - ), - queryRunner.query( - `ALTER TABLE "instance" ALTER COLUMN "softwareVersion" DROP DEFAULT`, - ), - queryRunner.query( - `ALTER TABLE "instance" ALTER COLUMN "name" DROP DEFAULT`, - ), - queryRunner.query( - `ALTER TABLE "instance" ALTER COLUMN "description" DROP DEFAULT`, - ), - queryRunner.query( - `ALTER TABLE "instance" ALTER COLUMN "maintainerName" DROP DEFAULT`, - ), - queryRunner.query( - `ALTER TABLE "instance" ALTER COLUMN "maintainerEmail" DROP DEFAULT`, - ), - queryRunner.query( - `ALTER TABLE "instance" ALTER COLUMN "iconUrl" DROP DEFAULT`, - ), - queryRunner.query( - `ALTER TABLE "instance" ALTER COLUMN "faviconUrl" DROP DEFAULT`, - ), - queryRunner.query( - `ALTER TABLE "instance" ALTER COLUMN "themeColor" DROP DEFAULT`, - ), - queryRunner.query( - `ALTER TABLE "clip" ALTER COLUMN "description" DROP DEFAULT`, - ), - queryRunner.query( - `ALTER TABLE "note" ALTER COLUMN "channelId" DROP DEFAULT`, - ), - queryRunner.query( - `ALTER TABLE "abuse_user_report" ALTER COLUMN "comment" DROP DEFAULT`, - ), - - queryRunner.query( - `CREATE INDEX "IDX_315c779174fe8247ab324f036e" ON "drive_file" ("isLink")`, - ), - queryRunner.query( - `CREATE INDEX "IDX_f22169eb10657bded6d875ac8f" ON "note" ("channelId")`, - ), - //queryRunner.query(`CREATE INDEX "IDX_a9021cc2e1feb5f72d3db6e9f5" ON "abuse_user_report" ("targetUserId")`), - - //queryRunner.query(`DELETE FROM "abuse_user_report" WHERE "targetUserId" NOT IN (SELECT "id" FROM "user")`).then(() => { - // queryRunner.query(`ALTER TABLE "abuse_user_report" ADD CONSTRAINT "FK_a9021cc2e1feb5f72d3db6e9f5f" FOREIGN KEY ("targetUserId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE NO ACTION`); - //}), - - queryRunner.query( - `ALTER TABLE "poll" ADD CONSTRAINT "UQ_da851e06d0dfe2ef397d8b1bf1b" UNIQUE ("noteId")`, - ), - queryRunner.query( - `ALTER TABLE "user_keypair" ADD CONSTRAINT "UQ_f4853eb41ab722fe05f81cedeb6" UNIQUE ("userId")`, - ), - queryRunner.query( - `ALTER TABLE "user_profile" ADD CONSTRAINT "UQ_51cb79b5555effaf7d69ba1cff9" UNIQUE ("userId")`, - ), - queryRunner.query( - `ALTER TABLE "user_publickey" ADD CONSTRAINT "UQ_10c146e4b39b443ede016f6736d" UNIQUE ("userId")`, - ), - queryRunner.query( - `ALTER TABLE "promo_note" ADD CONSTRAINT "UQ_e263909ca4fe5d57f8d4230dd5c" UNIQUE ("noteId")`, - ), - - queryRunner.query( - `ALTER TABLE "page" RENAME CONSTRAINT "FK_3126dd7c502c9e4d7597ef7ef10" TO "FK_a9ca79ad939bf06066b81c9d3aa"`, - ), - - queryRunner.query( - `ALTER TYPE "public"."user_profile_mutingnotificationtypes_enum" ADD VALUE 'pollEnded' AFTER 'pollVote'`, - ), - ]); - } - - async down(queryRunner) { - await Promise.all([ - // There is no ALTER TYPE REMOVE VALUE query, so the reverse operation is a bit more complex - queryRunner - .query( - `UPDATE "user_profile" SET "mutingNotificationTypes" = array_remove("mutingNotificationTypes", 'pollEnded')`, - ) - .then(() => - queryRunner.query( - `CREATE TYPE "public"."user_profile_mutingnotificationtypes_enum_old" AS ENUM('follow', 'mention', 'reply', 'renote', 'quote', 'reaction', 'pollVote', 'receiveFollowRequest', 'followRequestAccepted', 'groupInvited', 'app')`, - ), - ) - .then(() => - queryRunner.query( - `ALTER TABLE "user_profile" ALTER COLUMN "mutingNotificationTypes" DROP DEFAULT`, - ), - ) - .then(() => - queryRunner.query( - `ALTER TABLE "user_profile" ALTER COLUMN "mutingNotificationTypes" TYPE "public"."user_profile_mutingnotificationtypes_enum_old"[] USING "mutingNotificationTypes"::"text"::"public"."user_profile_mutingnotificationtypes_enum_old"[]`, - ), - ) - .then(() => - queryRunner.query( - `ALTER TABLE "user_profile" ALTER COLUMN "mutingNotificationTypes" SET DEFAULT '{}'`, - ), - ) - .then(() => - queryRunner.query( - `DROP TYPE "public"."user_profile_mutingnotificationtypes_enum"`, - ), - ) - .then(() => - queryRunner.query( - `ALTER TYPE "public"."user_profile_mutingnotificationtypes_enum_old" RENAME TO "user_profile_mutingnotificationtypes_enum"`, - ), - ), - - queryRunner.query( - `ALTER TABLE "page" RENAME CONSTRAINT "FK_a9ca79ad939bf06066b81c9d3aa" TO "FK_3126dd7c502c9e4d7597ef7ef10"`, - ), - - queryRunner.query( - `ALTER TABLE "promo_note" DROP CONSTRAINT "UQ_e263909ca4fe5d57f8d4230dd5c"`, - ), - queryRunner.query( - `ALTER TABLE "user_publickey" DROP CONSTRAINT "UQ_10c146e4b39b443ede016f6736d"`, - ), - queryRunner.query( - `ALTER TABLE "user_profile" DROP CONSTRAINT "UQ_51cb79b5555effaf7d69ba1cff9"`, - ), - queryRunner.query( - `ALTER TABLE "user_keypair" DROP CONSTRAINT "UQ_f4853eb41ab722fe05f81cedeb6"`, - ), - queryRunner.query( - `ALTER TABLE "poll" DROP CONSTRAINT "UQ_da851e06d0dfe2ef397d8b1bf1b"`, - ), - - queryRunner.query( - `ALTER TABLE "abuse_user_report" ALTER COLUMN "comment" SET DEFAULT '{}'`, - ), - queryRunner.query( - `ALTER TABLE "abuse_user_report" DROP CONSTRAINT "FK_a9021cc2e1feb5f72d3db6e9f5f"`, - ), - - queryRunner.query(`DROP INDEX "public"."IDX_a9021cc2e1feb5f72d3db6e9f5"`), - queryRunner.query(`DROP INDEX "public"."IDX_f22169eb10657bded6d875ac8f"`), - queryRunner.query(`DROP INDEX "public"."IDX_315c779174fe8247ab324f036e"`), - - /* DEFAULT's are not set again because if the column can be NULL, then DEFAULT NULL is not necessary. - see also https://github.com/typeorm/typeorm/issues/7579#issuecomment-835423615 */ - - queryRunner.query( - `CREATE INDEX "IDX_note_on_channelId_and_id_desc" ON "note" ("id", "channelId") `, - ), - queryRunner.query( - `ALTER INDEX "public"."IDX_c8cc87bd0f2f4487d17c651fbf" RENAME TO "IDX_seoignmeoprigmkpodgrjmkpormg"`, - ), - ]); - } -} diff --git a/packages/backend/migration/1652859567549-uniform-themecolor.js b/packages/backend/migration/1652859567549-uniform-themecolor.js deleted file mode 100644 index 8c91854d53..0000000000 --- a/packages/backend/migration/1652859567549-uniform-themecolor.js +++ /dev/null @@ -1,51 +0,0 @@ -import tinycolor from "tinycolor2"; - -export class uniformThemecolor1652859567549 { - name = "uniformThemecolor1652859567549"; - - async up(queryRunner) { - const formatColor = (color) => { - let tc = new tinycolor(color); - if (tc.isValid()) { - return tc.toHexString(); - } else { - return null; - } - }; - - await queryRunner - .query( - 'SELECT "id", "themeColor" FROM "instance" WHERE "themeColor" IS NOT NULL', - ) - .then((instances) => - Promise.all( - instances.map((instance) => { - // update theme color to uniform format, e.g. #00ff00 - // invalid theme colors get set to null - return queryRunner.query( - 'UPDATE "instance" SET "themeColor" = $1 WHERE "id" = $2', - [formatColor(instance.themeColor), instance.id], - ); - }), - ), - ); - - // also fix own theme color - await queryRunner - .query( - 'SELECT "themeColor" FROM "meta" WHERE "themeColor" IS NOT NULL LIMIT 1', - ) - .then((metas) => { - if (metas.length > 0) { - return queryRunner.query('UPDATE "meta" SET "themeColor" = $1', [ - formatColor(metas[0].themeColor), - ]); - } - }); - } - - async down(queryRunner) { - // The original representation is not stored, so migrating back is not possible. - // The new format also works in older versions so this is not a problem. - } -} diff --git a/packages/backend/migration/1655368940105-nsfw-detection.js b/packages/backend/migration/1655368940105-nsfw-detection.js deleted file mode 100644 index f1bcda50e5..0000000000 --- a/packages/backend/migration/1655368940105-nsfw-detection.js +++ /dev/null @@ -1,51 +0,0 @@ -export class nsfwDetection1655368940105 { - name = "nsfwDetection1655368940105"; - - async up(queryRunner) { - await queryRunner.query( - `ALTER TABLE "drive_file" ADD "forceIsSensitive" boolean NOT NULL DEFAULT false`, - ); - await queryRunner.query( - `ALTER TABLE "drive_file" ADD "predictedIsSensitive" boolean NOT NULL DEFAULT false`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "drive_file"."predictedIsSensitive" IS 'Whether the DriveFile is NSFW. (predict)'`, - ); - await queryRunner.query( - `CREATE TYPE "public"."meta_sensitiveimagedetection_enum" AS ENUM('none', 'all', 'local', 'remote')`, - ); - await queryRunner.query( - `ALTER TABLE "meta" ADD "sensitiveImageDetection" "public"."meta_sensitiveimagedetection_enum" NOT NULL DEFAULT 'none'`, - ); - await queryRunner.query( - `ALTER TABLE "meta" ADD "forceIsSensitiveWhenPredicted" boolean NOT NULL DEFAULT true`, - ); - await queryRunner.query( - `CREATE INDEX "IDX_fc2d74a6d7d8b11292a851d8f8" ON "drive_file" ("predictedIsSensitive") `, - ); - } - - async down(queryRunner) { - await queryRunner.query( - `DROP INDEX "public"."IDX_fc2d74a6d7d8b11292a851d8f8"`, - ); - await queryRunner.query( - `ALTER TABLE "meta" DROP COLUMN "forceIsSensitiveWhenPredicted"`, - ); - await queryRunner.query( - `ALTER TABLE "meta" DROP COLUMN "sensitiveImageDetection"`, - ); - await queryRunner.query( - `DROP TYPE "public"."meta_sensitiveimagedetection_enum"`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "drive_file"."predictedIsSensitive" IS 'Whether the DriveFile is NSFW. (predict)'`, - ); - await queryRunner.query( - `ALTER TABLE "drive_file" DROP COLUMN "predictedIsSensitive"`, - ); - await queryRunner.query( - `ALTER TABLE "drive_file" DROP COLUMN "forceIsSensitive"`, - ); - } -} diff --git a/packages/backend/migration/1655371960534-nsfw-detection-2.js b/packages/backend/migration/1655371960534-nsfw-detection-2.js deleted file mode 100644 index 236cd70913..0000000000 --- a/packages/backend/migration/1655371960534-nsfw-detection-2.js +++ /dev/null @@ -1,27 +0,0 @@ -export class nsfwDetection21655371960534 { - name = "nsfwDetection21655371960534"; - - async up(queryRunner) { - await queryRunner.query( - `CREATE TYPE "public"."meta_sensitiveimagedetectionsensitivity_enum" AS ENUM('medium', 'low', 'high')`, - ); - await queryRunner.query( - `ALTER TABLE "meta" ADD "sensitiveImageDetectionSensitivity" "public"."meta_sensitiveimagedetectionsensitivity_enum" NOT NULL DEFAULT 'medium'`, - ); - await queryRunner.query( - `ALTER TABLE "meta" ADD "disallowUploadWhenPredictedAsPorn" boolean NOT NULL DEFAULT false`, - ); - } - - async down(queryRunner) { - await queryRunner.query( - `ALTER TABLE "meta" DROP COLUMN "disallowUploadWhenPredictedAsPorn"`, - ); - await queryRunner.query( - `ALTER TABLE "meta" DROP COLUMN "sensitiveImageDetectionSensitivity"`, - ); - await queryRunner.query( - `DROP TYPE "public"."meta_sensitiveimagedetectionsensitivity_enum"`, - ); - } -} diff --git a/packages/backend/migration/1655388169582-nsfw-detection-3.js b/packages/backend/migration/1655388169582-nsfw-detection-3.js deleted file mode 100644 index 6a6ceeafba..0000000000 --- a/packages/backend/migration/1655388169582-nsfw-detection-3.js +++ /dev/null @@ -1,45 +0,0 @@ -export class nsfwDetection31655388169582 { - name = "nsfwDetection31655388169582"; - - async up(queryRunner) { - await queryRunner.query( - `ALTER TYPE "public"."meta_sensitiveimagedetectionsensitivity_enum" RENAME TO "meta_sensitiveimagedetectionsensitivity_enum_old"`, - ); - await queryRunner.query( - `CREATE TYPE "public"."meta_sensitiveimagedetectionsensitivity_enum" AS ENUM('medium', 'low', 'high', 'veryLow', 'veryHigh')`, - ); - await queryRunner.query( - `ALTER TABLE "meta" ALTER COLUMN "sensitiveImageDetectionSensitivity" DROP DEFAULT`, - ); - await queryRunner.query( - `ALTER TABLE "meta" ALTER COLUMN "sensitiveImageDetectionSensitivity" TYPE "public"."meta_sensitiveimagedetectionsensitivity_enum" USING "sensitiveImageDetectionSensitivity"::"text"::"public"."meta_sensitiveimagedetectionsensitivity_enum"`, - ); - await queryRunner.query( - `ALTER TABLE "meta" ALTER COLUMN "sensitiveImageDetectionSensitivity" SET DEFAULT 'medium'`, - ); - await queryRunner.query( - `DROP TYPE "public"."meta_sensitiveimagedetectionsensitivity_enum_old"`, - ); - } - - async down(queryRunner) { - await queryRunner.query( - `CREATE TYPE "public"."meta_sensitiveimagedetectionsensitivity_enum_old" AS ENUM('medium', 'low', 'high')`, - ); - await queryRunner.query( - `ALTER TABLE "meta" ALTER COLUMN "sensitiveImageDetectionSensitivity" DROP DEFAULT`, - ); - await queryRunner.query( - `ALTER TABLE "meta" ALTER COLUMN "sensitiveImageDetectionSensitivity" TYPE "public"."meta_sensitiveimagedetectionsensitivity_enum_old" USING "sensitiveImageDetectionSensitivity"::"text"::"public"."meta_sensitiveimagedetectionsensitivity_enum_old"`, - ); - await queryRunner.query( - `ALTER TABLE "meta" ALTER COLUMN "sensitiveImageDetectionSensitivity" SET DEFAULT 'medium'`, - ); - await queryRunner.query( - `DROP TYPE "public"."meta_sensitiveimagedetectionsensitivity_enum"`, - ); - await queryRunner.query( - `ALTER TYPE "public"."meta_sensitiveimagedetectionsensitivity_enum_old" RENAME TO "meta_sensitiveimagedetectionsensitivity_enum"`, - ); - } -} diff --git a/packages/backend/migration/1655393015659-nsfw-detection-4.js b/packages/backend/migration/1655393015659-nsfw-detection-4.js deleted file mode 100644 index 3e45897327..0000000000 --- a/packages/backend/migration/1655393015659-nsfw-detection-4.js +++ /dev/null @@ -1,57 +0,0 @@ -export class nsfwDetection41655393015659 { - name = "nsfwDetection41655393015659"; - - async up(queryRunner) { - await queryRunner.query( - `ALTER TABLE "meta" DROP COLUMN "sensitiveImageDetection"`, - ); - await queryRunner.query( - `DROP TYPE "public"."meta_sensitiveimagedetection_enum"`, - ); - await queryRunner.query( - `ALTER TABLE "meta" DROP COLUMN "sensitiveImageDetectionSensitivity"`, - ); - await queryRunner.query( - `DROP TYPE "public"."meta_sensitiveimagedetectionsensitivity_enum"`, - ); - await queryRunner.query( - `CREATE TYPE "public"."meta_sensitivemediadetection_enum" AS ENUM('none', 'all', 'local', 'remote')`, - ); - await queryRunner.query( - `ALTER TABLE "meta" ADD "sensitiveMediaDetection" "public"."meta_sensitivemediadetection_enum" NOT NULL DEFAULT 'none'`, - ); - await queryRunner.query( - `CREATE TYPE "public"."meta_sensitivemediadetectionsensitivity_enum" AS ENUM('medium', 'low', 'high', 'veryLow', 'veryHigh')`, - ); - await queryRunner.query( - `ALTER TABLE "meta" ADD "sensitiveMediaDetectionSensitivity" "public"."meta_sensitivemediadetectionsensitivity_enum" NOT NULL DEFAULT 'medium'`, - ); - } - - async down(queryRunner) { - await queryRunner.query( - `ALTER TABLE "meta" DROP COLUMN "sensitiveMediaDetectionSensitivity"`, - ); - await queryRunner.query( - `DROP TYPE "public"."meta_sensitivemediadetectionsensitivity_enum"`, - ); - await queryRunner.query( - `ALTER TABLE "meta" DROP COLUMN "sensitiveMediaDetection"`, - ); - await queryRunner.query( - `DROP TYPE "public"."meta_sensitivemediadetection_enum"`, - ); - await queryRunner.query( - `CREATE TYPE "public"."meta_sensitiveimagedetectionsensitivity_enum" AS ENUM('medium', 'low', 'high', 'veryLow', 'veryHigh')`, - ); - await queryRunner.query( - `ALTER TABLE "meta" ADD "sensitiveImageDetectionSensitivity" "public"."meta_sensitiveimagedetectionsensitivity_enum" NOT NULL DEFAULT 'medium'`, - ); - await queryRunner.query( - `CREATE TYPE "public"."meta_sensitiveimagedetection_enum" AS ENUM('none', 'all', 'local', 'remote')`, - ); - await queryRunner.query( - `ALTER TABLE "meta" ADD "sensitiveImageDetection" "public"."meta_sensitiveimagedetection_enum" NOT NULL DEFAULT 'none'`, - ); - } -} diff --git a/packages/backend/migration/1655813815729-driveCapacityOverrideMb.js b/packages/backend/migration/1655813815729-driveCapacityOverrideMb.js deleted file mode 100644 index e43f0af5c1..0000000000 --- a/packages/backend/migration/1655813815729-driveCapacityOverrideMb.js +++ /dev/null @@ -1,21 +0,0 @@ -export class driveCapacityOverrideMb1655813815729 { - name = "driveCapacityOverrideMb1655813815729"; - - async up(queryRunner) { - await queryRunner.query( - `ALTER TABLE "user" ADD "driveCapacityOverrideMb" integer`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "user"."driveCapacityOverrideMb" IS 'Overrides user drive capacity limit'`, - ); - } - - async down(queryRunner) { - await queryRunner.query( - `COMMENT ON COLUMN "user"."driveCapacityOverrideMb" IS 'Overrides user drive capacity limit'`, - ); - await queryRunner.query( - `ALTER TABLE "user" DROP COLUMN "driveCapacityOverrideMb"`, - ); - } -} diff --git a/packages/backend/migration/1655918165614-user-ip.js b/packages/backend/migration/1655918165614-user-ip.js deleted file mode 100644 index 2c5dc1c821..0000000000 --- a/packages/backend/migration/1655918165614-user-ip.js +++ /dev/null @@ -1,31 +0,0 @@ -export class userIp1655918165614 { - name = "userIp1655918165614"; - - async up(queryRunner) { - await queryRunner.query( - `CREATE TABLE "user_ip" ("id" SERIAL NOT NULL, "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL, "userId" character varying(32) NOT NULL, "ip" character varying(128) NOT NULL, CONSTRAINT "PK_2c44ddfbf7c0464d028dcef325e" PRIMARY KEY ("id"))`, - ); - await queryRunner.query( - `CREATE INDEX "IDX_7f7f1c66f48e9a8e18a33bc515" ON "user_ip" ("userId") `, - ); - await queryRunner.query( - `CREATE UNIQUE INDEX "IDX_361b500e06721013c124b7b6c5" ON "user_ip" ("userId", "ip") `, - ); - await queryRunner.query( - `ALTER TABLE "user_ip" ADD CONSTRAINT "FK_7f7f1c66f48e9a8e18a33bc5150" FOREIGN KEY ("userId") REFERENCES "user"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`, - ); - } - - async down(queryRunner) { - await queryRunner.query( - `ALTER TABLE "user_ip" DROP CONSTRAINT "FK_7f7f1c66f48e9a8e18a33bc5150"`, - ); - await queryRunner.query( - `DROP INDEX "public"."IDX_361b500e06721013c124b7b6c5"`, - ); - await queryRunner.query( - `DROP INDEX "public"."IDX_7f7f1c66f48e9a8e18a33bc515"`, - ); - await queryRunner.query(`DROP TABLE "user_ip"`); - } -} diff --git a/packages/backend/migration/1656122560740-file-ip.js b/packages/backend/migration/1656122560740-file-ip.js deleted file mode 100644 index 534097adb3..0000000000 --- a/packages/backend/migration/1656122560740-file-ip.js +++ /dev/null @@ -1,19 +0,0 @@ -export class fileIp1656122560740 { - name = "fileIp1656122560740"; - - async up(queryRunner) { - await queryRunner.query( - `ALTER TABLE "drive_file" ADD "requestHeaders" jsonb DEFAULT '{}'`, - ); - await queryRunner.query( - `ALTER TABLE "drive_file" ADD "requestIp" character varying(128)`, - ); - } - - async down(queryRunner) { - await queryRunner.query(`ALTER TABLE "drive_file" DROP COLUMN "requestIp"`); - await queryRunner.query( - `ALTER TABLE "drive_file" DROP COLUMN "requestHeaders"`, - ); - } -} diff --git a/packages/backend/migration/1656251734807-nsfw-detection-5.js b/packages/backend/migration/1656251734807-nsfw-detection-5.js deleted file mode 100644 index 7a2206e018..0000000000 --- a/packages/backend/migration/1656251734807-nsfw-detection-5.js +++ /dev/null @@ -1,79 +0,0 @@ -export class nsfwDetection51656251734807 { - name = "nsfwDetection51656251734807"; - - async up(queryRunner) { - await queryRunner.query( - `DROP INDEX "public"."IDX_fc2d74a6d7d8b11292a851d8f8"`, - ); - await queryRunner.query( - `ALTER TABLE "drive_file" DROP COLUMN "forceIsSensitive"`, - ); - await queryRunner.query( - `ALTER TABLE "drive_file" DROP COLUMN "predictedIsSensitive"`, - ); - await queryRunner.query( - `ALTER TABLE "meta" DROP COLUMN "forceIsSensitiveWhenPredicted"`, - ); - await queryRunner.query( - `ALTER TABLE "meta" DROP COLUMN "disallowUploadWhenPredictedAsPorn"`, - ); - await queryRunner.query( - `ALTER TABLE "drive_file" ADD "maybeSensitive" boolean NOT NULL DEFAULT false`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "drive_file"."maybeSensitive" IS 'Whether the DriveFile is NSFW. (predict)'`, - ); - await queryRunner.query( - `ALTER TABLE "drive_file" ADD "maybePorn" boolean NOT NULL DEFAULT false`, - ); - await queryRunner.query( - `ALTER TABLE "meta" ADD "setSensitiveFlagAutomatically" boolean NOT NULL DEFAULT false`, - ); - await queryRunner.query( - `ALTER TABLE "user_profile" ADD "autoSensitive" boolean NOT NULL DEFAULT false`, - ); - await queryRunner.query( - `CREATE INDEX "IDX_3b33dff77bb64b23c88151d23e" ON "drive_file" ("maybeSensitive") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_8bdcd3dd2bddb78014999a16ce" ON "drive_file" ("maybePorn") `, - ); - } - - async down(queryRunner) { - await queryRunner.query( - `DROP INDEX "public"."IDX_8bdcd3dd2bddb78014999a16ce"`, - ); - await queryRunner.query( - `DROP INDEX "public"."IDX_3b33dff77bb64b23c88151d23e"`, - ); - await queryRunner.query( - `ALTER TABLE "user_profile" DROP COLUMN "autoSensitive"`, - ); - await queryRunner.query( - `ALTER TABLE "meta" DROP COLUMN "setSensitiveFlagAutomatically"`, - ); - await queryRunner.query(`ALTER TABLE "drive_file" DROP COLUMN "maybePorn"`); - await queryRunner.query( - `COMMENT ON COLUMN "drive_file"."maybeSensitive" IS 'Whether the DriveFile is NSFW. (predict)'`, - ); - await queryRunner.query( - `ALTER TABLE "drive_file" DROP COLUMN "maybeSensitive"`, - ); - await queryRunner.query( - `ALTER TABLE "meta" ADD "disallowUploadWhenPredictedAsPorn" boolean NOT NULL DEFAULT false`, - ); - await queryRunner.query( - `ALTER TABLE "meta" ADD "forceIsSensitiveWhenPredicted" boolean NOT NULL DEFAULT true`, - ); - await queryRunner.query( - `ALTER TABLE "drive_file" ADD "predictedIsSensitive" boolean NOT NULL DEFAULT false`, - ); - await queryRunner.query( - `ALTER TABLE "drive_file" ADD "forceIsSensitive" boolean NOT NULL DEFAULT false`, - ); - await queryRunner.query( - `CREATE INDEX "IDX_fc2d74a6d7d8b11292a851d8f8" ON "drive_file" ("predictedIsSensitive") `, - ); - } -} diff --git a/packages/backend/migration/1656328812281-ip-2.js b/packages/backend/migration/1656328812281-ip-2.js deleted file mode 100644 index ab4096e9c6..0000000000 --- a/packages/backend/migration/1656328812281-ip-2.js +++ /dev/null @@ -1,19 +0,0 @@ -export class ip21656328812281 { - name = "ip21656328812281"; - - async up(queryRunner) { - await queryRunner.query( - `ALTER TABLE "user_ip" DROP CONSTRAINT "FK_7f7f1c66f48e9a8e18a33bc5150"`, - ); - await queryRunner.query( - `ALTER TABLE "meta" ADD "enableIpLogging" boolean NOT NULL DEFAULT false`, - ); - } - - async down(queryRunner) { - await queryRunner.query(`ALTER TABLE "meta" DROP COLUMN "enableIpLogging"`); - await queryRunner.query( - `ALTER TABLE "user_ip" ADD CONSTRAINT "FK_7f7f1c66f48e9a8e18a33bc5150" FOREIGN KEY ("userId") REFERENCES "user"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`, - ); - } -} diff --git a/packages/backend/migration/1656408772602-nsfw-detection-6.js b/packages/backend/migration/1656408772602-nsfw-detection-6.js deleted file mode 100644 index 4ef237308f..0000000000 --- a/packages/backend/migration/1656408772602-nsfw-detection-6.js +++ /dev/null @@ -1,15 +0,0 @@ -export class nsfwDetection61656408772602 { - name = "nsfwDetection61656408772602"; - - async up(queryRunner) { - await queryRunner.query( - `ALTER TABLE "meta" ADD "enableSensitiveMediaDetectionForVideos" boolean NOT NULL DEFAULT false`, - ); - } - - async down(queryRunner) { - await queryRunner.query( - `ALTER TABLE "meta" DROP COLUMN "enableSensitiveMediaDetectionForVideos"`, - ); - } -} diff --git a/packages/backend/migration/1656772790599-user-moderation-note.js b/packages/backend/migration/1656772790599-user-moderation-note.js deleted file mode 100644 index 11d3124aeb..0000000000 --- a/packages/backend/migration/1656772790599-user-moderation-note.js +++ /dev/null @@ -1,15 +0,0 @@ -export class userModerationNote1656772790599 { - name = "userModerationNote1656772790599"; - - async up(queryRunner) { - await queryRunner.query( - `ALTER TABLE "user_profile" ADD "moderationNote" character varying(8192) NOT NULL DEFAULT ''`, - ); - } - - async down(queryRunner) { - await queryRunner.query( - `ALTER TABLE "user_profile" DROP COLUMN "moderationNote"`, - ); - } -} diff --git a/packages/backend/migration/1657346559800-active-email-validation.js b/packages/backend/migration/1657346559800-active-email-validation.js deleted file mode 100644 index 4e3fd3f820..0000000000 --- a/packages/backend/migration/1657346559800-active-email-validation.js +++ /dev/null @@ -1,15 +0,0 @@ -export class activeEmailValidation1657346559800 { - name = "activeEmailValidation1657346559800"; - - async up(queryRunner) { - await queryRunner.query( - `ALTER TABLE "meta" ADD "enableActiveEmailValidation" boolean NOT NULL DEFAULT true`, - ); - } - - async down(queryRunner) { - await queryRunner.query( - `ALTER TABLE "meta" DROP COLUMN "enableActiveEmailValidation"`, - ); - } -} diff --git a/packages/backend/migration/1658203170545calckey.js b/packages/backend/migration/1658203170545calckey.js deleted file mode 100644 index 95c3f05d3d..0000000000 --- a/packages/backend/migration/1658203170545calckey.js +++ /dev/null @@ -1,27 +0,0 @@ -export class calckey1658203170545 { - name = "calckey1658203170545"; - - async up(queryRunner) { - await queryRunner.query( - `UPDATE meta SET "useStarForReactionFallback" = TRUE;`, - ); - await queryRunner.query( - `UPDATE meta SET "repositoryUrl" = 'https://codeberg/calckey/calckey'`, - ); - await queryRunner.query( - `UPDATE meta SET "feedbackUrl" = 'https://codeberg/calckey/calckey/issues'`, - ); - } - - async down(queryRunner) { - await queryRunner.query( - `UPDATE meta SET "useStarForReactionFallback" = FALSE;`, - ); - await queryRunner.query( - `UPDATE meta SET "repositoryUrl" = 'https://codeberg/calckey/calckey'`, - ); - await queryRunner.query( - `UPDATE meta SET "feedbackUrl" = 'https://codeberg/calckey/calckey/issues'`, - ); - } -} diff --git a/packages/backend/migration/1658656633972-note-replies-function.js b/packages/backend/migration/1658656633972-note-replies-function.js deleted file mode 100644 index 810e238439..0000000000 --- a/packages/backend/migration/1658656633972-note-replies-function.js +++ /dev/null @@ -1,52 +0,0 @@ -export class noteRepliesFunction1658656633972 { - name = "noteRepliesFunction1658656633972"; - - async up(queryRunner) { - await queryRunner.query(` - CREATE OR REPLACE FUNCTION note_replies(start_id varchar, max_depth integer, max_breadth integer) RETURNS TABLE (id VARCHAR) AS - $$ - SELECT DISTINCT id FROM ( - WITH RECURSIVE tree (id, ancestors, depth) AS ( - SELECT start_id, '{}'::VARCHAR[], 0 - UNION - SELECT - note.id, - CASE - WHEN note."replyId" = tree.id THEN tree.ancestors || note."replyId" - ELSE tree.ancestors || note."renoteId" - END, - depth + 1 - FROM note, tree - WHERE ( - note."replyId" = tree.id - OR - ( - -- get renotes but not pure renotes - note."renoteId" = tree.id - AND - ( - note.text IS NOT NULL - OR - CARDINALITY(note."fileIds") != 0 - OR - note."hasPoll" = TRUE - ) - ) - ) AND depth < max_depth - ) - SELECT - id, - -- apply the limit per node - row_number() OVER (PARTITION BY ancestors[array_upper(ancestors, 1)]) AS nth_child - FROM tree - WHERE depth > 0 - ) AS recursive WHERE nth_child < max_breadth - $$ - LANGUAGE SQL - `); - } - - async down(queryRunner) { - await queryRunner.query(`DROP FUNCTION note_replies`); - } -} diff --git a/packages/backend/migration/1658939464003CustomMOTD.js b/packages/backend/migration/1658939464003CustomMOTD.js deleted file mode 100644 index ee1b182e5d..0000000000 --- a/packages/backend/migration/1658939464003CustomMOTD.js +++ /dev/null @@ -1,10 +0,0 @@ -export class CustomMOTD1658939464003 { - async up(queryRunner) { - await queryRunner.query( - `ALTER TABLE "meta" ADD "customMOTD" character varying(256) array NOT NULL DEFAULT '{}'::varchar[]`, - ); - } - async down(queryRunner) { - await queryRunner.query(`ALTER TABLE "meta" DROP COLUMN "customMOTD"`); - } -} diff --git a/packages/backend/migration/1658941974648CustomSplashIcons.js b/packages/backend/migration/1658941974648CustomSplashIcons.js deleted file mode 100644 index 5c6a874d0f..0000000000 --- a/packages/backend/migration/1658941974648CustomSplashIcons.js +++ /dev/null @@ -1,12 +0,0 @@ -export class CustomSplashIcons1658941974648 { - async up(queryRunner) { - await queryRunner.query( - `ALTER TABLE "meta" ADD "customSplashIcons" character varying(256) array NOT NULL DEFAULT '{}'::varchar[]`, - ); - } - async down(queryRunner) { - await queryRunner.query( - `ALTER TABLE "meta" DROP COLUMN "customSplashIcons"`, - ); - } -} diff --git a/packages/backend/migration/1658981842728FixCalckey.js b/packages/backend/migration/1658981842728FixCalckey.js deleted file mode 100644 index 1a0305538d..0000000000 --- a/packages/backend/migration/1658981842728FixCalckey.js +++ /dev/null @@ -1,27 +0,0 @@ -export class FixCalckey1658981842728 { - name = "FixCalckey1658981842728"; - - async up(queryRunner) { - await queryRunner.query( - `UPDATE "meta" SET "useStarForReactionFallback" = TRUE;`, - ); - await queryRunner.query( - `UPDATE "meta" SET "repositoryUrl" = 'https://codeberg/calckey/calckey'`, - ); - await queryRunner.query( - `UPDATE "meta" SET "feedbackUrl" = 'https://codeberg/calckey/calckey/issues'`, - ); - } - - async down(queryRunner) { - await queryRunner.query( - `UPDATE "meta" SET "useStarForReactionFallback" = FALSE;`, - ); - await queryRunner.query( - `UPDATE "meta" SET "repositoryUrl" = 'https://codeberg/calckey/calckey'`, - ); - await queryRunner.query( - `UPDATE "meta" SET "feedbackUrl" = 'https://codeberg/calckey/calckey/issues'`, - ); - } -} diff --git a/packages/backend/migration/1659042130648RecommendedTimeline.js b/packages/backend/migration/1659042130648RecommendedTimeline.js deleted file mode 100644 index 01d28b2f38..0000000000 --- a/packages/backend/migration/1659042130648RecommendedTimeline.js +++ /dev/null @@ -1,19 +0,0 @@ -export class RecommendedTimeline1659042130648 { - name = "RecommendedTimeline1659042130648"; - async up(queryRunner) { - await queryRunner.query( - `ALTER TABLE "meta" ADD "disableRecommendedTimeline" boolean NOT NULL DEFAULT true`, - ); - await queryRunner.query( - `ALTER TABLE "meta" ADD "recommendedInstances" character varying(256) array NOT NULL DEFAULT '{}'::varchar[]`, - ); - } - async down(queryRunner) { - await queryRunner.query( - `ALTER TABLE "meta" DROP COLUMN "disableRecommendedTimeline"`, - ); - await queryRunner.query( - `ALTER TABLE "meta" DROP COLUMN "recommendedInstances"`, - ); - } -} diff --git a/packages/backend/migration/1660068273737GuestTimeline.js b/packages/backend/migration/1660068273737GuestTimeline.js deleted file mode 100644 index 9a42f602da..0000000000 --- a/packages/backend/migration/1660068273737GuestTimeline.js +++ /dev/null @@ -1,13 +0,0 @@ -export class GuestTimeline1660068273737 { - name = "GuestTimeline1660068273737"; - async up(queryRunner) { - await queryRunner.query( - `ALTER TABLE "meta" ADD "enableGuestTimeline" boolean NOT NULL DEFAULT false`, - ); - } - async down(queryRunner) { - await queryRunner.query( - `ALTER TABLE "meta" DROP COLUMN "enableGuestTimeline"`, - ); - } -} diff --git a/packages/backend/migration/1665091090561-add-renote-muting.js b/packages/backend/migration/1665091090561-add-renote-muting.js deleted file mode 100644 index 2c76aaff5f..0000000000 --- a/packages/backend/migration/1665091090561-add-renote-muting.js +++ /dev/null @@ -1,22 +0,0 @@ -export class addRenoteMuting1665091090561 { - constructor() { - this.name = "addRenoteMuting1665091090561"; - } - - async up(queryRunner) { - await queryRunner.query( - `CREATE TABLE "renote_muting" ("id" character varying(32) NOT NULL, "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL, "muteeId" character varying(32) NOT NULL, "muterId" character varying(32) NOT NULL, CONSTRAINT "PK_renoteMuting_id" PRIMARY KEY ("id"))`, - ); - await queryRunner.query( - `CREATE INDEX "IDX_renote_muting_createdAt" ON "muting" ("createdAt") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_renote_muting_muteeId" ON "muting" ("muteeId") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_renote_muting_muterId" ON "muting" ("muterId") `, - ); - } - - async down(queryRunner) {} -} diff --git a/packages/backend/migration/1668828368510PageDraft.js b/packages/backend/migration/1668828368510PageDraft.js deleted file mode 100644 index a5cc88b26e..0000000000 --- a/packages/backend/migration/1668828368510PageDraft.js +++ /dev/null @@ -1,10 +0,0 @@ -export class Page1668828368510 { - async up(queryRunner) { - await queryRunner.query( - `ALTER TABLE "page" ADD "isPublic" boolean NOT NULL DEFAULT true`, - ); - } - async down(queryRunner) { - await queryRunner.query(`ALTER TABLE "page" DROP COLUMN "isPublic"`); - } -} diff --git a/packages/backend/migration/1668831378728FixCalckeyAgain.js b/packages/backend/migration/1668831378728FixCalckeyAgain.js deleted file mode 100644 index c65dd54cd7..0000000000 --- a/packages/backend/migration/1668831378728FixCalckeyAgain.js +++ /dev/null @@ -1,15 +0,0 @@ -export class FixCalckeyAgain1668831378728 { - name = "FixCalckeyAgain1668831378728"; - - async up(queryRunner) { - await queryRunner.query( - `UPDATE "meta" SET "useStarForReactionFallback" = TRUE`, - ); - } - - async down(queryRunner) { - await queryRunner.query( - `UPDATE "meta" SET "useStarForReactionFallback" = FALSE`, - ); - } -} diff --git a/packages/backend/migration/1669138716634-whetherPushNotifyToSendReadMessage.js b/packages/backend/migration/1669138716634-whetherPushNotifyToSendReadMessage.js deleted file mode 100644 index 101972a68c..0000000000 --- a/packages/backend/migration/1669138716634-whetherPushNotifyToSendReadMessage.js +++ /dev/null @@ -1,15 +0,0 @@ -export class whetherPushNotifyToSendReadMessage1669138716634 { - name = "whetherPushNotifyToSendReadMessage1669138716634"; - - async up(queryRunner) { - await queryRunner.query( - `ALTER TABLE "sw_subscription" ADD "sendReadMessage" boolean NOT NULL DEFAULT false`, - ); - } - - async down(queryRunner) { - await queryRunner.query( - `ALTER TABLE "sw_subscription" DROP COLUMN "sendReadMessage"`, - ); - } -} diff --git a/packages/backend/migration/1669288094000-AddMovedToAndKnownAs.js b/packages/backend/migration/1669288094000-AddMovedToAndKnownAs.js deleted file mode 100644 index c34764e0b0..0000000000 --- a/packages/backend/migration/1669288094000-AddMovedToAndKnownAs.js +++ /dev/null @@ -1,21 +0,0 @@ -export class addMovedToAndKnownAs1669288094000 { - name = "addMovedToAndKnownAs1669288094000"; - - async up(queryRunner) { - await queryRunner.query( - `ALTER TABLE "user" ADD "movedToUri" character varying(512)`, - ); - await queryRunner.query(`ALTER TABLE "user" ADD "alsoKnownAs" TEXT`); - await queryRunner.query( - `COMMENT ON COLUMN "user"."movedToUri" IS 'The URI of the new account of the User'`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "user"."alsoKnownAs" IS 'URIs the user is known as too'`, - ); - } - - async down(queryRunner) { - await queryRunner.query(`ALTER TABLE "user" DROP COLUMN "movedToUri"`); - await queryRunner.query(`ALTER TABLE "user" DROP COLUMN "alsoKnownAs"`); - } -} diff --git a/packages/backend/migration/1671199573000-AddFkAbuseUserReportTargetUserIdToUserId.js b/packages/backend/migration/1671199573000-AddFkAbuseUserReportTargetUserIdToUserId.js deleted file mode 100644 index 96ed8e1d6b..0000000000 --- a/packages/backend/migration/1671199573000-AddFkAbuseUserReportTargetUserIdToUserId.js +++ /dev/null @@ -1,18 +0,0 @@ -export class addFkAbuseUserReportTargetUserIdToUserId1671199573000 { - name = "addFkAbuseUserReportTargetUserIdToUserId1671199573000"; - - async up(queryRunner) { - await queryRunner.query( - `DELETE FROM abuse_user_report WHERE NOT EXISTS (SELECT 1 FROM "user" WHERE "user"."id" = "abuse_user_report"."targetUserId")`, - ); - await queryRunner.query( - `ALTER TABLE abuse_user_report ADD CONSTRAINT fk_7f4e851a35d81b64dda28eee0 FOREIGN KEY ("targetUserId") REFERENCES "user"("id") ON DELETE CASCADE`, - ); - } - - async down(queryRunner) { - await queryRunner.query( - `ALTER TABLE abuse_user_report DROP CONSTRAINT fk_7f4e851a35d81b64dda28eee0`, - ); - } -} diff --git a/packages/backend/migration/1671388343000-CalckeyRepoMove.js b/packages/backend/migration/1671388343000-CalckeyRepoMove.js deleted file mode 100644 index 60550f0446..0000000000 --- a/packages/backend/migration/1671388343000-CalckeyRepoMove.js +++ /dev/null @@ -1,23 +0,0 @@ -/* "CalckeyRepoMove1671388343000" is a class that updates the "useStarForReactionFallback" column in -the "meta" table to TRUE */ -export class CalckeyRepoMove1671388343000 { - name = "CalckeyRepoMove1671388343000"; - - async up(queryRunner) { - await queryRunner.query( - `UPDATE meta SET "repositoryUrl" = 'https://codeberg/calckey/calckey'`, - ); - await queryRunner.query( - `UPDATE meta SET "feedbackUrl" = 'https://codeberg/calckey/calckey/issues'`, - ); - } - - async down(queryRunner) { - await queryRunner.query( - `UPDATE meta SET "repositoryUrl" = 'https://codeberg/calckey/calckey'`, - ); - await queryRunner.query( - `UPDATE meta SET "feedbackUrl" = 'https://codeberg/calckey/calckey/issues'`, - ); - } -} diff --git a/packages/backend/migration/1672882664294-DefaultReaction.js b/packages/backend/migration/1672882664294-DefaultReaction.js deleted file mode 100644 index 6ce1146ecb..0000000000 --- a/packages/backend/migration/1672882664294-DefaultReaction.js +++ /dev/null @@ -1,16 +0,0 @@ -export class DefaultReaction1672882664294 { - name = "DefaultReaction1672882664294"; - - async up(queryRunner) { - await queryRunner.query( - `ALTER TABLE "meta" ADD "defaultReaction" character varying(256) NOT NULL DEFAULT '⭐'`, - ); - await queryRunner.query( - `COMMENT ON COLUMN "meta"."defaultReaction" IS 'The fallback reaction for emoji reacts'`, - ); - } - - async down(queryRunner) { - await queryRunner.query(`ALTER TABLE "meta" DROP COLUMN "defaultReaction"`); - } -} diff --git a/packages/backend/migration/1673336077243-PollChoiceLength.js b/packages/backend/migration/1673336077243-PollChoiceLength.js deleted file mode 100644 index a0e3350162..0000000000 --- a/packages/backend/migration/1673336077243-PollChoiceLength.js +++ /dev/null @@ -1,15 +0,0 @@ -export class PollChoiceLength1673336077243 { - name = "PollChoiceLength1673336077243"; - - async up(queryRunner) { - await queryRunner.query( - `ALTER TABLE "poll" ALTER COLUMN "choices" TYPE character varying(256) array`, - ); - } - - async down(queryRunner) { - await queryRunner.query( - `ALTER TABLE "poll" ALTER COLUMN "choices" TYPE character varying(128) array`, - ); - } -} diff --git a/packages/backend/migration/1676093997212-AntennaInstances.js b/packages/backend/migration/1676093997212-AntennaInstances.js deleted file mode 100644 index ffd428f7dc..0000000000 --- a/packages/backend/migration/1676093997212-AntennaInstances.js +++ /dev/null @@ -1,27 +0,0 @@ -export class AntennaInstances1676093997212 { - name = "AntennaInstances1676093997212"; - - async up(queryRunner) { - await queryRunner.query( - `ALTER TYPE "antenna_src_enum" ADD VALUE 'instances'`, - ); - await queryRunner.query( - `ALTER TABLE "antenna" ADD "instances" jsonb NOT NULL DEFAULT '[]'`, - ); - } - - async down(queryRunner) { - await queryRunner.query(`DELETE FROM "antenna" WHERE "src" = 'instances'`); - await queryRunner.query(`ALTER TABLE "antenna" DROP COLUMN "instances"`); - await queryRunner.query( - `CREATE TYPE "public"."antenna_src_enum_old" AS ENUM('home', 'all', 'users', 'list', 'group')`, - ); - await queryRunner.query( - `ALTER TABLE "antenna" ALTER COLUMN "src" TYPE "public"."antenna_src_enum_old" USING "src"::"text"::"public"."antenna_src_enum_old"`, - ); - await queryRunner.query(`DROP TYPE "public"."antenna_src_enum"`); - await queryRunner.query( - `ALTER TYPE "public"."antenna_src_enum_old" RENAME TO "antenna_src_enum"`, - ); - } -} diff --git a/packages/backend/migration/1677935903517-DriveComment.js b/packages/backend/migration/1677935903517-DriveComment.js deleted file mode 100644 index 571958f294..0000000000 --- a/packages/backend/migration/1677935903517-DriveComment.js +++ /dev/null @@ -1,15 +0,0 @@ -export class DriveComment1677935903517 { - name = "DriveComment1677935903517"; - - async up(queryRunner) { - await queryRunner.query( - `ALTER TABLE "drive_file" ALTER "comment" TYPE character varying(8192)`, - ); - } - - async down(queryRunner) { - await queryRunner.query( - `ALTER TABLE "drive_file" ALTER "comment" TYPE character varying(512)`, - ); - } -} diff --git a/packages/backend/migration/1678945242650-add-props-for-custom-emoji.js b/packages/backend/migration/1678945242650-add-props-for-custom-emoji.js deleted file mode 100644 index f3de7ce278..0000000000 --- a/packages/backend/migration/1678945242650-add-props-for-custom-emoji.js +++ /dev/null @@ -1,13 +0,0 @@ -export class addPropsForCustomEmoji1678945242650 { - name = "addPropsForCustomEmoji1678945242650"; - - async up(queryRunner) { - await queryRunner.query( - `ALTER TABLE "emoji" ADD "license" character varying(1024)`, - ); - } - - async down(queryRunner) { - await queryRunner.query(`ALTER TABLE "emoji" DROP COLUMN "license"`); - } -} diff --git a/packages/backend/migration/1679269929000-fix-repo.js b/packages/backend/migration/1679269929000-fix-repo.js deleted file mode 100644 index 3571da4f51..0000000000 --- a/packages/backend/migration/1679269929000-fix-repo.js +++ /dev/null @@ -1,21 +0,0 @@ -export class FixRepo1679269929000 { - name = "FixRepo1679269929000"; - - async up(queryRunner) { - await queryRunner.query( - `UPDATE meta SET "repositoryUrl" = 'https://codeberg.org/calckey/calckey'`, - ); - await queryRunner.query( - `UPDATE meta SET "feedbackUrl" = 'https://codeberg.org/calckey/calckey/issues'`, - ); - } - - async down(queryRunner) { - await queryRunner.query( - `UPDATE meta SET "repositoryUrl" = 'https://codeberg.org/calckey/calckey'`, - ); - await queryRunner.query( - `UPDATE meta SET "feedbackUrl" = 'https://codeberg.org/calckey/calckey/issues'`, - ); - } -} diff --git a/packages/backend/migration/1680375641101-clean-charts.js b/packages/backend/migration/1680375641101-clean-charts.js deleted file mode 100644 index bfb8aa9d92..0000000000 --- a/packages/backend/migration/1680375641101-clean-charts.js +++ /dev/null @@ -1,25 +0,0 @@ -export class CleanCharts1680375641101 { - constructor() { - this.name = "CleanCharts1680375641101"; - } - async up(queryRunner) { - await queryRunner.query( - `delete from __chart__hashtag where ___local_users = 0 and ___remote_users = 0;`, - ); - await queryRunner.query( - `delete from __chart_day__hashtag where ___local_users = 0 and ___remote_users = 0;`, - ); - await queryRunner.query(`COMMIT;`); - await queryRunner.query(`vacuum __chart__hashtag;`); - await queryRunner.query(`vacuum __chart_day__hashtag;`); - await queryRunner.query(`COMMIT;`); - } - async down(queryRunner) { - await queryRunner.query( - `delete from __chart__hashtag where ___local_users = 0 and ___remote_users = 0;`, - ); - await queryRunner.query( - `delete from __chart_day__hashtag where ___local_users = 0 and ___remote_users = 0;`, - ); - } -} diff --git a/packages/backend/migration/1680426269172-SpeakAsCat.js b/packages/backend/migration/1680426269172-SpeakAsCat.js deleted file mode 100644 index 375098542c..0000000000 --- a/packages/backend/migration/1680426269172-SpeakAsCat.js +++ /dev/null @@ -1,20 +0,0 @@ -export class SpeakAsCat1680426269172 { - name = "SpeakAsCat1680426269172"; - - async up(queryRunner) { - await queryRunner.query(` - ALTER TABLE "user" - ADD "speakAsCat" boolean NOT NULL DEFAULT true - `); - await queryRunner.query(` - COMMENT ON COLUMN "user"."speakAsCat" - IS 'Whether to speak as a cat if isCat.' - `); - } - - async down(queryRunner) { - await queryRunner.query(` - ALTER TABLE "user" DROP COLUMN "speakAsCat" - `); - } -} diff --git a/packages/backend/migration/1682753227899-NoteEdit.js b/packages/backend/migration/1682753227899-NoteEdit.js deleted file mode 100644 index 55a0de0206..0000000000 --- a/packages/backend/migration/1682753227899-NoteEdit.js +++ /dev/null @@ -1,53 +0,0 @@ -export class NoteEdit1682753227899 { - name = "NoteEdit1682753227899"; - - async up(queryRunner) { - await queryRunner.query(` - CREATE TABLE "note_edit" ( - "id" character varying(32) NOT NULL, - "noteId" character varying(32) NOT NULL, - "text" text, - "cw" character varying(512), - "fileIds" character varying(32) array NOT NULL DEFAULT '{}', - "updatedAt" TIMESTAMP WITH TIME ZONE NOT NULL, - CONSTRAINT "PK_736fc6e0d4e222ecc6f82058e08" PRIMARY KEY ("id") - ) - `); - await queryRunner.query(` - COMMENT ON COLUMN "note_edit"."noteId" IS 'The ID of note.' - `); - await queryRunner.query(` - COMMENT ON COLUMN "note_edit"."updatedAt" IS 'The updated date of the Note.' - `); - await queryRunner.query(` - CREATE INDEX "IDX_702ad5ae993a672e4fbffbcd38" ON "note_edit" ("noteId") - `); - await queryRunner.query(` - ALTER TABLE "note" - ADD "updatedAt" TIMESTAMP WITH TIME ZONE - `); - await queryRunner.query(` - COMMENT ON COLUMN "note"."updatedAt" IS 'The updated date of the Note.' - `); - await queryRunner.query(` - ALTER TABLE "note_edit" - ADD CONSTRAINT "FK_702ad5ae993a672e4fbffbcd38c" - FOREIGN KEY ("noteId") - REFERENCES "note"("id") - ON DELETE CASCADE - ON UPDATE NO ACTION - `); - } - - async down(queryRunner) { - await queryRunner.query(` - ALTER TABLE "note_edit" DROP CONSTRAINT "FK_702ad5ae993a672e4fbffbcd38c" - `); - await queryRunner.query(` - ALTER TABLE "note" DROP COLUMN "updatedAt" - `); - await queryRunner.query(` - DROP TABLE "note_edit" - `); - } -} diff --git a/packages/backend/migration/1682777547198-LibreTranslate.js b/packages/backend/migration/1682777547198-LibreTranslate.js deleted file mode 100644 index dbaf483e6c..0000000000 --- a/packages/backend/migration/1682777547198-LibreTranslate.js +++ /dev/null @@ -1,23 +0,0 @@ -export class LibreTranslate1682777547198 { - name = "LibreTranslate1682777547198"; - - async up(queryRunner) { - await queryRunner.query(` - ALTER TABLE "meta" - ADD "libreTranslateApiUrl" character varying(512) - `); - await queryRunner.query(` - ALTER TABLE "meta" - ADD "libreTranslateApiKey" character varying(128) - `); - } - - async down(queryRunner) { - await queryRunner.query(` - ALTER TABLE "meta" DROP COLUMN "libreTranslateApiKey" - `); - await queryRunner.query(` - ALTER TABLE "meta" DROP COLUMN "libreTranslateApiUrl" - `); - } -} diff --git a/packages/backend/migration/1682891890317-InstanceSilence.js b/packages/backend/migration/1682891890317-InstanceSilence.js deleted file mode 100644 index babe64883a..0000000000 --- a/packages/backend/migration/1682891890317-InstanceSilence.js +++ /dev/null @@ -1,13 +0,0 @@ -export class InstanceSilence1682891890317 { - name = "InstanceSilence1682891890317"; - - async up(queryRunner) { - await queryRunner.query( - `ALTER TABLE "meta" ADD "silencedHosts" character varying(256) array NOT NULL DEFAULT '{}'`, - ); - } - - async down(queryRunner) { - await queryRunner.query(`ALTER TABLE "meta" DROP COLUMN "silencedHosts"`); - } -} diff --git a/packages/backend/migration/1682891891317-AddHiddenPosts.js b/packages/backend/migration/1682891891317-AddHiddenPosts.js deleted file mode 100644 index 827470f88e..0000000000 --- a/packages/backend/migration/1682891891317-AddHiddenPosts.js +++ /dev/null @@ -1,15 +0,0 @@ -export class AddHiddenPosts1682891891317 { - name = "AddHiddenPosts1682891891317"; - - async up(queryRunner) { - await queryRunner.query( - `ALTER TYPE note_visibility_enum ADD VALUE IF NOT EXISTS 'hidden'`, - ); - } - - async down(queryRunner) { - await queryRunner.query( - `ALTER TYPE note_visibility_enum REMOVE VALUE IF EXISTS 'hidden'`, - ); - } -} diff --git a/packages/backend/migration/1683682889948-PreventAiLearning.js b/packages/backend/migration/1683682889948-PreventAiLearning.js deleted file mode 100644 index afb892ed5d..0000000000 --- a/packages/backend/migration/1683682889948-PreventAiLearning.js +++ /dev/null @@ -1,15 +0,0 @@ -export class PreventAiLearning1683682889948 { - name = "PreventAiLearning1683682889948"; - - async up(queryRunner) { - await queryRunner.query( - `ALTER TABLE "user_profile" ADD "preventAiLearning" boolean NOT NULL DEFAULT true`, - ); - } - - async down(queryRunner) { - await queryRunner.query( - `ALTER TABLE "user_profile" DROP COLUMN "preventAiLearning"`, - ); - } -} diff --git a/packages/backend/migration/1683980686995-ExperimentalFeatures.js b/packages/backend/migration/1683980686995-ExperimentalFeatures.js deleted file mode 100644 index a289a9ecdc..0000000000 --- a/packages/backend/migration/1683980686995-ExperimentalFeatures.js +++ /dev/null @@ -1,16 +0,0 @@ -export class ExperimentalFeatures1683980686995 { - name = "ExperimentalFeatures1683980686995"; - - async up(queryRunner) { - await queryRunner.query(` - ALTER TABLE "meta" - ADD "experimentalFeatures" jsonb NOT NULL DEFAULT '{}' - `); - } - - async down(queryRunner) { - await queryRunner.query(` - ALTER TABLE "meta" DROP COLUMN "experimentalFeatures" - `); - } -} diff --git a/packages/backend/migration/1684206886988-remove-showTimelineReplies.js b/packages/backend/migration/1684206886988-remove-showTimelineReplies.js deleted file mode 100644 index e5f8483c7f..0000000000 --- a/packages/backend/migration/1684206886988-remove-showTimelineReplies.js +++ /dev/null @@ -1,15 +0,0 @@ -export class RemoveShowTimelineReplies1684206886988 { - name = "RemoveShowTimelineReplies1684206886988"; - - async up(queryRunner) { - await queryRunner.query( - `ALTER TABLE "user" DROP COLUMN "showTimelineReplies"`, - ); - } - - async down(queryRunner) { - await queryRunner.query( - `ALTER TABLE "user" ADD "showTimelineReplies" boolean NOT NULL DEFAULT false`, - ); - } -} diff --git a/packages/backend/migration/1684494870830-EmojiSize.js b/packages/backend/migration/1684494870830-EmojiSize.js deleted file mode 100644 index 6d42f1a614..0000000000 --- a/packages/backend/migration/1684494870830-EmojiSize.js +++ /dev/null @@ -1,19 +0,0 @@ -export class EmojiSize1684494870830 { - name = "EmojiSize1684494870830"; - - async up(queryRunner) { - await queryRunner.query(`ALTER TABLE "emoji" ADD "width" integer`); - await queryRunner.query( - `COMMENT ON COLUMN "emoji"."width" IS 'Image width'`, - ); - await queryRunner.query(`ALTER TABLE "emoji" ADD "height" integer`); - await queryRunner.query( - `COMMENT ON COLUMN "emoji"."height" IS 'Image height'`, - ); - } - - async down(queryRunner) { - await queryRunner.query(`ALTER TABLE "emoji" DROP COLUMN "height"`); - await queryRunner.query(`ALTER TABLE "emoji" DROP COLUMN "width"`); - } -} diff --git a/packages/backend/ormconfig.js b/packages/backend/ormconfig.js index 5f85cead8a..54611d8a93 100644 --- a/packages/backend/ormconfig.js +++ b/packages/backend/ormconfig.js @@ -1,6 +1,6 @@ -import { DataSource } from "typeorm"; +import {DataSource} from "typeorm"; import config from "./built/config/index.js"; -import { entities } from "./built/db/postgre.js"; +import {entities} from "./built/db/postgre.js"; export default new DataSource({ type: "postgres", @@ -11,5 +11,5 @@ export default new DataSource({ database: config.db.db, extra: config.db.extra, entities: entities, - migrations: ["migration/*.js"], + migrations: [], }); diff --git a/packages/backend/package.json b/packages/backend/package.json index 7fe0a1c503..67254ab447 100644 --- a/packages/backend/package.json +++ b/packages/backend/package.json @@ -6,8 +6,6 @@ "scripts": { "start": "pnpm node ./built/index.js", "start:test": "NODE_ENV=test pnpm node ./built/index.js", - "migrate": "typeorm migration:run -d ormconfig.js", - "revertmigration": "typeorm migration:revert -d ormconfig.js", "build": "pnpm swc src -d built -D", "watch": "pnpm swc src -d built -D -w", "lint": "pnpm rome check --apply *", diff --git a/packages/backend/src/db/postgre.ts b/packages/backend/src/db/postgre.ts index bb8a22785e..dcd21ce537 100644 --- a/packages/backend/src/db/postgre.ts +++ b/packages/backend/src/db/postgre.ts @@ -1,93 +1,85 @@ // https://github.com/typeorm/typeorm/issues/2400 import pg from "pg"; -pg.types.setTypeParser(20, Number); - -import type { Logger } from "typeorm"; -import { DataSource } from "typeorm"; +import type {Logger} from "typeorm"; +import {DataSource} from "typeorm"; import * as highlight from "cli-highlight"; import config from "@/config/index.js"; -import { User } from "@/models/entities/user.js"; -import { DriveFile } from "@/models/entities/drive-file.js"; -import { DriveFolder } from "@/models/entities/drive-folder.js"; -import { AccessToken } from "@/models/entities/access-token.js"; -import { App } from "@/models/entities/app.js"; -import { PollVote } from "@/models/entities/poll-vote.js"; -import { Note } from "@/models/entities/note.js"; -import { NoteReaction } from "@/models/entities/note-reaction.js"; -import { NoteWatching } from "@/models/entities/note-watching.js"; -import { NoteThreadMuting } from "@/models/entities/note-thread-muting.js"; -import { NoteUnread } from "@/models/entities/note-unread.js"; -import { Notification } from "@/models/entities/notification.js"; -import { Meta } from "@/models/entities/meta.js"; -import { Following } from "@/models/entities/following.js"; -import { Instance } from "@/models/entities/instance.js"; -import { Muting } from "@/models/entities/muting.js"; -import { RenoteMuting } from "@/models/entities/renote-muting.js"; -import { SwSubscription } from "@/models/entities/sw-subscription.js"; -import { Blocking } from "@/models/entities/blocking.js"; -import { UserList } from "@/models/entities/user-list.js"; -import { UserListJoining } from "@/models/entities/user-list-joining.js"; -import { UserGroup } from "@/models/entities/user-group.js"; -import { UserGroupJoining } from "@/models/entities/user-group-joining.js"; -import { UserGroupInvitation } from "@/models/entities/user-group-invitation.js"; -import { Hashtag } from "@/models/entities/hashtag.js"; -import { NoteFavorite } from "@/models/entities/note-favorite.js"; -import { AbuseUserReport } from "@/models/entities/abuse-user-report.js"; -import { RegistrationTicket } from "@/models/entities/registration-tickets.js"; -import { Signin } from "@/models/entities/signin.js"; -import { AuthSession } from "@/models/entities/auth-session.js"; -import { FollowRequest } from "@/models/entities/follow-request.js"; -import { Emoji } from "@/models/entities/emoji.js"; -import { UserNotePining } from "@/models/entities/user-note-pining.js"; -import { Poll } from "@/models/entities/poll.js"; -import { UserKeypair } from "@/models/entities/user-keypair.js"; -import { UserPublickey } from "@/models/entities/user-publickey.js"; -import { UserProfile } from "@/models/entities/user-profile.js"; -import { UserSecurityKey } from "@/models/entities/user-security-key.js"; -import { AttestationChallenge } from "@/models/entities/attestation-challenge.js"; -import { Page } from "@/models/entities/page.js"; -import { PageLike } from "@/models/entities/page-like.js"; -import { GalleryPost } from "@/models/entities/gallery-post.js"; -import { GalleryLike } from "@/models/entities/gallery-like.js"; -import { ModerationLog } from "@/models/entities/moderation-log.js"; -import { UsedUsername } from "@/models/entities/used-username.js"; -import { Announcement } from "@/models/entities/announcement.js"; -import { AnnouncementRead } from "@/models/entities/announcement-read.js"; -import { Clip } from "@/models/entities/clip.js"; -import { ClipNote } from "@/models/entities/clip-note.js"; -import { Antenna } from "@/models/entities/antenna.js"; -import { AntennaNote } from "@/models/entities/antenna-note.js"; -import { PromoNote } from "@/models/entities/promo-note.js"; -import { PromoRead } from "@/models/entities/promo-read.js"; -import { Relay } from "@/models/entities/relay.js"; -import { MutedNote } from "@/models/entities/muted-note.js"; -import { Channel } from "@/models/entities/channel.js"; -import { ChannelFollowing } from "@/models/entities/channel-following.js"; -import { ChannelNotePining } from "@/models/entities/channel-note-pining.js"; -import { RegistryItem } from "@/models/entities/registry-item.js"; -import { Ad } from "@/models/entities/ad.js"; -import { PasswordResetRequest } from "@/models/entities/password-reset-request.js"; -import { UserPending } from "@/models/entities/user-pending.js"; -import { Webhook } from "@/models/entities/webhook.js"; -import { UserIp } from "@/models/entities/user-ip.js"; -import { NoteEdit } from "@/models/entities/note-edit.js"; +import {User} from "@/models/entities/user.js"; +import {DriveFile} from "@/models/entities/drive-file.js"; +import {DriveFolder} from "@/models/entities/drive-folder.js"; +import {AccessToken} from "@/models/entities/access-token.js"; +import {App} from "@/models/entities/app.js"; +import {PollVote} from "@/models/entities/poll-vote.js"; +import {Note} from "@/models/entities/note.js"; +import {NoteReaction} from "@/models/entities/note-reaction.js"; +import {NoteWatching} from "@/models/entities/note-watching.js"; +import {NoteThreadMuting} from "@/models/entities/note-thread-muting.js"; +import {NoteUnread} from "@/models/entities/note-unread.js"; +import {Notification} from "@/models/entities/notification.js"; +import {Meta} from "@/models/entities/meta.js"; +import {Following} from "@/models/entities/following.js"; +import {Instance} from "@/models/entities/instance.js"; +import {Muting} from "@/models/entities/muting.js"; +import {RenoteMuting} from "@/models/entities/renote-muting.js"; +import {SwSubscription} from "@/models/entities/sw-subscription.js"; +import {Blocking} from "@/models/entities/blocking.js"; +import {UserList} from "@/models/entities/user-list.js"; +import {UserListJoining} from "@/models/entities/user-list-joining.js"; +import {UserGroup} from "@/models/entities/user-group.js"; +import {UserGroupJoining} from "@/models/entities/user-group-joining.js"; +import {UserGroupInvitation} from "@/models/entities/user-group-invitation.js"; +import {Hashtag} from "@/models/entities/hashtag.js"; +import {NoteFavorite} from "@/models/entities/note-favorite.js"; +import {AbuseUserReport} from "@/models/entities/abuse-user-report.js"; +import {RegistrationTicket} from "@/models/entities/registration-tickets.js"; +import {Signin} from "@/models/entities/signin.js"; +import {AuthSession} from "@/models/entities/auth-session.js"; +import {FollowRequest} from "@/models/entities/follow-request.js"; +import {Emoji} from "@/models/entities/emoji.js"; +import {UserNotePining} from "@/models/entities/user-note-pining.js"; +import {Poll} from "@/models/entities/poll.js"; +import {UserKeypair} from "@/models/entities/user-keypair.js"; +import {UserPublickey} from "@/models/entities/user-publickey.js"; +import {UserProfile} from "@/models/entities/user-profile.js"; +import {UserSecurityKey} from "@/models/entities/user-security-key.js"; +import {AttestationChallenge} from "@/models/entities/attestation-challenge.js"; +import {Page} from "@/models/entities/page.js"; +import {PageLike} from "@/models/entities/page-like.js"; +import {GalleryPost} from "@/models/entities/gallery-post.js"; +import {GalleryLike} from "@/models/entities/gallery-like.js"; +import {ModerationLog} from "@/models/entities/moderation-log.js"; +import {UsedUsername} from "@/models/entities/used-username.js"; +import {Announcement} from "@/models/entities/announcement.js"; +import {AnnouncementRead} from "@/models/entities/announcement-read.js"; +import {Clip} from "@/models/entities/clip.js"; +import {ClipNote} from "@/models/entities/clip-note.js"; +import {Antenna} from "@/models/entities/antenna.js"; +import {AntennaNote} from "@/models/entities/antenna-note.js"; +import {PromoNote} from "@/models/entities/promo-note.js"; +import {PromoRead} from "@/models/entities/promo-read.js"; +import {Relay} from "@/models/entities/relay.js"; +import {MutedNote} from "@/models/entities/muted-note.js"; +import {Channel} from "@/models/entities/channel.js"; +import {ChannelFollowing} from "@/models/entities/channel-following.js"; +import {ChannelNotePining} from "@/models/entities/channel-note-pining.js"; +import {RegistryItem} from "@/models/entities/registry-item.js"; +import {Ad} from "@/models/entities/ad.js"; +import {PasswordResetRequest} from "@/models/entities/password-reset-request.js"; +import {UserPending} from "@/models/entities/user-pending.js"; +import {Webhook} from "@/models/entities/webhook.js"; +import {UserIp} from "@/models/entities/user-ip.js"; +import {NoteEdit} from "@/models/entities/note-edit.js"; -import { entities as charts } from "@/services/chart/entities.js"; -import { envOption } from "../env.js"; -import { dbLogger } from "./logger.js"; -import { redisClient } from "./redis.js"; +import {entities as charts} from "@/services/chart/entities.js"; +import {dbLogger} from "./logger.js"; +import {redisClient} from "./redis.js"; + +pg.types.setTypeParser(20, Number); const sqlLogger = dbLogger.createSubLogger("sql", "gray", false); class MyCustomLogger implements Logger { - private highlight(sql: string) { - return highlight.highlight(sql, { - language: "sql", - ignoreIllegals: true, - }); - } - public logQuery(query: string, parameters?: any[]) { sqlLogger.info(this.highlight(query).substring(0, 100)); } @@ -111,6 +103,13 @@ class MyCustomLogger implements Logger { public logMigration(message: string) { sqlLogger.info(message); } + + private highlight(sql: string) { + return highlight.highlight(sql, { + language: "sql", + ignoreIllegals: true, + }); + } } export const entities = [ @@ -214,7 +213,7 @@ export const db = new DataSource({ logger: log ? new MyCustomLogger() : undefined, maxQueryExecutionTime: 300, entities: entities, - migrations: ["../../migration/*.js"], + migrations: [], }); export async function initDb(force = false) {