From 1927151aed964a2b5226d83e64683703d00fa2de Mon Sep 17 00:00:00 2001 From: Laura Hausmann Date: Fri, 13 Oct 2023 18:17:29 +0200 Subject: [PATCH] [baackend] Move migrations to typescript --- CONTRIBUTING.md | 2 +- .../migration/1557476068003-PinnedUsers.js | 10 ---------- .../migration/1558266512381-UserListJoining.js | 10 ---------- .../migration/1562422242907-PasswordLessLogin.js | 12 ------------ .../1562448332510-PageTitleHideOption.js | 12 ------------ packages/backend/migration/1565634203341-room.js | 10 ---------- .../1571220798684-CustomEmojiCategory.js | 14 -------------- packages/backend/migration/1620364649428-ad2.js | 13 ------------- .../migration/1634902659689-delete-log.js | 9 --------- .../migration/1636697408073-remove-via-mobile.js | 13 ------------- .../1644395759931-instance-theme-color.js | 13 ------------- .../backend/migration/1658939464003CustomMOTD.js | 10 ---------- .../migration/1658941974648CustomSplashIcons.js | 12 ------------ .../backend/migration/1668828368510PageDraft.js | 10 ---------- .../migration/1668831378728FixCalckeyAgain.js | 15 --------------- .../1678945242650-add-props-for-custom-emoji.js | 13 ------------- .../migration/1695748502971-index-note-url.js | 10 ---------- .../migration/1695861526125-index-note-userid.js | 10 ---------- packages/backend/package.json | 7 +++---- .../migration/1000000000000-Init.ts} | 7 ++++--- .../migration/1556348509290-Pages.ts} | 7 ++++--- .../migration/1556746559567-UserProfile.ts} | 7 ++++--- .../src/migration/1557476068003-PinnedUsers.ts | 11 +++++++++++ .../migration/1557761316509-AddSomeUrls.ts} | 7 ++++--- .../1557932705754-ObjectStorageSetting.ts} | 7 ++++--- .../migration/1558072954435-PageLike.ts} | 7 ++++--- .../migration/1558103093633-UserGroup.ts} | 7 ++++--- .../migration/1558257926829-UserGroupInvite.ts} | 7 ++++--- .../migration/1558266512381-UserListJoining.ts | 11 +++++++++++ .../migration/1561706992953-webauthn.ts} | 7 ++++--- .../migration/1561873850023-ChartIndexes.ts} | 7 ++++--- .../migration/1562422242907-PasswordLessLogin.ts | 13 +++++++++++++ .../migration/1562444565093-PinnedPage.ts} | 7 ++++--- .../1562448332510-PageTitleHideOption.ts | 13 +++++++++++++ .../migration/1562869971568-ModerationLog.ts} | 7 ++++--- .../migration/1563757595828-UsedUsername.ts} | 7 ++++--- .../backend/src/migration/1565634203341-room.ts | 11 +++++++++++ .../1571220798684-CustomEmojiCategory.ts | 15 +++++++++++++++ .../migration/1572760203493-nodeinfo.ts} | 7 ++++--- .../migration/1576269851876-TalkFederationId.ts} | 7 ++++--- .../migration/1576869585998-ProxyRemoteFiles.ts} | 7 ++++--- .../migration/1579267006611-v12.ts} | 7 ++++--- .../migration/1579270193251-v12-2.ts} | 7 ++++--- .../migration/1579282808087-v12-3.ts} | 7 ++++--- .../migration/1579544426412-v12-4.ts} | 7 ++++--- .../migration/1579977526288-v12-5.ts} | 7 ++++--- .../migration/1579993013959-v12-6.ts} | 7 ++++--- .../migration/1580069531114-v12-7.ts} | 7 ++++--- .../migration/1580148575182-v12-8.ts} | 7 ++++--- .../migration/1580154400017-v12-9.ts} | 7 ++++--- .../migration/1580276619901-v12-10.ts} | 7 ++++--- .../migration/1580331224276-v12-11.ts} | 7 ++++--- .../migration/1580508795118-v12-12.ts} | 7 ++++--- .../migration/1580543501339-v12-13.ts} | 7 ++++--- .../migration/1580864313253-v12-14.ts} | 7 ++++--- .../1581526429287-user-group-invitation.ts} | 7 ++++--- .../1581695816408-user-group-antenna.ts} | 7 ++++--- .../1581708415836-drive-user-folder-id-index.ts} | 7 ++++--- .../migration/1581979837262-promo.ts} | 7 ++++--- .../1582019042083-featured-injecttion.ts} | 7 ++++--- .../migration/1582210532752-antenna-exclude.ts} | 7 ++++--- .../1582875306439-note-reaction-length.ts} | 7 ++++--- .../migration/1585361548360-miauth.ts} | 7 ++++--- .../1585385921215-custom-notification.ts} | 7 ++++--- .../migration/1585772678853-ap-url.ts} | 7 ++++--- .../1586624197029-AddObjectStorageUseProxy.ts} | 7 ++++--- .../migration/1586641139527-remote-reaction.ts} | 7 ++++--- .../migration/1586708940386-pageAiScript.ts} | 7 ++++--- .../migration/1588044505511-hCaptcha.ts} | 7 ++++--- .../migration/1589023282116-pubRelay.ts} | 7 ++++--- .../migration/1595075960584-blurhash.ts} | 7 ++++--- .../1595077605646-blurhash-for-avatar-banner.ts} | 7 ++++--- .../1595676934834-instance-icon-url.ts} | 7 ++++--- .../migration/1595771249699-word-mute.ts} | 7 ++++--- .../migration/1595782306083-word-mute2.ts} | 7 ++++--- .../migration/1596548170836-channel.ts} | 7 ++++--- .../migration/1596786425167-channel2.ts} | 7 ++++--- .../1597230137744-objectStorageSetPublicRead.ts} | 7 ++++--- .../1597236229720-IncludingNotificationTypes.ts} | 7 ++++--- .../1597385880794-add-sensitive-index.ts} | 7 ++++--- .../migration/1597459042300-channel-unread.ts} | 7 ++++--- .../1597893996136-ChannelNoteIdDescIndex.ts} | 7 ++++--- .../1600353287890-mutingNotificationTypes.ts} | 7 ++++--- .../1603094348345-refine-abuse-user-report.ts} | 7 ++++--- .../1603095701770-refine-abuse-user-report2.ts} | 7 ++++--- .../1603776877564-instance-theme-color.ts} | 7 ++++--- .../migration/1603781553011-instance-favicon.ts} | 7 ++++--- .../1604821689616-delete-auto-watch.ts} | 7 ++++--- .../migration/1605408848373-clip-description.ts} | 7 ++++--- .../migration/1605408971051-comments.ts} | 7 ++++--- .../1605585339718-instance-pinned-pages.ts} | 7 ++++--- .../migration/1605965516823-instance-images.ts} | 7 ++++--- .../migration/1606191203881-no-crawle.ts} | 7 ++++--- .../1607151207216-instance-pinned-clip.ts} | 7 ++++--- .../migration/1607353487793-isExplorable.ts} | 7 ++++--- .../migration/1610277136869-registry.ts} | 7 ++++--- .../migration/1610277585759-registry2.ts} | 7 ++++--- .../migration/1610283021566-registry3.ts} | 7 ++++--- .../migration/1611354329133-followersUri.ts} | 7 ++++--- .../migration/1611397665007-gallery.ts} | 7 ++++--- ...11547387175-objectStorageS3ForcePathStyle.ts} | 7 ++++--- .../1612619156584-announcement-email.ts} | 7 ++++--- .../1613155914446-emailNotificationTypes.ts} | 7 ++++--- .../migration/1613181457597-user-lang.ts} | 7 ++++--- .../1613503367223-use-bigint-for-driveUsage.ts} | 7 ++++--- .../migration/1615965918224-chart-v2.ts} | 7 ++++--- .../migration/1615966519402-chart-v2-2.ts} | 7 ++++--- .../1618637372000-user-last-active-date.ts} | 7 ++++--- .../1618639857000-user-hide-online-status.ts} | 7 ++++--- .../migration/1619942102890-password-reset.ts} | 7 ++++--- .../migration/1620019354680-ad.ts} | 7 ++++--- .../backend/src/migration/1620364649428-ad2.ts | 14 ++++++++++++++ .../migration/1621479946000-add-note-indexes.ts} | 7 ++++--- ...679304522-user-profile-description-length.ts} | 7 ++++--- .../1622681548499-log-message-length.ts} | 7 ++++--- .../1626509500668-fix-remote-file-proxy.ts} | 7 ++++--- .../1626733991004-allowlist-secure-mode.ts} | 7 ++++--- .../migration/1629004542760-chart-reindex.ts} | 7 ++++--- .../1629024377804-deepl-integration.ts} | 7 ++++--- .../1629288472000-fix-channel-userId.ts} | 7 ++++--- .../migration/1629512953000-user-is-deleted.ts} | 7 ++++--- .../1629778475000-deepl-integration2.ts} | 7 ++++--- .../migration/1629833361000-AddShowTLReplies.ts} | 7 ++++--- .../1629968054000_userInstanceBlocks.ts} | 7 ++++--- .../1633068642000-email-required-for-signup.ts} | 7 ++++--- .../migration/1633071909016-user-pending.ts} | 7 ++++--- .../1634486652000-user-public-reactions.ts} | 7 ++++--- .../src/migration/1634902659689-delete-log.ts | 10 ++++++++++ .../migration/1635500777168-note-thread-mute.ts} | 7 ++++--- .../migration/1636197624383-ff-visibility.ts} | 7 ++++--- .../migration/1636697408073-remove-via-mobile.ts | 14 ++++++++++++++ .../migration/1637320813000-forwarded-report.ts} | 7 ++++--- .../migration/1639325650583-chart-v3.ts} | 7 ++++--- .../migration/1642611822809-emoji-url.ts} | 7 ++++--- .../1642613870898-drive-file-webpublic-type.ts} | 7 ++++--- .../migration/1643963705770-chart-v4.ts} | 7 ++++--- .../migration/1643966656277-chart-v5.ts} | 7 ++++--- .../migration/1643967331284-chart-v6.ts} | 7 ++++--- .../1644010796173-convert-hard-mutes.ts} | 7 ++++--- .../migration/1644058404077-chart-v7.ts} | 7 ++++--- .../migration/1644059847460-chart-v8.ts} | 7 ++++--- .../migration/1644060125705-chart-v9.ts} | 7 ++++--- .../migration/1644073149413-chart-v10.ts} | 7 ++++--- .../migration/1644095659741-chart-v11.ts} | 7 ++++--- .../migration/1644328606241-chart-v12.ts} | 7 ++++--- .../migration/1644331238153-chart-v13.ts} | 7 ++++--- .../migration/1644344266289-chart-v14.ts} | 7 ++++--- .../1644395759931-instance-theme-color.ts | 14 ++++++++++++++ .../migration/1644481657998-chart-v15.ts} | 7 ++++--- .../1644551208096-following-indexes.ts} | 7 ++++--- ...1645340161439-remove-max-note-text-length.ts} | 7 ++++--- .../1645599900873-federation-chart-pubsub.ts} | 7 ++++--- .../1646143552768-instance-default-theme.ts} | 7 ++++--- .../migration/1646387162108-mute-expires-at.ts} | 7 ++++--- .../1646549089451-poll-ended-notification.ts} | 7 ++++--- .../1646633030285-chart-federation-active.ts} | 7 ++++--- ...46655454495-remove-instance-drive-columns.ts} | 7 ++++--- ...732390560-chart-federation-active-sub-pub.ts} | 7 ++++--- .../migration/1648548247382-webhook.ts} | 7 ++++--- .../migration/1648816172177-webhook-2.ts} | 7 ++++--- .../migration/1651224615271-foreign-key.ts} | 7 ++++--- .../1652859567549-uniform-themecolor.ts} | 7 ++++--- .../migration/1655368940105-nsfw-detection.ts} | 7 ++++--- .../migration/1655371960534-nsfw-detection-2.ts} | 7 ++++--- .../migration/1655388169582-nsfw-detection-3.ts} | 7 ++++--- .../migration/1655393015659-nsfw-detection-4.ts} | 7 ++++--- .../1655813815729-driveCapacityOverrideMb.ts} | 7 ++++--- .../migration/1655918165614-user-ip.ts} | 7 ++++--- .../migration/1656122560740-file-ip.ts} | 7 ++++--- .../migration/1656251734807-nsfw-detection-5.ts} | 7 ++++--- .../migration/1656328812281-ip-2.ts} | 7 ++++--- .../migration/1656408772602-nsfw-detection-6.ts} | 7 ++++--- .../1656772790599-user-moderation-note.ts} | 7 ++++--- .../1657346559800-active-email-validation.ts} | 7 ++++--- .../migration/1658203170545firefish.ts} | 7 ++++--- .../1658656633972-note-replies-function.ts} | 7 ++++--- .../src/migration/1658939464003CustomMOTD.ts | 11 +++++++++++ .../migration/1658941974648CustomSplashIcons.ts | 13 +++++++++++++ .../migration/1658981842728FixCalckey.ts} | 7 ++++--- .../1659042130648RecommendedTimeline.ts} | 7 ++++--- .../migration/1660068273737GuestTimeline.ts} | 7 ++++--- .../1665091090561-add-renote-muting.ts} | 7 ++++--- .../src/migration/1668828368510PageDraft.ts | 11 +++++++++++ .../migration/1668831378728FixCalckeyAgain.ts | 16 ++++++++++++++++ ...716634-whetherPushNotifyToSendReadMessage.ts} | 7 ++++--- .../1669288094000-AddMovedToAndKnownAs.ts} | 7 ++++--- ...-AddFkAbuseUserReportTargetUserIdToUserId.ts} | 7 ++++--- .../migration/1671388343000-CalckeyRepoMove.ts} | 7 ++++--- .../migration/1672882664294-DefaultReaction.ts} | 7 ++++--- .../migration/1673336077243-PollChoiceLength.ts} | 7 ++++--- .../migration/1676093997212-AntennaInstances.ts} | 7 ++++--- .../migration/1677935903517-DriveComment.ts} | 7 ++++--- .../1678426061773-tweak-varchar-length.ts} | 7 ++++--- .../1678945242650-add-props-for-custom-emoji.ts | 14 ++++++++++++++ .../migration/1679269929000-fix-repo.ts} | 7 ++++--- .../migration/1680375641101-clean-charts.ts} | 7 ++++--- .../migration/1680426269172-SpeakAsCat.ts} | 7 ++++--- .../migration/1682753227899-NoteEdit.ts} | 7 ++++--- .../migration/1682777547198-LibreTranslate.ts} | 7 ++++--- .../migration/1682891890317-InstanceSilence.ts} | 7 ++++--- .../migration/1682891891317-AddHiddenPosts.ts} | 7 ++++--- .../1683682889948-PreventAiLearning.ts} | 7 ++++--- .../1683980686995-ExperimentalFeatures.ts} | 7 ++++--- .../1684206886988-remove-showTimelineReplies.ts} | 7 ++++--- .../migration/1684494870830-EmojiSize.ts} | 7 ++++--- .../migration/1688280713783-add-meta-options.ts} | 7 ++++--- .../1688845537045-announcement-popup.ts} | 7 ++++--- .../migration/1689136347561-donation-link.ts} | 7 ++++--- .../migration/1689739513827-firefish-repo.ts} | 7 ++++--- .../migration/1689965609061-iceshrimp-repo.ts} | 7 ++++--- .../migration/1695747439252-drop-reversi.ts} | 7 ++++--- .../migration/1695748502971-index-note-url.ts | 11 +++++++++++ .../migration/1695748874491-drop-ads.ts} | 7 ++++--- ...749386779-instance-account-domain-cleanup.ts} | 7 ++++--- .../1695749948350-move-antenna-to-cache.ts} | 9 +++++---- .../migration/1695861526125-index-note-userid.ts | 11 +++++++++++ .../backend/{ormconfig.js => src/ormconfig.ts} | 6 +++--- 217 files changed, 941 insertions(+), 745 deletions(-) delete mode 100644 packages/backend/migration/1557476068003-PinnedUsers.js delete mode 100644 packages/backend/migration/1558266512381-UserListJoining.js delete mode 100644 packages/backend/migration/1562422242907-PasswordLessLogin.js delete mode 100644 packages/backend/migration/1562448332510-PageTitleHideOption.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/1620364649428-ad2.js delete mode 100644 packages/backend/migration/1634902659689-delete-log.js delete mode 100644 packages/backend/migration/1636697408073-remove-via-mobile.js delete mode 100644 packages/backend/migration/1644395759931-instance-theme-color.js delete mode 100644 packages/backend/migration/1658939464003CustomMOTD.js delete mode 100644 packages/backend/migration/1658941974648CustomSplashIcons.js delete mode 100644 packages/backend/migration/1668828368510PageDraft.js delete mode 100644 packages/backend/migration/1668831378728FixCalckeyAgain.js delete mode 100644 packages/backend/migration/1678945242650-add-props-for-custom-emoji.js delete mode 100644 packages/backend/migration/1695748502971-index-note-url.js delete mode 100644 packages/backend/migration/1695861526125-index-note-userid.js rename packages/backend/{migration/1000000000000-Init.js => src/migration/1000000000000-Init.ts} (99%) rename packages/backend/{migration/1556348509290-Pages.js => src/migration/1556348509290-Pages.ts} (92%) rename packages/backend/{migration/1556746559567-UserProfile.js => src/migration/1556746559567-UserProfile.ts} (72%) create mode 100644 packages/backend/src/migration/1557476068003-PinnedUsers.ts rename packages/backend/{migration/1557761316509-AddSomeUrls.js => src/migration/1557761316509-AddSomeUrls.ts} (72%) rename packages/backend/{migration/1557932705754-ObjectStorageSetting.js => src/migration/1557932705754-ObjectStorageSetting.ts} (88%) rename packages/backend/{migration/1558072954435-PageLike.js => src/migration/1558072954435-PageLike.ts} (86%) rename packages/backend/{migration/1558103093633-UserGroup.js => src/migration/1558103093633-UserGroup.ts} (94%) rename packages/backend/{migration/1558257926829-UserGroupInvite.js => src/migration/1558257926829-UserGroupInvite.ts} (88%) create mode 100644 packages/backend/src/migration/1558266512381-UserListJoining.ts rename packages/backend/{migration/1561706992953-webauthn.js => src/migration/1561706992953-webauthn.ts} (91%) rename packages/backend/{migration/1561873850023-ChartIndexes.js => src/migration/1561873850023-ChartIndexes.ts} (98%) create mode 100644 packages/backend/src/migration/1562422242907-PasswordLessLogin.ts rename packages/backend/{migration/1562444565093-PinnedPage.js => src/migration/1562444565093-PinnedPage.ts} (76%) create mode 100644 packages/backend/src/migration/1562448332510-PageTitleHideOption.ts rename packages/backend/{migration/1562869971568-ModerationLog.js => src/migration/1562869971568-ModerationLog.ts} (78%) rename packages/backend/{migration/1563757595828-UsedUsername.js => src/migration/1563757595828-UsedUsername.ts} (55%) create mode 100644 packages/backend/src/migration/1565634203341-room.ts create mode 100644 packages/backend/src/migration/1571220798684-CustomEmojiCategory.ts rename packages/backend/{migration/1572760203493-nodeinfo.js => src/migration/1572760203493-nodeinfo.ts} (89%) rename packages/backend/{migration/1576269851876-TalkFederationId.js => src/migration/1576269851876-TalkFederationId.ts} (54%) rename packages/backend/{migration/1576869585998-ProxyRemoteFiles.js => src/migration/1576869585998-ProxyRemoteFiles.ts} (55%) rename packages/backend/{migration/1579267006611-v12.js => src/migration/1579267006611-v12.ts} (93%) rename packages/backend/{migration/1579270193251-v12-2.js => src/migration/1579270193251-v12-2.ts} (57%) rename packages/backend/{migration/1579282808087-v12-3.js => src/migration/1579282808087-v12-3.ts} (55%) rename packages/backend/{migration/1579544426412-v12-4.js => src/migration/1579544426412-v12-4.ts} (73%) rename packages/backend/{migration/1579977526288-v12-5.js => src/migration/1579977526288-v12-5.ts} (96%) rename packages/backend/{migration/1579993013959-v12-6.js => src/migration/1579993013959-v12-6.ts} (75%) rename packages/backend/{migration/1580069531114-v12-7.js => src/migration/1580069531114-v12-7.ts} (86%) rename packages/backend/{migration/1580148575182-v12-8.js => src/migration/1580148575182-v12-8.ts} (71%) rename packages/backend/{migration/1580154400017-v12-9.js => src/migration/1580154400017-v12-9.ts} (55%) rename packages/backend/{migration/1580276619901-v12-10.js => src/migration/1580276619901-v12-10.ts} (79%) rename packages/backend/{migration/1580331224276-v12-11.js => src/migration/1580331224276-v12-11.ts} (76%) rename packages/backend/{migration/1580508795118-v12-12.js => src/migration/1580508795118-v12-12.ts} (94%) rename packages/backend/{migration/1580543501339-v12-13.js => src/migration/1580543501339-v12-13.ts} (51%) rename packages/backend/{migration/1580864313253-v12-14.js => src/migration/1580864313253-v12-14.ts} (82%) rename packages/backend/{migration/1581526429287-user-group-invitation.js => src/migration/1581526429287-user-group-invitation.ts} (94%) rename packages/backend/{migration/1581695816408-user-group-antenna.js => src/migration/1581695816408-user-group-antenna.ts} (89%) rename packages/backend/{migration/1581708415836-drive-user-folder-id-index.js => src/migration/1581708415836-drive-user-folder-id-index.ts} (56%) rename packages/backend/{migration/1581979837262-promo.js => src/migration/1581979837262-promo.ts} (91%) rename packages/backend/{migration/1582019042083-featured-injecttion.js => src/migration/1582019042083-featured-injecttion.ts} (56%) rename packages/backend/{migration/1582210532752-antenna-exclude.js => src/migration/1582210532752-antenna-exclude.ts} (55%) rename packages/backend/{migration/1582875306439-note-reaction-length.js => src/migration/1582875306439-note-reaction-length.ts} (58%) rename packages/backend/{migration/1585361548360-miauth.js => src/migration/1585361548360-miauth.ts} (92%) rename packages/backend/{migration/1585385921215-custom-notification.js => src/migration/1585385921215-custom-notification.ts} (95%) rename packages/backend/{migration/1585772678853-ap-url.js => src/migration/1585772678853-ap-url.ts} (51%) rename packages/backend/{migration/1586624197029-AddObjectStorageUseProxy.js => src/migration/1586624197029-AddObjectStorageUseProxy.ts} (56%) rename packages/backend/{migration/1586641139527-remote-reaction.js => src/migration/1586641139527-remote-reaction.ts} (58%) rename packages/backend/{migration/1586708940386-pageAiScript.js => src/migration/1586708940386-pageAiScript.ts} (55%) rename packages/backend/{migration/1588044505511-hCaptcha.js => src/migration/1588044505511-hCaptcha.ts} (75%) rename packages/backend/{migration/1589023282116-pubRelay.js => src/migration/1589023282116-pubRelay.ts} (77%) rename packages/backend/{migration/1595075960584-blurhash.js => src/migration/1595075960584-blurhash.ts} (51%) rename packages/backend/{migration/1595077605646-blurhash-for-avatar-banner.js => src/migration/1595077605646-blurhash-for-avatar-banner.ts} (75%) rename packages/backend/{migration/1595676934834-instance-icon-url.js => src/migration/1595676934834-instance-icon-url.ts} (51%) rename packages/backend/{migration/1595771249699-word-mute.js => src/migration/1595771249699-word-mute.ts} (90%) rename packages/backend/{migration/1595782306083-word-mute2.js => src/migration/1595782306083-word-mute2.ts} (72%) rename packages/backend/{migration/1596548170836-channel.js => src/migration/1596548170836-channel.ts} (96%) rename packages/backend/{migration/1596786425167-channel2.js => src/migration/1596786425167-channel2.ts} (54%) rename packages/backend/{migration/1597230137744-objectStorageSetPublicRead.js => src/migration/1597230137744-objectStorageSetPublicRead.ts} (54%) rename packages/backend/{migration/1597236229720-IncludingNotificationTypes.js => src/migration/1597236229720-IncludingNotificationTypes.ts} (73%) rename packages/backend/{migration/1597385880794-add-sensitive-index.js => src/migration/1597385880794-add-sensitive-index.ts} (52%) rename packages/backend/{migration/1597459042300-channel-unread.js => src/migration/1597459042300-channel-unread.ts} (86%) rename packages/backend/{migration/1597893996136-ChannelNoteIdDescIndex.js => src/migration/1597893996136-ChannelNoteIdDescIndex.ts} (65%) rename packages/backend/{migration/1600353287890-mutingNotificationTypes.js => src/migration/1600353287890-mutingNotificationTypes.ts} (84%) rename packages/backend/{migration/1603094348345-refine-abuse-user-report.js => src/migration/1603094348345-refine-abuse-user-report.ts} (90%) rename packages/backend/{migration/1603095701770-refine-abuse-user-report2.js => src/migration/1603095701770-refine-abuse-user-report2.ts} (78%) rename packages/backend/{migration/1603776877564-instance-theme-color.js => src/migration/1603776877564-instance-theme-color.ts} (52%) rename packages/backend/{migration/1603781553011-instance-favicon.js => src/migration/1603781553011-instance-favicon.ts} (52%) rename packages/backend/{migration/1604821689616-delete-auto-watch.js => src/migration/1604821689616-delete-auto-watch.ts} (53%) rename packages/backend/{migration/1605408848373-clip-description.js => src/migration/1605408848373-clip-description.ts} (51%) rename packages/backend/{migration/1605408971051-comments.js => src/migration/1605408971051-comments.ts} (99%) rename packages/backend/{migration/1605585339718-instance-pinned-pages.js => src/migration/1605585339718-instance-pinned-pages.ts} (59%) rename packages/backend/{migration/1605965516823-instance-images.js => src/migration/1605965516823-instance-images.ts} (64%) rename packages/backend/{migration/1606191203881-no-crawle.js => src/migration/1606191203881-no-crawle.ts} (68%) rename packages/backend/{migration/1607151207216-instance-pinned-clip.js => src/migration/1607151207216-instance-pinned-clip.ts} (50%) rename packages/backend/{migration/1607353487793-isExplorable.js => src/migration/1607353487793-isExplorable.ts} (73%) rename packages/backend/{migration/1610277136869-registry.js => src/migration/1610277136869-registry.ts} (88%) rename packages/backend/{migration/1610277585759-registry2.js => src/migration/1610277585759-registry2.ts} (67%) rename packages/backend/{migration/1610283021566-registry3.js => src/migration/1610283021566-registry3.ts} (53%) rename packages/backend/{migration/1611354329133-followersUri.js => src/migration/1611354329133-followersUri.ts} (71%) rename packages/backend/{migration/1611397665007-gallery.js => src/migration/1611397665007-gallery.ts} (94%) rename packages/backend/{migration/1611547387175-objectStorageS3ForcePathStyle.js => src/migration/1611547387175-objectStorageS3ForcePathStyle.ts} (55%) rename packages/backend/{migration/1612619156584-announcement-email.js => src/migration/1612619156584-announcement-email.ts} (55%) rename packages/backend/{migration/1613155914446-emailNotificationTypes.js => src/migration/1613155914446-emailNotificationTypes.ts} (58%) rename packages/backend/{migration/1613181457597-user-lang.js => src/migration/1613181457597-user-lang.ts} (50%) rename packages/backend/{migration/1613503367223-use-bigint-for-driveUsage.js => src/migration/1613503367223-use-bigint-for-driveUsage.ts} (59%) rename packages/backend/{migration/1615965918224-chart-v2.js => src/migration/1615965918224-chart-v2.ts} (98%) rename packages/backend/{migration/1615966519402-chart-v2-2.js => src/migration/1615966519402-chart-v2-2.ts} (84%) rename packages/backend/{migration/1618637372000-user-last-active-date.js => src/migration/1618637372000-user-last-active-date.ts} (65%) rename packages/backend/{migration/1618639857000-user-hide-online-status.js => src/migration/1618639857000-user-hide-online-status.ts} (53%) rename packages/backend/{migration/1619942102890-password-reset.js => src/migration/1619942102890-password-reset.ts} (83%) rename packages/backend/{migration/1620019354680-ad.js => src/migration/1620019354680-ad.ts} (82%) create mode 100644 packages/backend/src/migration/1620364649428-ad2.ts rename packages/backend/{migration/1621479946000-add-note-indexes.js => src/migration/1621479946000-add-note-indexes.ts} (66%) rename packages/backend/{migration/1622679304522-user-profile-description-length.js => src/migration/1622679304522-user-profile-description-length.ts} (58%) rename packages/backend/{migration/1622681548499-log-message-length.js => src/migration/1622681548499-log-message-length.ts} (56%) rename packages/backend/{migration/1626509500668-fix-remote-file-proxy.js => src/migration/1626509500668-fix-remote-file-proxy.ts} (79%) rename packages/backend/{migration/1626733991004-allowlist-secure-mode.js => src/migration/1626733991004-allowlist-secure-mode.ts} (70%) rename packages/backend/{migration/1629004542760-chart-reindex.js => src/migration/1629004542760-chart-reindex.ts} (98%) rename packages/backend/{migration/1629024377804-deepl-integration.js => src/migration/1629024377804-deepl-integration.ts} (50%) rename packages/backend/{migration/1629288472000-fix-channel-userId.js => src/migration/1629288472000-fix-channel-userId.ts} (52%) rename packages/backend/{migration/1629512953000-user-is-deleted.js => src/migration/1629512953000-user-is-deleted.ts} (59%) rename packages/backend/{migration/1629778475000-deepl-integration2.js => src/migration/1629778475000-deepl-integration2.ts} (51%) rename packages/backend/{migration/1629833361000-AddShowTLReplies.js => src/migration/1629833361000-AddShowTLReplies.ts} (64%) rename packages/backend/{migration/1629968054000_userInstanceBlocks.js => src/migration/1629968054000_userInstanceBlocks.ts} (62%) rename packages/backend/{migration/1633068642000-email-required-for-signup.js => src/migration/1633068642000-email-required-for-signup.ts} (54%) rename packages/backend/{migration/1633071909016-user-pending.js => src/migration/1633071909016-user-pending.ts} (74%) rename packages/backend/{migration/1634486652000-user-public-reactions.js => src/migration/1634486652000-user-public-reactions.ts} (54%) create mode 100644 packages/backend/src/migration/1634902659689-delete-log.ts rename packages/backend/{migration/1635500777168-note-thread-mute.js => src/migration/1635500777168-note-thread-mute.ts} (88%) rename packages/backend/{migration/1636197624383-ff-visibility.js => src/migration/1636197624383-ff-visibility.ts} (69%) create mode 100644 packages/backend/src/migration/1636697408073-remove-via-mobile.ts rename packages/backend/{migration/1637320813000-forwarded-report.js => src/migration/1637320813000-forwarded-report.ts} (51%) rename packages/backend/{migration/1639325650583-chart-v3.js => src/migration/1639325650583-chart-v3.ts} (99%) rename packages/backend/{migration/1642611822809-emoji-url.js => src/migration/1642611822809-emoji-url.ts} (64%) rename packages/backend/{migration/1642613870898-drive-file-webpublic-type.js => src/migration/1642613870898-drive-file-webpublic-type.ts} (50%) rename packages/backend/{migration/1643963705770-chart-v4.js => src/migration/1643963705770-chart-v4.ts} (96%) rename packages/backend/{migration/1643966656277-chart-v5.js => src/migration/1643966656277-chart-v5.ts} (90%) rename packages/backend/{migration/1643967331284-chart-v6.js => src/migration/1643967331284-chart-v6.ts} (99%) rename packages/backend/{migration/1644010796173-convert-hard-mutes.js => src/migration/1644010796173-convert-hard-mutes.ts} (87%) rename packages/backend/{migration/1644058404077-chart-v7.js => src/migration/1644058404077-chart-v7.ts} (99%) rename packages/backend/{migration/1644059847460-chart-v8.js => src/migration/1644059847460-chart-v8.ts} (88%) rename packages/backend/{migration/1644060125705-chart-v9.js => src/migration/1644060125705-chart-v9.ts} (88%) rename packages/backend/{migration/1644073149413-chart-v10.js => src/migration/1644073149413-chart-v10.ts} (93%) rename packages/backend/{migration/1644095659741-chart-v11.js => src/migration/1644095659741-chart-v11.ts} (97%) rename packages/backend/{migration/1644328606241-chart-v12.js => src/migration/1644328606241-chart-v12.ts} (89%) rename packages/backend/{migration/1644331238153-chart-v13.js => src/migration/1644331238153-chart-v13.ts} (81%) rename packages/backend/{migration/1644344266289-chart-v14.js => src/migration/1644344266289-chart-v14.ts} (94%) create mode 100644 packages/backend/src/migration/1644395759931-instance-theme-color.ts rename packages/backend/{migration/1644481657998-chart-v15.js => src/migration/1644481657998-chart-v15.ts} (90%) rename packages/backend/{migration/1644551208096-following-indexes.js => src/migration/1644551208096-following-indexes.ts} (65%) rename packages/backend/{migration/1645340161439-remove-max-note-text-length.js => src/migration/1645340161439-remove-max-note-text-length.ts} (50%) rename packages/backend/{migration/1645599900873-federation-chart-pubsub.js => src/migration/1645599900873-federation-chart-pubsub.ts} (66%) rename packages/backend/{migration/1646143552768-instance-default-theme.js => src/migration/1646143552768-instance-default-theme.ts} (64%) rename packages/backend/{migration/1646387162108-mute-expires-at.js => src/migration/1646387162108-mute-expires-at.ts} (64%) rename packages/backend/{migration/1646549089451-poll-ended-notification.js => src/migration/1646549089451-poll-ended-notification.ts} (84%) rename packages/backend/{migration/1646633030285-chart-federation-active.js => src/migration/1646633030285-chart-federation-active.ts} (66%) rename packages/backend/{migration/1646655454495-remove-instance-drive-columns.js => src/migration/1646655454495-remove-instance-drive-columns.ts} (63%) rename packages/backend/{migration/1646732390560-chart-federation-active-sub-pub.js => src/migration/1646732390560-chart-federation-active-sub-pub.ts} (84%) rename packages/backend/{migration/1648548247382-webhook.js => src/migration/1648548247382-webhook.ts} (87%) rename packages/backend/{migration/1648816172177-webhook-2.js => src/migration/1648816172177-webhook-2.ts} (62%) rename packages/backend/{migration/1651224615271-foreign-key.js => src/migration/1651224615271-foreign-key.ts} (96%) rename packages/backend/{migration/1652859567549-uniform-themecolor.js => src/migration/1652859567549-uniform-themecolor.ts} (83%) rename packages/backend/{migration/1655368940105-nsfw-detection.js => src/migration/1655368940105-nsfw-detection.ts} (87%) rename packages/backend/{migration/1655371960534-nsfw-detection-2.js => src/migration/1655371960534-nsfw-detection-2.ts} (77%) rename packages/backend/{migration/1655388169582-nsfw-detection-3.js => src/migration/1655388169582-nsfw-detection-3.ts} (89%) rename packages/backend/{migration/1655393015659-nsfw-detection-4.js => src/migration/1655393015659-nsfw-detection-4.ts} (89%) rename packages/backend/{migration/1655813815729-driveCapacityOverrideMb.js => src/migration/1655813815729-driveCapacityOverrideMb.ts} (67%) rename packages/backend/{migration/1655918165614-user-ip.js => src/migration/1655918165614-user-ip.ts} (82%) rename packages/backend/{migration/1656122560740-file-ip.js => src/migration/1656122560740-file-ip.ts} (64%) rename packages/backend/{migration/1656251734807-nsfw-detection-5.js => src/migration/1656251734807-nsfw-detection-5.ts} (91%) rename packages/backend/{migration/1656328812281-ip-2.js => src/migration/1656328812281-ip-2.ts} (69%) rename packages/backend/{migration/1656408772602-nsfw-detection-6.js => src/migration/1656408772602-nsfw-detection-6.ts} (54%) rename packages/backend/{migration/1656772790599-user-moderation-note.js => src/migration/1656772790599-user-moderation-note.ts} (53%) rename packages/backend/{migration/1657346559800-active-email-validation.js => src/migration/1657346559800-active-email-validation.ts} (52%) rename packages/backend/{migration/1658203170545firefish.js => src/migration/1658203170545firefish.ts} (67%) rename packages/backend/{migration/1658656633972-note-replies-function.js => src/migration/1658656633972-note-replies-function.ts} (83%) create mode 100644 packages/backend/src/migration/1658939464003CustomMOTD.ts create mode 100644 packages/backend/src/migration/1658941974648CustomSplashIcons.ts rename packages/backend/{migration/1658981842728FixCalckey.js => src/migration/1658981842728FixCalckey.ts} (74%) rename packages/backend/{migration/1659042130648RecommendedTimeline.js => src/migration/1659042130648RecommendedTimeline.ts} (67%) rename packages/backend/{migration/1660068273737GuestTimeline.js => src/migration/1660068273737GuestTimeline.ts} (51%) rename packages/backend/{migration/1665091090561-add-renote-muting.js => src/migration/1665091090561-add-renote-muting.ts} (73%) create mode 100644 packages/backend/src/migration/1668828368510PageDraft.ts create mode 100644 packages/backend/src/migration/1668831378728FixCalckeyAgain.ts rename packages/backend/{migration/1669138716634-whetherPushNotifyToSendReadMessage.js => src/migration/1669138716634-whetherPushNotifyToSendReadMessage.ts} (52%) rename packages/backend/{migration/1669288094000-AddMovedToAndKnownAs.js => src/migration/1669288094000-AddMovedToAndKnownAs.ts} (71%) rename packages/backend/{migration/1671199573000-AddFkAbuseUserReportTargetUserIdToUserId.js => src/migration/1671199573000-AddFkAbuseUserReportTargetUserIdToUserId.ts} (74%) rename packages/backend/{migration/1671388343000-CalckeyRepoMove.js => src/migration/1671388343000-CalckeyRepoMove.ts} (72%) rename packages/backend/{migration/1672882664294-DefaultReaction.js => src/migration/1672882664294-DefaultReaction.ts} (61%) rename packages/backend/{migration/1673336077243-PollChoiceLength.js => src/migration/1673336077243-PollChoiceLength.ts} (53%) rename packages/backend/{migration/1676093997212-AntennaInstances.js => src/migration/1676093997212-AntennaInstances.ts} (78%) rename packages/backend/{migration/1677935903517-DriveComment.js => src/migration/1677935903517-DriveComment.ts} (52%) rename packages/backend/{migration/1678426061773-tweak-varchar-length.js => src/migration/1678426061773-tweak-varchar-length.ts} (54%) create mode 100644 packages/backend/src/migration/1678945242650-add-props-for-custom-emoji.ts rename packages/backend/{migration/1679269929000-fix-repo.js => src/migration/1679269929000-fix-repo.ts} (68%) rename packages/backend/{migration/1680375641101-clean-charts.js => src/migration/1680375641101-clean-charts.ts} (75%) rename packages/backend/{migration/1680426269172-SpeakAsCat.js => src/migration/1680426269172-SpeakAsCat.ts} (63%) rename packages/backend/{migration/1682753227899-NoteEdit.js => src/migration/1682753227899-NoteEdit.ts} (85%) rename packages/backend/{migration/1682777547198-LibreTranslate.js => src/migration/1682777547198-LibreTranslate.ts} (65%) rename packages/backend/{migration/1682891890317-InstanceSilence.js => src/migration/1682891890317-InstanceSilence.ts} (51%) rename packages/backend/{migration/1682891891317-AddHiddenPosts.js => src/migration/1682891891317-AddHiddenPosts.ts} (51%) rename packages/backend/{migration/1683682889948-PreventAiLearning.js => src/migration/1683682889948-PreventAiLearning.ts} (52%) rename packages/backend/{migration/1683980686995-ExperimentalFeatures.js => src/migration/1683980686995-ExperimentalFeatures.ts} (51%) rename packages/backend/{migration/1684206886988-remove-showTimelineReplies.js => src/migration/1684206886988-remove-showTimelineReplies.ts} (51%) rename packages/backend/{migration/1684494870830-EmojiSize.js => src/migration/1684494870830-EmojiSize.ts} (68%) rename packages/backend/{migration/1688280713783-add-meta-options.js => src/migration/1688280713783-add-meta-options.ts} (66%) rename packages/backend/{migration/1688845537045-announcement-popup.js => src/migration/1688845537045-announcement-popup.ts} (65%) rename packages/backend/{migration/1689136347561-donation-link.js => src/migration/1689136347561-donation-link.ts} (50%) rename packages/backend/{migration/1689739513827-firefish-repo.js => src/migration/1689739513827-firefish-repo.ts} (68%) rename packages/backend/{migration/1689965609061-iceshrimp-repo.js => src/migration/1689965609061-iceshrimp-repo.ts} (68%) rename packages/backend/{migration/1695747439252-drop-reversi.js => src/migration/1695747439252-drop-reversi.ts} (93%) create mode 100644 packages/backend/src/migration/1695748502971-index-note-url.ts rename packages/backend/{migration/1695748874491-drop-ads.js => src/migration/1695748874491-drop-ads.ts} (83%) rename packages/backend/{migration/1695749386779-instance-account-domain-cleanup.js => src/migration/1695749386779-instance-account-domain-cleanup.ts} (63%) rename packages/backend/{migration/1695749948350-move-antenna-to-cache.js => src/migration/1695749948350-move-antenna-to-cache.ts} (91%) create mode 100644 packages/backend/src/migration/1695861526125-index-note-userid.ts rename packages/backend/{ormconfig.js => src/ormconfig.ts} (67%) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 09a6962f5..7efdcc7ca 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -253,7 +253,7 @@ MongoDBは`null`で返してきてたので、その感覚で`if (x === null)` ### Migration作成方法 packages/backendで: ```sh -pnpm dlx typeorm migration:generate -d ormconfig.js -o +yarn workspace backend run generatemigration src/migration/ ``` - 生成後、ファイルをmigration下に移してください diff --git a/packages/backend/migration/1557476068003-PinnedUsers.js b/packages/backend/migration/1557476068003-PinnedUsers.js deleted file mode 100644 index 6f348836a..000000000 --- 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/1558266512381-UserListJoining.js b/packages/backend/migration/1558266512381-UserListJoining.js deleted file mode 100644 index 3597e51f7..000000000 --- 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/1562422242907-PasswordLessLogin.js b/packages/backend/migration/1562422242907-PasswordLessLogin.js deleted file mode 100644 index 8e1280830..000000000 --- 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/1562448332510-PageTitleHideOption.js b/packages/backend/migration/1562448332510-PageTitleHideOption.js deleted file mode 100644 index 9a1b42f4b..000000000 --- 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/1565634203341-room.js b/packages/backend/migration/1565634203341-room.js deleted file mode 100644 index 1023c0a31..000000000 --- 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 4d7531332..000000000 --- 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/1620364649428-ad2.js b/packages/backend/migration/1620364649428-ad2.js deleted file mode 100644 index a61c3ef08..000000000 --- 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/1634902659689-delete-log.js b/packages/backend/migration/1634902659689-delete-log.js deleted file mode 100644 index fc148f098..000000000 --- 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/1636697408073-remove-via-mobile.js b/packages/backend/migration/1636697408073-remove-via-mobile.js deleted file mode 100644 index f86276024..000000000 --- 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/1644395759931-instance-theme-color.js b/packages/backend/migration/1644395759931-instance-theme-color.js deleted file mode 100644 index 1e0ee04bc..000000000 --- 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/1658939464003CustomMOTD.js b/packages/backend/migration/1658939464003CustomMOTD.js deleted file mode 100644 index ee1b182e5..000000000 --- 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 5c6a874d0..000000000 --- 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/1668828368510PageDraft.js b/packages/backend/migration/1668828368510PageDraft.js deleted file mode 100644 index a5cc88b26..000000000 --- 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 33db2b15a..000000000 --- a/packages/backend/migration/1668831378728FixCalckeyAgain.js +++ /dev/null @@ -1,15 +0,0 @@ -export class FixFirefishAgain1668831378728 { - name = "FixFirefishAgain1668831378728"; - - 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/1678945242650-add-props-for-custom-emoji.js b/packages/backend/migration/1678945242650-add-props-for-custom-emoji.js deleted file mode 100644 index f3de7ce27..000000000 --- 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/1695748502971-index-note-url.js b/packages/backend/migration/1695748502971-index-note-url.js deleted file mode 100644 index d1693d724..000000000 --- a/packages/backend/migration/1695748502971-index-note-url.js +++ /dev/null @@ -1,10 +0,0 @@ -export class IndexNoteUrl1695748502971 { - name = "IndexNoteUrl1695748502971"; - async up(queryRunner) { - await queryRunner.query(`CREATE INDEX IF NOT EXISTS "IDX_note_url" ON "note" ("url") `); - } - - async down(queryRunner) { - await queryRunner.query(`DROP INDEX IF EXISTS "IDX_note_url"`); - } -} diff --git a/packages/backend/migration/1695861526125-index-note-userid.js b/packages/backend/migration/1695861526125-index-note-userid.js deleted file mode 100644 index 7fd991aef..000000000 --- a/packages/backend/migration/1695861526125-index-note-userid.js +++ /dev/null @@ -1,10 +0,0 @@ -export class IndexNoteUserId1695861526125 { - name = "IndexNoteUserId1695861526125"; - async up(queryRunner) { - await queryRunner.query(`CREATE INDEX "IDX_note_userId_id" ON "note" ("userId", "id")`); - } - - async down(queryRunner) { - await queryRunner.query(`DROP INDEX "IDX_note_userId_id"`); - } -} diff --git a/packages/backend/package.json b/packages/backend/package.json index f029350e0..883ac91fa 100644 --- a/packages/backend/package.json +++ b/packages/backend/package.json @@ -6,10 +6,9 @@ "scripts": { "start": "node ./built/index.js", "start:test": "NODE_ENV=test node ./built/index.js", - "migrate": "yarn migrate:typeorm", - "migrate:typeorm": "typeorm migration:run -d ormconfig.js", - "revertmigration": "yarn revertmigration:typeorm", - "revertmigration:typeorm": "typeorm migration:revert -d ormconfig.js", + "migrate": "typeorm migration:run -d built/ormconfig.js", + "revertmigration": "typeorm migration:revert -d built/ormconfig.js", + "generatemigration": "yarn build && typeorm migration:generate -d built/ormconfig.js", "check:connect": "node ./check_connect.js", "build": "swc src -d built -D", "build:debug": "swc src -d built -s -D", diff --git a/packages/backend/migration/1000000000000-Init.js b/packages/backend/src/migration/1000000000000-Init.ts similarity index 99% rename from packages/backend/migration/1000000000000-Init.js rename to packages/backend/src/migration/1000000000000-Init.ts index bab5fae7a..af8c6682e 100644 --- a/packages/backend/migration/1000000000000-Init.js +++ b/packages/backend/src/migration/1000000000000-Init.ts @@ -1,5 +1,6 @@ -export class Init1000000000000 { - async up(queryRunner) { +import { MigrationInterface, QueryRunner } from "typeorm"; +export class Init1000000000000 implements MigrationInterface { + async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `CREATE TYPE "log_level_enum" AS ENUM('error', 'warning', 'info', 'success', 'debug')`, ); @@ -712,7 +713,7 @@ export class Init1000000000000 { `ALTER TABLE "user_profile" ADD CONSTRAINT "FK_51cb79b5555effaf7d69ba1cff9" FOREIGN KEY ("userId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, ); } - async down(queryRunner) { + async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "user_profile" DROP CONSTRAINT "FK_51cb79b5555effaf7d69ba1cff9"`, ); diff --git a/packages/backend/migration/1556348509290-Pages.js b/packages/backend/src/migration/1556348509290-Pages.ts similarity index 92% rename from packages/backend/migration/1556348509290-Pages.js rename to packages/backend/src/migration/1556348509290-Pages.ts index 696b2acbe..22f62621a 100644 --- a/packages/backend/migration/1556348509290-Pages.js +++ b/packages/backend/src/migration/1556348509290-Pages.ts @@ -1,5 +1,6 @@ -export class Pages1556348509290 { - async up(queryRunner) { +import { MigrationInterface, QueryRunner } from "typeorm"; +export class Pages1556348509290 implements MigrationInterface { + async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `CREATE TYPE "page_visibility_enum" AS ENUM('public', 'followers', 'specified')`, ); @@ -31,7 +32,7 @@ export class Pages1556348509290 { `ALTER TABLE "page" ADD CONSTRAINT "FK_3126dd7c502c9e4d7597ef7ef10" FOREIGN KEY ("eyeCatchingImageId") REFERENCES "drive_file"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, ); } - async down(queryRunner) { + async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "page" DROP CONSTRAINT "FK_3126dd7c502c9e4d7597ef7ef10"`, ); diff --git a/packages/backend/migration/1556746559567-UserProfile.js b/packages/backend/src/migration/1556746559567-UserProfile.ts similarity index 72% rename from packages/backend/migration/1556746559567-UserProfile.js rename to packages/backend/src/migration/1556746559567-UserProfile.ts index d229ec519..51bb7ed7a 100644 --- a/packages/backend/migration/1556746559567-UserProfile.js +++ b/packages/backend/src/migration/1556746559567-UserProfile.ts @@ -1,5 +1,6 @@ -export class UserProfile1556746559567 { - async up(queryRunner) { +import { MigrationInterface, QueryRunner } from "typeorm"; +export class UserProfile1556746559567 implements MigrationInterface { + async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "user_profile" ALTER COLUMN "githubId" TYPE VARCHAR(64) USING "githubId"::VARCHAR(64)`, ); @@ -7,7 +8,7 @@ export class UserProfile1556746559567 { `ALTER TABLE "user_profile" ALTER COLUMN "discordExpiresDate" TYPE VARCHAR(64) USING "discordExpiresDate"::VARCHAR(64)`, ); } - async down(queryRunner) { + async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `UPDATE "user_profile" SET github = FALSE, discord = FALSE`, ); diff --git a/packages/backend/src/migration/1557476068003-PinnedUsers.ts b/packages/backend/src/migration/1557476068003-PinnedUsers.ts new file mode 100644 index 000000000..fe75eacdb --- /dev/null +++ b/packages/backend/src/migration/1557476068003-PinnedUsers.ts @@ -0,0 +1,11 @@ +import { MigrationInterface, QueryRunner } from "typeorm"; +export class PinnedUsers1557476068003 implements MigrationInterface { + async up(queryRunner: QueryRunner): Promise { + await queryRunner.query( + `ALTER TABLE "meta" ADD "pinnedUsers" character varying(256) array NOT NULL DEFAULT '{}'::varchar[]`, + ); + } + async down(queryRunner: QueryRunner): Promise { + await queryRunner.query(`ALTER TABLE "meta" DROP COLUMN "pinnedUsers"`); + } +} diff --git a/packages/backend/migration/1557761316509-AddSomeUrls.js b/packages/backend/src/migration/1557761316509-AddSomeUrls.ts similarity index 72% rename from packages/backend/migration/1557761316509-AddSomeUrls.js rename to packages/backend/src/migration/1557761316509-AddSomeUrls.ts index 9839fe010..09cd9a086 100644 --- a/packages/backend/migration/1557761316509-AddSomeUrls.js +++ b/packages/backend/src/migration/1557761316509-AddSomeUrls.ts @@ -1,5 +1,6 @@ -export class AddSomeUrls1557761316509 { - async up(queryRunner) { +import { MigrationInterface, QueryRunner } from "typeorm"; +export class AddSomeUrls1557761316509 implements MigrationInterface { + async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "meta" ADD "ToSUrl" character varying(512)`, ); @@ -10,7 +11,7 @@ export class AddSomeUrls1557761316509 { `ALTER TABLE "meta" ADD "feedbackUrl" character varying(512) DEFAULT 'https://codeberg.org/firefish/firefish/issues'`, ); } - async down(queryRunner) { + async down(queryRunner: QueryRunner): Promise { 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/src/migration/1557932705754-ObjectStorageSetting.ts similarity index 88% rename from packages/backend/migration/1557932705754-ObjectStorageSetting.js rename to packages/backend/src/migration/1557932705754-ObjectStorageSetting.ts index 5fcc98fe1..7568fd3af 100644 --- a/packages/backend/migration/1557932705754-ObjectStorageSetting.js +++ b/packages/backend/src/migration/1557932705754-ObjectStorageSetting.ts @@ -1,5 +1,6 @@ -export class ObjectStorageSetting1557932705754 { - async up(queryRunner) { +import { MigrationInterface, QueryRunner } from "typeorm"; +export class ObjectStorageSetting1557932705754 implements MigrationInterface { + async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "meta" ADD "useObjectStorage" boolean NOT NULL DEFAULT false`, ); @@ -31,7 +32,7 @@ export class ObjectStorageSetting1557932705754 { `ALTER TABLE "meta" ADD "objectStorageUseSSL" boolean NOT NULL DEFAULT true`, ); } - async down(queryRunner) { + async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "meta" DROP COLUMN "objectStorageUseSSL"`, ); diff --git a/packages/backend/migration/1558072954435-PageLike.js b/packages/backend/src/migration/1558072954435-PageLike.ts similarity index 86% rename from packages/backend/migration/1558072954435-PageLike.js rename to packages/backend/src/migration/1558072954435-PageLike.ts index e919e02dd..b8b5dd3fa 100644 --- a/packages/backend/migration/1558072954435-PageLike.js +++ b/packages/backend/src/migration/1558072954435-PageLike.ts @@ -1,5 +1,6 @@ -export class PageLike1558072954435 { - async up(queryRunner) { +import { MigrationInterface, QueryRunner } from "typeorm"; +export class PageLike1558072954435 implements MigrationInterface { + async up(queryRunner: QueryRunner): Promise { 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"))`, ); @@ -19,7 +20,7 @@ export class PageLike1558072954435 { `ALTER TABLE "page_like" ADD CONSTRAINT "FK_cf8782626dced3176038176a847" FOREIGN KEY ("pageId") REFERENCES "page"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, ); } - async down(queryRunner) { + async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "page_like" DROP CONSTRAINT "FK_cf8782626dced3176038176a847"`, ); diff --git a/packages/backend/migration/1558103093633-UserGroup.js b/packages/backend/src/migration/1558103093633-UserGroup.ts similarity index 94% rename from packages/backend/migration/1558103093633-UserGroup.js rename to packages/backend/src/migration/1558103093633-UserGroup.ts index dc581a24e..c62a6c6a1 100644 --- a/packages/backend/migration/1558103093633-UserGroup.js +++ b/packages/backend/src/migration/1558103093633-UserGroup.ts @@ -1,5 +1,6 @@ -export class UserGroup1558103093633 { - async up(queryRunner) { +import { MigrationInterface, QueryRunner } from "typeorm"; +export class UserGroup1558103093633 implements MigrationInterface { + async up(queryRunner: QueryRunner): Promise { 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"))`, ); @@ -46,7 +47,7 @@ export class UserGroup1558103093633 { `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) { + async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "user_group_joining" DROP CONSTRAINT "FK_67dc758bc0566985d1b3d399865"`, ); diff --git a/packages/backend/migration/1558257926829-UserGroupInvite.js b/packages/backend/src/migration/1558257926829-UserGroupInvite.ts similarity index 88% rename from packages/backend/migration/1558257926829-UserGroupInvite.js rename to packages/backend/src/migration/1558257926829-UserGroupInvite.ts index ed137fdb2..5445e8d60 100644 --- a/packages/backend/migration/1558257926829-UserGroupInvite.js +++ b/packages/backend/src/migration/1558257926829-UserGroupInvite.ts @@ -1,5 +1,6 @@ -export class UserGroupInvite1558257926829 { - async up(queryRunner) { +import { MigrationInterface, QueryRunner } from "typeorm"; +export class UserGroupInvite1558257926829 implements MigrationInterface { + async up(queryRunner: QueryRunner): Promise { 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"))`, ); @@ -22,7 +23,7 @@ export class UserGroupInvite1558257926829 { `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) { + async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "user_group_invite" DROP CONSTRAINT "FK_e10924607d058004304611a436a"`, ); diff --git a/packages/backend/src/migration/1558266512381-UserListJoining.ts b/packages/backend/src/migration/1558266512381-UserListJoining.ts new file mode 100644 index 000000000..d4e2c3bbc --- /dev/null +++ b/packages/backend/src/migration/1558266512381-UserListJoining.ts @@ -0,0 +1,11 @@ +import { MigrationInterface, QueryRunner } from "typeorm"; +export class UserListJoining1558266512381 implements MigrationInterface { + async up(queryRunner: QueryRunner): Promise { + await queryRunner.query( + `CREATE UNIQUE INDEX "IDX_90f7da835e4c10aca6853621e1" ON "user_list_joining" ("userId", "userListId") `, + ); + } + async down(queryRunner: QueryRunner): Promise { + await queryRunner.query(`DROP INDEX "IDX_90f7da835e4c10aca6853621e1"`); + } +} diff --git a/packages/backend/migration/1561706992953-webauthn.js b/packages/backend/src/migration/1561706992953-webauthn.ts similarity index 91% rename from packages/backend/migration/1561706992953-webauthn.js rename to packages/backend/src/migration/1561706992953-webauthn.ts index f860d2c11..da4e22406 100644 --- a/packages/backend/migration/1561706992953-webauthn.js +++ b/packages/backend/src/migration/1561706992953-webauthn.ts @@ -1,5 +1,6 @@ -export class webauthn1561706992953 { - async up(queryRunner) { +import { MigrationInterface, QueryRunner } from "typeorm"; +export class webauthn1561706992953 implements MigrationInterface { + async up(queryRunner: QueryRunner): Promise { 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"))`, ); @@ -28,7 +29,7 @@ export class webauthn1561706992953 { `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) { + async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "user_security_key" DROP CONSTRAINT "FK_ff9ca3b5f3ee3d0681367a9b447"`, ); diff --git a/packages/backend/migration/1561873850023-ChartIndexes.js b/packages/backend/src/migration/1561873850023-ChartIndexes.ts similarity index 98% rename from packages/backend/migration/1561873850023-ChartIndexes.js rename to packages/backend/src/migration/1561873850023-ChartIndexes.ts index ba46da1e4..c30a79407 100644 --- a/packages/backend/migration/1561873850023-ChartIndexes.js +++ b/packages/backend/src/migration/1561873850023-ChartIndexes.ts @@ -1,5 +1,6 @@ -export class ChartIndexes1561873850023 { - async up(queryRunner) { +import { MigrationInterface, QueryRunner } from "typeorm"; +export class ChartIndexes1561873850023 implements MigrationInterface { + async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `CREATE INDEX "IDX_0ad37b7ef50f4ddc84363d7ccc" ON "__chart__active_users" ("date") `, ); @@ -271,7 +272,7 @@ export class ChartIndexes1561873850023 { `CREATE INDEX "IDX_a770a57c70e668cc61590c9161" ON "__chart__users" ("span", "date", "group") `, ); } - async down(queryRunner) { + async down(queryRunner: QueryRunner): Promise { await queryRunner.query(`DROP INDEX "IDX_a770a57c70e668cc61590c9161"`); await queryRunner.query(`DROP INDEX "IDX_337e9599f278bd7537fe30876f"`); await queryRunner.query(`DROP INDEX "IDX_f091abb24193d50c653c6b77fc"`); diff --git a/packages/backend/src/migration/1562422242907-PasswordLessLogin.ts b/packages/backend/src/migration/1562422242907-PasswordLessLogin.ts new file mode 100644 index 000000000..54f878757 --- /dev/null +++ b/packages/backend/src/migration/1562422242907-PasswordLessLogin.ts @@ -0,0 +1,13 @@ +import { MigrationInterface, QueryRunner } from "typeorm"; +export class PasswordLessLogin1562422242907 implements MigrationInterface { + async up(queryRunner: QueryRunner): Promise { + await queryRunner.query( + `ALTER TABLE "user_profile" ADD COLUMN "usePasswordLessLogin" boolean DEFAULT false NOT NULL`, + ); + } + async down(queryRunner: QueryRunner): Promise { + await queryRunner.query( + `ALTER TABLE "user_profile" DROP COLUMN "usePasswordLessLogin"`, + ); + } +} diff --git a/packages/backend/migration/1562444565093-PinnedPage.js b/packages/backend/src/migration/1562444565093-PinnedPage.ts similarity index 76% rename from packages/backend/migration/1562444565093-PinnedPage.js rename to packages/backend/src/migration/1562444565093-PinnedPage.ts index dcb342d3f..fad4d1bec 100644 --- a/packages/backend/migration/1562444565093-PinnedPage.js +++ b/packages/backend/src/migration/1562444565093-PinnedPage.ts @@ -1,5 +1,6 @@ -export class PinnedPage1562444565093 { - async up(queryRunner) { +import { MigrationInterface, QueryRunner } from "typeorm"; +export class PinnedPage1562444565093 implements MigrationInterface { + async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "user_profile" ADD "pinnedPageId" character varying(32)`, ); @@ -10,7 +11,7 @@ export class PinnedPage1562444565093 { `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) { + async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "user_profile" DROP CONSTRAINT "FK_6dc44f1ceb65b1e72bacef2ca27"`, ); diff --git a/packages/backend/src/migration/1562448332510-PageTitleHideOption.ts b/packages/backend/src/migration/1562448332510-PageTitleHideOption.ts new file mode 100644 index 000000000..63b365e5b --- /dev/null +++ b/packages/backend/src/migration/1562448332510-PageTitleHideOption.ts @@ -0,0 +1,13 @@ +import { MigrationInterface, QueryRunner } from "typeorm"; +export class PageTitleHideOption1562448332510 implements MigrationInterface { + async up(queryRunner: QueryRunner): Promise { + await queryRunner.query( + `ALTER TABLE "page" ADD "hideTitleWhenPinned" boolean NOT NULL DEFAULT false`, + ); + } + async down(queryRunner: QueryRunner): Promise { + await queryRunner.query( + `ALTER TABLE "page" DROP COLUMN "hideTitleWhenPinned"`, + ); + } +} diff --git a/packages/backend/migration/1562869971568-ModerationLog.js b/packages/backend/src/migration/1562869971568-ModerationLog.ts similarity index 78% rename from packages/backend/migration/1562869971568-ModerationLog.js rename to packages/backend/src/migration/1562869971568-ModerationLog.ts index f652b067b..f3001c821 100644 --- a/packages/backend/migration/1562869971568-ModerationLog.js +++ b/packages/backend/src/migration/1562869971568-ModerationLog.ts @@ -1,5 +1,6 @@ -export class ModerationLog1562869971568 { - async up(queryRunner) { +import { MigrationInterface, QueryRunner } from "typeorm"; +export class ModerationLog1562869971568 implements MigrationInterface { + async up(queryRunner: QueryRunner): Promise { 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"))`, ); @@ -10,7 +11,7 @@ export class ModerationLog1562869971568 { `ALTER TABLE "moderation_log" ADD CONSTRAINT "FK_a08ad074601d204e0f69da9a954" FOREIGN KEY ("userId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, ); } - async down(queryRunner) { + async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "moderation_log" DROP CONSTRAINT "FK_a08ad074601d204e0f69da9a954"`, ); diff --git a/packages/backend/migration/1563757595828-UsedUsername.js b/packages/backend/src/migration/1563757595828-UsedUsername.ts similarity index 55% rename from packages/backend/migration/1563757595828-UsedUsername.js rename to packages/backend/src/migration/1563757595828-UsedUsername.ts index 2cf5d8c74..864782cb3 100644 --- a/packages/backend/migration/1563757595828-UsedUsername.js +++ b/packages/backend/src/migration/1563757595828-UsedUsername.ts @@ -1,10 +1,11 @@ -export class UsedUsername1563757595828 { - async up(queryRunner) { +import { MigrationInterface, QueryRunner } from "typeorm"; +export class UsedUsername1563757595828 implements MigrationInterface { + async up(queryRunner: QueryRunner): Promise { 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) { + async down(queryRunner: QueryRunner): Promise { await queryRunner.query(`DROP TABLE "used_username"`); } } diff --git a/packages/backend/src/migration/1565634203341-room.ts b/packages/backend/src/migration/1565634203341-room.ts new file mode 100644 index 000000000..f2e2ee890 --- /dev/null +++ b/packages/backend/src/migration/1565634203341-room.ts @@ -0,0 +1,11 @@ +import { MigrationInterface, QueryRunner } from "typeorm"; +export class room1565634203341 implements MigrationInterface { + async up(queryRunner: QueryRunner): Promise { + await queryRunner.query( + `ALTER TABLE "user_profile" ADD "room" jsonb NOT NULL DEFAULT '{}'`, + ); + } + async down(queryRunner: QueryRunner): Promise { + await queryRunner.query(`ALTER TABLE "user_profile" DROP COLUMN "room"`); + } +} diff --git a/packages/backend/src/migration/1571220798684-CustomEmojiCategory.ts b/packages/backend/src/migration/1571220798684-CustomEmojiCategory.ts new file mode 100644 index 000000000..6ff44c934 --- /dev/null +++ b/packages/backend/src/migration/1571220798684-CustomEmojiCategory.ts @@ -0,0 +1,15 @@ +import { MigrationInterface, QueryRunner } from "typeorm"; +export class CustomEmojiCategory1571220798684 implements MigrationInterface { + async up(queryRunner: QueryRunner): Promise { + await queryRunner.query( + `ALTER TABLE "emoji" ADD "category" character varying(128)`, + undefined, + ); + } + async down(queryRunner: QueryRunner): Promise { + await queryRunner.query( + `ALTER TABLE "emoji" DROP COLUMN "category"`, + undefined, + ); + } +} diff --git a/packages/backend/migration/1572760203493-nodeinfo.js b/packages/backend/src/migration/1572760203493-nodeinfo.ts similarity index 89% rename from packages/backend/migration/1572760203493-nodeinfo.js rename to packages/backend/src/migration/1572760203493-nodeinfo.ts index eea87c82c..e85b41409 100644 --- a/packages/backend/migration/1572760203493-nodeinfo.js +++ b/packages/backend/src/migration/1572760203493-nodeinfo.ts @@ -1,5 +1,6 @@ -export class nodeinfo1572760203493 { - async up(queryRunner) { +import { MigrationInterface, QueryRunner } from "typeorm"; +export class nodeinfo1572760203493 implements MigrationInterface { + async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "instance" DROP COLUMN "system"`, undefined, @@ -37,7 +38,7 @@ export class nodeinfo1572760203493 { undefined, ); } - async down(queryRunner) { + async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "instance" DROP COLUMN "infoUpdatedAt"`, undefined, diff --git a/packages/backend/migration/1576269851876-TalkFederationId.js b/packages/backend/src/migration/1576269851876-TalkFederationId.ts similarity index 54% rename from packages/backend/migration/1576269851876-TalkFederationId.js rename to packages/backend/src/migration/1576269851876-TalkFederationId.ts index f0aed7dd8..068708b2f 100644 --- a/packages/backend/migration/1576269851876-TalkFederationId.js +++ b/packages/backend/src/migration/1576269851876-TalkFederationId.ts @@ -1,14 +1,15 @@ -export class TalkFederationId1576269851876 { +import { MigrationInterface, QueryRunner } from "typeorm"; +export class TalkFederationId1576269851876 implements MigrationInterface { constructor() { this.name = "TalkFederationId1576269851876"; } - async up(queryRunner) { + async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "messaging_message" ADD "uri" character varying(512)`, undefined, ); } - async down(queryRunner) { + async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "messaging_message" DROP COLUMN "uri"`, undefined, diff --git a/packages/backend/migration/1576869585998-ProxyRemoteFiles.js b/packages/backend/src/migration/1576869585998-ProxyRemoteFiles.ts similarity index 55% rename from packages/backend/migration/1576869585998-ProxyRemoteFiles.js rename to packages/backend/src/migration/1576869585998-ProxyRemoteFiles.ts index 5565f64b6..8ac7c9a3c 100644 --- a/packages/backend/migration/1576869585998-ProxyRemoteFiles.js +++ b/packages/backend/src/migration/1576869585998-ProxyRemoteFiles.ts @@ -1,14 +1,15 @@ -export class ProxyRemoteFiles1576869585998 { +import { MigrationInterface, QueryRunner } from "typeorm"; +export class ProxyRemoteFiles1576869585998 implements MigrationInterface { constructor() { this.name = "ProxyRemoteFiles1576869585998"; } - async up(queryRunner) { + async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "meta" ADD "proxyRemoteFiles" boolean NOT NULL DEFAULT false`, undefined, ); } - async down(queryRunner) { + async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "meta" DROP COLUMN "proxyRemoteFiles"`, undefined, diff --git a/packages/backend/migration/1579267006611-v12.js b/packages/backend/src/migration/1579267006611-v12.ts similarity index 93% rename from packages/backend/migration/1579267006611-v12.js rename to packages/backend/src/migration/1579267006611-v12.ts index f1d906465..0ef6e1161 100644 --- a/packages/backend/migration/1579267006611-v12.js +++ b/packages/backend/src/migration/1579267006611-v12.ts @@ -1,8 +1,9 @@ -export class v121579267006611 { +import { MigrationInterface, QueryRunner } from "typeorm"; +export class v121579267006611 implements MigrationInterface { constructor() { this.name = "v121579267006611"; } - async up(queryRunner) { + async up(queryRunner: QueryRunner): Promise { 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, @@ -48,7 +49,7 @@ export class v121579267006611 { undefined, ); } - async down(queryRunner) { + async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "announcement_read" DROP CONSTRAINT "FK_603a7b1e7aa0533c6c88e9bfafe"`, undefined, diff --git a/packages/backend/migration/1579270193251-v12-2.js b/packages/backend/src/migration/1579270193251-v12-2.ts similarity index 57% rename from packages/backend/migration/1579270193251-v12-2.js rename to packages/backend/src/migration/1579270193251-v12-2.ts index 6bbcdcc15..e964f44a2 100644 --- a/packages/backend/migration/1579270193251-v12-2.js +++ b/packages/backend/src/migration/1579270193251-v12-2.ts @@ -1,14 +1,15 @@ -export class v1221579270193251 { +import { MigrationInterface, QueryRunner } from "typeorm"; +export class v1221579270193251 implements MigrationInterface { constructor() { this.name = "v1221579270193251"; } - async up(queryRunner) { + async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "announcement_read" ADD "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL`, undefined, ); } - async down(queryRunner) { + async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "announcement_read" DROP COLUMN "createdAt"`, undefined, diff --git a/packages/backend/migration/1579282808087-v12-3.js b/packages/backend/src/migration/1579282808087-v12-3.ts similarity index 55% rename from packages/backend/migration/1579282808087-v12-3.js rename to packages/backend/src/migration/1579282808087-v12-3.ts index d5a9a86b5..a12fea2bf 100644 --- a/packages/backend/migration/1579282808087-v12-3.js +++ b/packages/backend/src/migration/1579282808087-v12-3.ts @@ -1,14 +1,15 @@ -export class v1231579282808087 { +import { MigrationInterface, QueryRunner } from "typeorm"; +export class v1231579282808087 implements MigrationInterface { constructor() { this.name = "v1231579282808087"; } - async up(queryRunner) { + async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "announcement" ADD "updatedAt" TIMESTAMP WITH TIME ZONE`, undefined, ); } - async down(queryRunner) { + async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "announcement" DROP COLUMN "updatedAt"`, undefined, diff --git a/packages/backend/migration/1579544426412-v12-4.js b/packages/backend/src/migration/1579544426412-v12-4.ts similarity index 73% rename from packages/backend/migration/1579544426412-v12-4.js rename to packages/backend/src/migration/1579544426412-v12-4.ts index efd6ee61b..9d40fed41 100644 --- a/packages/backend/migration/1579544426412-v12-4.js +++ b/packages/backend/src/migration/1579544426412-v12-4.ts @@ -1,8 +1,9 @@ -export class v1241579544426412 { +import { MigrationInterface, QueryRunner } from "typeorm"; +export class v1241579544426412 implements MigrationInterface { constructor() { this.name = "v1241579544426412"; } - async up(queryRunner) { + async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "notification" ADD "followRequestId" character varying(32)`, undefined, @@ -12,7 +13,7 @@ export class v1241579544426412 { undefined, ); } - async down(queryRunner) { + async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "notification" DROP CONSTRAINT "FK_bd7fab507621e635b32cd31892c"`, undefined, diff --git a/packages/backend/migration/1579977526288-v12-5.js b/packages/backend/src/migration/1579977526288-v12-5.ts similarity index 96% rename from packages/backend/migration/1579977526288-v12-5.js rename to packages/backend/src/migration/1579977526288-v12-5.ts index f71c28755..f71bfb03b 100644 --- a/packages/backend/migration/1579977526288-v12-5.js +++ b/packages/backend/src/migration/1579977526288-v12-5.ts @@ -1,8 +1,9 @@ -export class v1251579977526288 { +import { MigrationInterface, QueryRunner } from "typeorm"; +export class v1251579977526288 implements MigrationInterface { constructor() { this.name = "v1251579977526288"; } - async up(queryRunner) { + async up(queryRunner: QueryRunner): Promise { 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, @@ -85,7 +86,7 @@ export class v1251579977526288 { undefined, ); } - async down(queryRunner) { + async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "antenna_note" DROP CONSTRAINT "FK_0d775946662d2575dfd2068a5f5"`, undefined, diff --git a/packages/backend/migration/1579993013959-v12-6.js b/packages/backend/src/migration/1579993013959-v12-6.ts similarity index 75% rename from packages/backend/migration/1579993013959-v12-6.js rename to packages/backend/src/migration/1579993013959-v12-6.ts index fc954c361..f10eddc3b 100644 --- a/packages/backend/migration/1579993013959-v12-6.js +++ b/packages/backend/src/migration/1579993013959-v12-6.ts @@ -1,8 +1,9 @@ -export class v1261579993013959 { +import { MigrationInterface, QueryRunner } from "typeorm"; +export class v1261579993013959 implements MigrationInterface { constructor() { this.name = "v1261579993013959"; } - async up(queryRunner) { + async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "antenna" DROP COLUMN "hasNewNote"`, undefined, @@ -16,7 +17,7 @@ export class v1261579993013959 { undefined, ); } - async down(queryRunner) { + async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `DROP INDEX "IDX_9937ea48d7ae97ffb4f3f063a4"`, undefined, diff --git a/packages/backend/migration/1580069531114-v12-7.js b/packages/backend/src/migration/1580069531114-v12-7.ts similarity index 86% rename from packages/backend/migration/1580069531114-v12-7.js rename to packages/backend/src/migration/1580069531114-v12-7.ts index c4214ddf1..79dcdd6bd 100644 --- a/packages/backend/migration/1580069531114-v12-7.js +++ b/packages/backend/src/migration/1580069531114-v12-7.ts @@ -1,8 +1,9 @@ -export class v1271580069531114 { +import { MigrationInterface, QueryRunner } from "typeorm"; +export class v1271580069531114 implements MigrationInterface { constructor() { this.name = "v1271580069531114"; } - async up(queryRunner) { + async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "antenna" ADD "users" character varying(1024) array NOT NULL DEFAULT '{}'::varchar[]`, undefined, @@ -25,7 +26,7 @@ export class v1271580069531114 { ); await queryRunner.query(`DROP TYPE "antenna_src_enum_old"`, undefined); } - async down(queryRunner) { + async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `CREATE TYPE "antenna_src_enum_old" AS ENUM('home', 'all', 'list')`, undefined, diff --git a/packages/backend/migration/1580148575182-v12-8.js b/packages/backend/src/migration/1580148575182-v12-8.ts similarity index 71% rename from packages/backend/migration/1580148575182-v12-8.js rename to packages/backend/src/migration/1580148575182-v12-8.ts index 11b792b7e..f92dc9ba3 100644 --- a/packages/backend/migration/1580148575182-v12-8.js +++ b/packages/backend/src/migration/1580148575182-v12-8.ts @@ -1,8 +1,9 @@ -export class v1281580148575182 { +import { MigrationInterface, QueryRunner } from "typeorm"; +export class v1281580148575182 implements MigrationInterface { constructor() { this.name = "v1281580148575182"; } - async up(queryRunner) { + async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "note" DROP CONSTRAINT "FK_ec5c201576192ba8904c345c5cc"`, undefined, @@ -12,7 +13,7 @@ export class v1281580148575182 { undefined, ); } - async down(queryRunner) { + async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "note" ADD "appId" character varying(32)`, undefined, diff --git a/packages/backend/migration/1580154400017-v12-9.js b/packages/backend/src/migration/1580154400017-v12-9.ts similarity index 55% rename from packages/backend/migration/1580154400017-v12-9.js rename to packages/backend/src/migration/1580154400017-v12-9.ts index 19f8be095..2bc0bc186 100644 --- a/packages/backend/migration/1580154400017-v12-9.js +++ b/packages/backend/src/migration/1580154400017-v12-9.ts @@ -1,14 +1,15 @@ -export class v1291580154400017 { +import { MigrationInterface, QueryRunner } from "typeorm"; +export class v1291580154400017 implements MigrationInterface { constructor() { this.name = "v1291580154400017"; } - async up(queryRunner) { + async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "antenna" ADD "withReplies" boolean NOT NULL DEFAULT false`, undefined, ); } - async down(queryRunner) { + async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "antenna" DROP COLUMN "withReplies"`, undefined, diff --git a/packages/backend/migration/1580276619901-v12-10.js b/packages/backend/src/migration/1580276619901-v12-10.ts similarity index 79% rename from packages/backend/migration/1580276619901-v12-10.js rename to packages/backend/src/migration/1580276619901-v12-10.ts index e5dd1db5e..ab25a52b7 100644 --- a/packages/backend/migration/1580276619901-v12-10.js +++ b/packages/backend/src/migration/1580276619901-v12-10.ts @@ -1,8 +1,9 @@ -export class v12101580276619901 { +import { MigrationInterface, QueryRunner } from "typeorm"; +export class v12101580276619901 implements MigrationInterface { constructor() { this.name = "v12101580276619901"; } - async up(queryRunner) { + async up(queryRunner: QueryRunner): Promise { await queryRunner.query(`TRUNCATE TABLE "notification"`, undefined); await queryRunner.query( `ALTER TABLE "notification" DROP COLUMN "type"`, @@ -17,7 +18,7 @@ export class v12101580276619901 { undefined, ); } - async down(queryRunner) { + async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "notification" DROP COLUMN "type"`, undefined, diff --git a/packages/backend/migration/1580331224276-v12-11.js b/packages/backend/src/migration/1580331224276-v12-11.ts similarity index 76% rename from packages/backend/migration/1580331224276-v12-11.js rename to packages/backend/src/migration/1580331224276-v12-11.ts index c31dca175..7f2eddf1c 100644 --- a/packages/backend/migration/1580331224276-v12-11.js +++ b/packages/backend/src/migration/1580331224276-v12-11.ts @@ -1,8 +1,9 @@ -export class v12111580331224276 { +import { MigrationInterface, QueryRunner } from "typeorm"; +export class v12111580331224276 implements MigrationInterface { constructor() { this.name = "v12111580331224276"; } - async up(queryRunner) { + async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "instance" DROP COLUMN "isMarkedAsClosed"`, undefined, @@ -16,7 +17,7 @@ export class v12111580331224276 { undefined, ); } - async down(queryRunner) { + async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `DROP INDEX "IDX_34500da2e38ac393f7bb6b299c"`, undefined, diff --git a/packages/backend/migration/1580508795118-v12-12.js b/packages/backend/src/migration/1580508795118-v12-12.ts similarity index 94% rename from packages/backend/migration/1580508795118-v12-12.js rename to packages/backend/src/migration/1580508795118-v12-12.ts index 6df1b8f8a..066042074 100644 --- a/packages/backend/migration/1580508795118-v12-12.js +++ b/packages/backend/src/migration/1580508795118-v12-12.ts @@ -1,8 +1,9 @@ -export class v12121580508795118 { +import { MigrationInterface, QueryRunner } from "typeorm"; +export class v12121580508795118 implements MigrationInterface { constructor() { this.name = "v12121580508795118"; } - async up(queryRunner) { + async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "user_profile" DROP COLUMN "twitter"`, undefined, @@ -72,7 +73,7 @@ export class v12121580508795118 { undefined, ); } - async down(queryRunner) { + async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "user_profile" DROP COLUMN "integrations"`, undefined, diff --git a/packages/backend/migration/1580543501339-v12-13.js b/packages/backend/src/migration/1580543501339-v12-13.ts similarity index 51% rename from packages/backend/migration/1580543501339-v12-13.js rename to packages/backend/src/migration/1580543501339-v12-13.ts index fd4d13151..0c8b59d6d 100644 --- a/packages/backend/migration/1580543501339-v12-13.js +++ b/packages/backend/src/migration/1580543501339-v12-13.ts @@ -1,14 +1,15 @@ -export class v12131580543501339 { +import { MigrationInterface, QueryRunner } from "typeorm"; +export class v12131580543501339 implements MigrationInterface { constructor() { this.name = "v12131580543501339"; } - async up(queryRunner) { + async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `CREATE INDEX "IDX_NOTE_TAGS" ON "note" USING gin ("tags")`, undefined, ); } - async down(queryRunner) { + async down(queryRunner: QueryRunner): Promise { await queryRunner.query(`DROP INDEX "IDX_NOTE_TAGS"`, undefined); } } diff --git a/packages/backend/migration/1580864313253-v12-14.js b/packages/backend/src/migration/1580864313253-v12-14.ts similarity index 82% rename from packages/backend/migration/1580864313253-v12-14.js rename to packages/backend/src/migration/1580864313253-v12-14.ts index 47f778e1d..a0032aaba 100644 --- a/packages/backend/migration/1580864313253-v12-14.js +++ b/packages/backend/src/migration/1580864313253-v12-14.ts @@ -1,8 +1,9 @@ -export class v12141580864313253 { +import { MigrationInterface, QueryRunner } from "typeorm"; +export class v12141580864313253 implements MigrationInterface { constructor() { this.name = "v12141580864313253"; } - async up(queryRunner) { + async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "meta" RENAME COLUMN "proxyAccount" TO "proxyAccountId"`, undefined, @@ -20,7 +21,7 @@ export class v12141580864313253 { undefined, ); } - async down(queryRunner) { + async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "meta" DROP CONSTRAINT "FK_ab1bc0c1e209daa77b8e8d212ad"`, undefined, diff --git a/packages/backend/migration/1581526429287-user-group-invitation.js b/packages/backend/src/migration/1581526429287-user-group-invitation.ts similarity index 94% rename from packages/backend/migration/1581526429287-user-group-invitation.js rename to packages/backend/src/migration/1581526429287-user-group-invitation.ts index e327816ea..b8d8f2ca2 100644 --- a/packages/backend/migration/1581526429287-user-group-invitation.js +++ b/packages/backend/src/migration/1581526429287-user-group-invitation.ts @@ -1,8 +1,9 @@ -export class userGroupInvitation1581526429287 { +import { MigrationInterface, QueryRunner } from "typeorm"; +export class userGroupInvitation1581526429287 implements MigrationInterface { constructor() { this.name = "userGroupInvitation1581526429287"; } - async up(queryRunner) { + async up(queryRunner: QueryRunner): Promise { 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, @@ -56,7 +57,7 @@ export class userGroupInvitation1581526429287 { undefined, ); } - async down(queryRunner) { + async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "notification" DROP CONSTRAINT "FK_8fe87814e978053a53b1beb7e98"`, undefined, diff --git a/packages/backend/migration/1581695816408-user-group-antenna.js b/packages/backend/src/migration/1581695816408-user-group-antenna.ts similarity index 89% rename from packages/backend/migration/1581695816408-user-group-antenna.js rename to packages/backend/src/migration/1581695816408-user-group-antenna.ts index 28112767e..e6934a087 100644 --- a/packages/backend/migration/1581695816408-user-group-antenna.js +++ b/packages/backend/src/migration/1581695816408-user-group-antenna.ts @@ -1,8 +1,9 @@ -export class userGroupAntenna1581695816408 { +import { MigrationInterface, QueryRunner } from "typeorm"; +export class userGroupAntenna1581695816408 implements MigrationInterface { constructor() { this.name = "userGroupAntenna1581695816408"; } - async up(queryRunner) { + async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "antenna" ADD "userGroupJoiningId" character varying(32)`, undefined, @@ -33,7 +34,7 @@ export class userGroupAntenna1581695816408 { undefined, ); } - async down(queryRunner) { + async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "antenna" DROP CONSTRAINT "FK_ccbf5a8c0be4511133dcc50ddeb"`, undefined, diff --git a/packages/backend/migration/1581708415836-drive-user-folder-id-index.js b/packages/backend/src/migration/1581708415836-drive-user-folder-id-index.ts similarity index 56% rename from packages/backend/migration/1581708415836-drive-user-folder-id-index.js rename to packages/backend/src/migration/1581708415836-drive-user-folder-id-index.ts index 41902dc53..8bb1888c8 100644 --- a/packages/backend/migration/1581708415836-drive-user-folder-id-index.js +++ b/packages/backend/src/migration/1581708415836-drive-user-folder-id-index.ts @@ -1,14 +1,15 @@ -export class driveUserFolderIdIndex1581708415836 { +import { MigrationInterface, QueryRunner } from "typeorm"; +export class driveUserFolderIdIndex1581708415836 implements MigrationInterface { constructor() { this.name = "driveUserFolderIdIndex1581708415836"; } - async up(queryRunner) { + async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `CREATE INDEX "IDX_55720b33a61a7c806a8215b825" ON "drive_file" ("userId", "folderId", "id") `, undefined, ); } - async down(queryRunner) { + async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `DROP INDEX "IDX_55720b33a61a7c806a8215b825"`, undefined, diff --git a/packages/backend/migration/1581979837262-promo.js b/packages/backend/src/migration/1581979837262-promo.ts similarity index 91% rename from packages/backend/migration/1581979837262-promo.js rename to packages/backend/src/migration/1581979837262-promo.ts index 39e79965b..c20f828f8 100644 --- a/packages/backend/migration/1581979837262-promo.js +++ b/packages/backend/src/migration/1581979837262-promo.ts @@ -1,8 +1,9 @@ -export class promo1581979837262 { +import { MigrationInterface, QueryRunner } from "typeorm"; +export class promo1581979837262 implements MigrationInterface { constructor() { this.name = "promo1581979837262"; } - async up(queryRunner) { + async up(queryRunner: QueryRunner): Promise { 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, @@ -36,7 +37,7 @@ export class promo1581979837262 { undefined, ); } - async down(queryRunner) { + async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "promo_read" DROP CONSTRAINT "FK_a46a1a603ecee695d7db26da5f4"`, undefined, diff --git a/packages/backend/migration/1582019042083-featured-injecttion.js b/packages/backend/src/migration/1582019042083-featured-injecttion.ts similarity index 56% rename from packages/backend/migration/1582019042083-featured-injecttion.js rename to packages/backend/src/migration/1582019042083-featured-injecttion.ts index 61b7d0c27..0fd69d230 100644 --- a/packages/backend/migration/1582019042083-featured-injecttion.js +++ b/packages/backend/src/migration/1582019042083-featured-injecttion.ts @@ -1,14 +1,15 @@ -export class featuredInjecttion1582019042083 { +import { MigrationInterface, QueryRunner } from "typeorm"; +export class featuredInjecttion1582019042083 implements MigrationInterface { constructor() { this.name = "featuredInjecttion1582019042083"; } - async up(queryRunner) { + async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "user_profile" ADD "injectFeaturedNote" boolean NOT NULL DEFAULT true`, undefined, ); } - async down(queryRunner) { + async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "user_profile" DROP COLUMN "injectFeaturedNote"`, undefined, diff --git a/packages/backend/migration/1582210532752-antenna-exclude.js b/packages/backend/src/migration/1582210532752-antenna-exclude.ts similarity index 55% rename from packages/backend/migration/1582210532752-antenna-exclude.js rename to packages/backend/src/migration/1582210532752-antenna-exclude.ts index 5a394270e..ec647d70e 100644 --- a/packages/backend/migration/1582210532752-antenna-exclude.js +++ b/packages/backend/src/migration/1582210532752-antenna-exclude.ts @@ -1,14 +1,15 @@ -export class antennaExclude1582210532752 { +import { MigrationInterface, QueryRunner } from "typeorm"; +export class antennaExclude1582210532752 implements MigrationInterface { constructor() { this.name = "antennaExclude1582210532752"; } - async up(queryRunner) { + async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "antenna" ADD "excludeKeywords" jsonb NOT NULL DEFAULT '[]'`, undefined, ); } - async down(queryRunner) { + async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "antenna" DROP COLUMN "excludeKeywords"`, undefined, diff --git a/packages/backend/migration/1582875306439-note-reaction-length.js b/packages/backend/src/migration/1582875306439-note-reaction-length.ts similarity index 58% rename from packages/backend/migration/1582875306439-note-reaction-length.js rename to packages/backend/src/migration/1582875306439-note-reaction-length.ts index 2c9b72673..22c245228 100644 --- a/packages/backend/migration/1582875306439-note-reaction-length.js +++ b/packages/backend/src/migration/1582875306439-note-reaction-length.ts @@ -1,14 +1,15 @@ -export class noteReactionLength1582875306439 { +import { MigrationInterface, QueryRunner } from "typeorm"; +export class noteReactionLength1582875306439 implements MigrationInterface { constructor() { this.name = "noteReactionLength1582875306439"; } - async up(queryRunner) { + async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "note_reaction" ALTER COLUMN "reaction" TYPE character varying(130)`, undefined, ); } - async down(queryRunner) { + async down(queryRunner: QueryRunner): Promise { 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/src/migration/1585361548360-miauth.ts similarity index 92% rename from packages/backend/migration/1585361548360-miauth.js rename to packages/backend/src/migration/1585361548360-miauth.ts index 2e052cb89..266f86d60 100644 --- a/packages/backend/migration/1585361548360-miauth.js +++ b/packages/backend/src/migration/1585361548360-miauth.ts @@ -1,8 +1,9 @@ -export class miauth1585361548360 { +import { MigrationInterface, QueryRunner } from "typeorm"; +export class miauth1585361548360 implements MigrationInterface { constructor() { this.name = "miauth1585361548360"; } - async up(queryRunner) { + async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "access_token" ADD "lastUsedAt" TIMESTAMP WITH TIME ZONE DEFAULT null`, undefined, @@ -52,7 +53,7 @@ export class miauth1585361548360 { undefined, ); } - async down(queryRunner) { + async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "access_token" DROP CONSTRAINT "FK_a3ff16c90cc87a82a0b5959e560"`, undefined, diff --git a/packages/backend/migration/1585385921215-custom-notification.js b/packages/backend/src/migration/1585385921215-custom-notification.ts similarity index 95% rename from packages/backend/migration/1585385921215-custom-notification.js rename to packages/backend/src/migration/1585385921215-custom-notification.ts index 23142cd3a..e7abcc743 100644 --- a/packages/backend/migration/1585385921215-custom-notification.js +++ b/packages/backend/src/migration/1585385921215-custom-notification.ts @@ -1,8 +1,9 @@ -export class customNotification1585385921215 { +import { MigrationInterface, QueryRunner } from "typeorm"; +export class customNotification1585385921215 implements MigrationInterface { constructor() { this.name = "customNotification1585385921215"; } - async up(queryRunner) { + async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "notification" ADD "customBody" character varying(2048)`, undefined, @@ -76,7 +77,7 @@ export class customNotification1585385921215 { undefined, ); } - async down(queryRunner) { + async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "notification" DROP CONSTRAINT "FK_e22bf6bda77b6adc1fd9e75c8c9"`, undefined, diff --git a/packages/backend/migration/1585772678853-ap-url.js b/packages/backend/src/migration/1585772678853-ap-url.ts similarity index 51% rename from packages/backend/migration/1585772678853-ap-url.js rename to packages/backend/src/migration/1585772678853-ap-url.ts index 18cc4588e..a06a8f52a 100644 --- a/packages/backend/migration/1585772678853-ap-url.js +++ b/packages/backend/src/migration/1585772678853-ap-url.ts @@ -1,14 +1,15 @@ -export class apUrl1585772678853 { +import { MigrationInterface, QueryRunner } from "typeorm"; +export class apUrl1585772678853 implements MigrationInterface { constructor() { this.name = "apUrl1585772678853"; } - async up(queryRunner) { + async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "note" ADD "url" character varying(512)`, undefined, ); } - async down(queryRunner) { + async down(queryRunner: QueryRunner): Promise { await queryRunner.query(`ALTER TABLE "note" DROP COLUMN "url"`, undefined); } } diff --git a/packages/backend/migration/1586624197029-AddObjectStorageUseProxy.js b/packages/backend/src/migration/1586624197029-AddObjectStorageUseProxy.ts similarity index 56% rename from packages/backend/migration/1586624197029-AddObjectStorageUseProxy.js rename to packages/backend/src/migration/1586624197029-AddObjectStorageUseProxy.ts index 89694f84b..aa1a090b6 100644 --- a/packages/backend/migration/1586624197029-AddObjectStorageUseProxy.js +++ b/packages/backend/src/migration/1586624197029-AddObjectStorageUseProxy.ts @@ -1,14 +1,15 @@ -export class AddObjectStorageUseProxy1586624197029 { +import { MigrationInterface, QueryRunner } from "typeorm"; +export class AddObjectStorageUseProxy1586624197029 implements MigrationInterface { constructor() { this.name = "AddObjectStorageUseProxy1586624197029"; } - async up(queryRunner) { + async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "meta" ADD "objectStorageUseProxy" boolean NOT NULL DEFAULT true`, undefined, ); } - async down(queryRunner) { + async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "meta" DROP COLUMN "objectStorageUseProxy"`, undefined, diff --git a/packages/backend/migration/1586641139527-remote-reaction.js b/packages/backend/src/migration/1586641139527-remote-reaction.ts similarity index 58% rename from packages/backend/migration/1586641139527-remote-reaction.js rename to packages/backend/src/migration/1586641139527-remote-reaction.ts index d7390544c..7e8e8cc63 100644 --- a/packages/backend/migration/1586641139527-remote-reaction.js +++ b/packages/backend/src/migration/1586641139527-remote-reaction.ts @@ -1,14 +1,15 @@ -export class remoteReaction1586641139527 { +import { MigrationInterface, QueryRunner } from "typeorm"; +export class remoteReaction1586641139527 implements MigrationInterface { constructor() { this.name = "remoteReaction1586641139527"; } - async up(queryRunner) { + async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "note_reaction" ALTER COLUMN "reaction" TYPE character varying(260)`, undefined, ); } - async down(queryRunner) { + async down(queryRunner: QueryRunner): Promise { 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/src/migration/1586708940386-pageAiScript.ts similarity index 55% rename from packages/backend/migration/1586708940386-pageAiScript.js rename to packages/backend/src/migration/1586708940386-pageAiScript.ts index 25eb71098..5ea3a0393 100644 --- a/packages/backend/migration/1586708940386-pageAiScript.js +++ b/packages/backend/src/migration/1586708940386-pageAiScript.ts @@ -1,14 +1,15 @@ -export class pageAiScript1586708940386 { +import { MigrationInterface, QueryRunner } from "typeorm"; +export class pageAiScript1586708940386 implements MigrationInterface { constructor() { this.name = "pageAiScript1586708940386"; } - async up(queryRunner) { + async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "page" ADD "script" character varying(16384) NOT NULL DEFAULT ''`, undefined, ); } - async down(queryRunner) { + async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "page" DROP COLUMN "script"`, undefined, diff --git a/packages/backend/migration/1588044505511-hCaptcha.js b/packages/backend/src/migration/1588044505511-hCaptcha.ts similarity index 75% rename from packages/backend/migration/1588044505511-hCaptcha.js rename to packages/backend/src/migration/1588044505511-hCaptcha.ts index 29ba87370..110ddd47e 100644 --- a/packages/backend/migration/1588044505511-hCaptcha.js +++ b/packages/backend/src/migration/1588044505511-hCaptcha.ts @@ -1,8 +1,9 @@ -export class hCaptcha1588044505511 { +import { MigrationInterface, QueryRunner } from "typeorm"; +export class hCaptcha1588044505511 implements MigrationInterface { constructor() { this.name = "hCaptcha1588044505511"; } - async up(queryRunner) { + async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "meta" ADD "enableHcaptcha" boolean NOT NULL DEFAULT false`, undefined, @@ -16,7 +17,7 @@ export class hCaptcha1588044505511 { undefined, ); } - async down(queryRunner) { + async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "meta" DROP COLUMN "hcaptchaSecretKey"`, undefined, diff --git a/packages/backend/migration/1589023282116-pubRelay.js b/packages/backend/src/migration/1589023282116-pubRelay.ts similarity index 77% rename from packages/backend/migration/1589023282116-pubRelay.js rename to packages/backend/src/migration/1589023282116-pubRelay.ts index a1a229919..6c1b37f66 100644 --- a/packages/backend/migration/1589023282116-pubRelay.js +++ b/packages/backend/src/migration/1589023282116-pubRelay.ts @@ -1,8 +1,9 @@ -export class pubRelay1589023282116 { +import { MigrationInterface, QueryRunner } from "typeorm"; +export class pubRelay1589023282116 implements MigrationInterface { constructor() { this.name = "pubRelay1589023282116"; } - async up(queryRunner) { + async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `CREATE TYPE "relay_status_enum" AS ENUM('requesting', 'accepted', 'rejected')`, undefined, @@ -16,7 +17,7 @@ export class pubRelay1589023282116 { undefined, ); } - async down(queryRunner) { + async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `DROP INDEX "IDX_0d9a1738f2cf7f3b1c3334dfab"`, undefined, diff --git a/packages/backend/migration/1595075960584-blurhash.js b/packages/backend/src/migration/1595075960584-blurhash.ts similarity index 51% rename from packages/backend/migration/1595075960584-blurhash.js rename to packages/backend/src/migration/1595075960584-blurhash.ts index 50660cd05..9b844e1db 100644 --- a/packages/backend/migration/1595075960584-blurhash.js +++ b/packages/backend/src/migration/1595075960584-blurhash.ts @@ -1,13 +1,14 @@ -export class blurhash1595075960584 { +import { MigrationInterface, QueryRunner } from "typeorm"; +export class blurhash1595075960584 implements MigrationInterface { constructor() { this.name = "blurhash1595075960584"; } - async up(queryRunner) { + async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "drive_file" ADD "blurhash" character varying(128)`, ); } - async down(queryRunner) { + async down(queryRunner: QueryRunner): Promise { 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/src/migration/1595077605646-blurhash-for-avatar-banner.ts similarity index 75% rename from packages/backend/migration/1595077605646-blurhash-for-avatar-banner.js rename to packages/backend/src/migration/1595077605646-blurhash-for-avatar-banner.ts index 612ab648c..d67134f7a 100644 --- a/packages/backend/migration/1595077605646-blurhash-for-avatar-banner.js +++ b/packages/backend/src/migration/1595077605646-blurhash-for-avatar-banner.ts @@ -1,8 +1,9 @@ -export class blurhashForAvatarBanner1595077605646 { +import { MigrationInterface, QueryRunner } from "typeorm"; +export class blurhashForAvatarBanner1595077605646 implements MigrationInterface { constructor() { this.name = "blurhashForAvatarBanner1595077605646"; } - async up(queryRunner) { + async up(queryRunner: QueryRunner): Promise { await queryRunner.query(`ALTER TABLE "user" DROP COLUMN "avatarColor"`); await queryRunner.query(`ALTER TABLE "user" DROP COLUMN "bannerColor"`); await queryRunner.query( @@ -12,7 +13,7 @@ export class blurhashForAvatarBanner1595077605646 { `ALTER TABLE "user" ADD "bannerBlurhash" character varying(128)`, ); } - async down(queryRunner) { + async down(queryRunner: QueryRunner): Promise { await queryRunner.query(`ALTER TABLE "user" DROP COLUMN "bannerBlurhash"`); await queryRunner.query(`ALTER TABLE "user" DROP COLUMN "avatarBlurhash"`); await queryRunner.query( diff --git a/packages/backend/migration/1595676934834-instance-icon-url.js b/packages/backend/src/migration/1595676934834-instance-icon-url.ts similarity index 51% rename from packages/backend/migration/1595676934834-instance-icon-url.js rename to packages/backend/src/migration/1595676934834-instance-icon-url.ts index c228b14b6..7d147cf1e 100644 --- a/packages/backend/migration/1595676934834-instance-icon-url.js +++ b/packages/backend/src/migration/1595676934834-instance-icon-url.ts @@ -1,13 +1,14 @@ -export class instanceIconUrl1595676934834 { +import { MigrationInterface, QueryRunner } from "typeorm"; +export class instanceIconUrl1595676934834 implements MigrationInterface { constructor() { this.name = "instanceIconUrl1595676934834"; } - async up(queryRunner) { + async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "instance" ADD "iconUrl" character varying(256) DEFAULT null`, ); } - async down(queryRunner) { + async down(queryRunner: QueryRunner): Promise { await queryRunner.query(`ALTER TABLE "instance" DROP COLUMN "iconUrl"`); } } diff --git a/packages/backend/migration/1595771249699-word-mute.js b/packages/backend/src/migration/1595771249699-word-mute.ts similarity index 90% rename from packages/backend/migration/1595771249699-word-mute.js rename to packages/backend/src/migration/1595771249699-word-mute.ts index 0a8a63294..7255c4524 100644 --- a/packages/backend/migration/1595771249699-word-mute.js +++ b/packages/backend/src/migration/1595771249699-word-mute.ts @@ -1,8 +1,9 @@ -export class wordMute1595771249699 { +import { MigrationInterface, QueryRunner } from "typeorm"; +export class wordMute1595771249699 implements MigrationInterface { constructor() { this.name = "wordMute1595771249699"; } - async up(queryRunner) { + async up(queryRunner: QueryRunner): Promise { 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"))`, ); @@ -31,7 +32,7 @@ export class wordMute1595771249699 { `ALTER TABLE "muted_note" ADD CONSTRAINT "FK_d8e07aa18c2d64e86201601aec1" FOREIGN KEY ("userId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, ); } - async down(queryRunner) { + async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "muted_note" DROP CONSTRAINT "FK_d8e07aa18c2d64e86201601aec1"`, ); diff --git a/packages/backend/migration/1595782306083-word-mute2.js b/packages/backend/src/migration/1595782306083-word-mute2.ts similarity index 72% rename from packages/backend/migration/1595782306083-word-mute2.js rename to packages/backend/src/migration/1595782306083-word-mute2.ts index 61f06b347..d8fe6dafc 100644 --- a/packages/backend/migration/1595782306083-word-mute2.js +++ b/packages/backend/src/migration/1595782306083-word-mute2.ts @@ -1,8 +1,9 @@ -export class wordMute21595782306083 { +import { MigrationInterface, QueryRunner } from "typeorm"; +export class wordMute21595782306083 implements MigrationInterface { constructor() { this.name = "wordMute21595782306083"; } - async up(queryRunner) { + async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `CREATE TYPE "muted_note_reason_enum" AS ENUM('word', 'manual', 'spam', 'other')`, ); @@ -13,7 +14,7 @@ export class wordMute21595782306083 { `CREATE INDEX "IDX_636e977ff90b23676fb5624b25" ON "muted_note" ("reason") `, ); } - async down(queryRunner) { + async down(queryRunner: QueryRunner): Promise { 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/src/migration/1596548170836-channel.ts similarity index 96% rename from packages/backend/migration/1596548170836-channel.js rename to packages/backend/src/migration/1596548170836-channel.ts index 2aaaf9550..fe143a879 100644 --- a/packages/backend/migration/1596548170836-channel.js +++ b/packages/backend/src/migration/1596548170836-channel.ts @@ -1,8 +1,9 @@ -export class channel1596548170836 { +import { MigrationInterface, QueryRunner } from "typeorm"; +export class channel1596548170836 implements MigrationInterface { constructor() { this.name = "channel1596548170836"; } - async up(queryRunner) { + async up(queryRunner: QueryRunner): Promise { 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"))`, ); @@ -73,7 +74,7 @@ export class channel1596548170836 { `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) { + async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "channel_note_pining" DROP CONSTRAINT "FK_10b19ef67d297ea9de325cd4502"`, ); diff --git a/packages/backend/migration/1596786425167-channel2.js b/packages/backend/src/migration/1596786425167-channel2.ts similarity index 54% rename from packages/backend/migration/1596786425167-channel2.js rename to packages/backend/src/migration/1596786425167-channel2.ts index ae871f5ff..3bd35fd42 100644 --- a/packages/backend/migration/1596786425167-channel2.js +++ b/packages/backend/src/migration/1596786425167-channel2.ts @@ -1,13 +1,14 @@ -export class channel21596786425167 { +import { MigrationInterface, QueryRunner } from "typeorm"; +export class channel21596786425167 implements MigrationInterface { constructor() { this.name = "channel21596786425167"; } - async up(queryRunner) { + async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "channel_following" ADD "readCursor" TIMESTAMP WITH TIME ZONE NOT NULL`, ); } - async down(queryRunner) { + async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "channel_following" DROP COLUMN "readCursor"`, ); diff --git a/packages/backend/migration/1597230137744-objectStorageSetPublicRead.js b/packages/backend/src/migration/1597230137744-objectStorageSetPublicRead.ts similarity index 54% rename from packages/backend/migration/1597230137744-objectStorageSetPublicRead.js rename to packages/backend/src/migration/1597230137744-objectStorageSetPublicRead.ts index 81540d5e8..27610a0d6 100644 --- a/packages/backend/migration/1597230137744-objectStorageSetPublicRead.js +++ b/packages/backend/src/migration/1597230137744-objectStorageSetPublicRead.ts @@ -1,13 +1,14 @@ -export class objectStorageSetPublicRead1597230137744 { +import { MigrationInterface, QueryRunner } from "typeorm"; +export class objectStorageSetPublicRead1597230137744 implements MigrationInterface { constructor() { this.name = "objectStorageSetPublicRead1597230137744"; } - async up(queryRunner) { + async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "meta" ADD "objectStorageSetPublicRead" boolean NOT NULL DEFAULT false`, ); } - async down(queryRunner) { + async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "meta" DROP COLUMN "objectStorageSetPublicRead"`, ); diff --git a/packages/backend/migration/1597236229720-IncludingNotificationTypes.js b/packages/backend/src/migration/1597236229720-IncludingNotificationTypes.ts similarity index 73% rename from packages/backend/migration/1597236229720-IncludingNotificationTypes.js rename to packages/backend/src/migration/1597236229720-IncludingNotificationTypes.ts index ce02148d2..3bc9b7d09 100644 --- a/packages/backend/migration/1597236229720-IncludingNotificationTypes.js +++ b/packages/backend/src/migration/1597236229720-IncludingNotificationTypes.ts @@ -1,8 +1,9 @@ -export class IncludingNotificationTypes1597236229720 { +import { MigrationInterface, QueryRunner } from "typeorm"; +export class IncludingNotificationTypes1597236229720 implements MigrationInterface { constructor() { this.name = "IncludingNotificationTypes1597236229720"; } - async up(queryRunner) { + async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `CREATE TYPE "user_profile_includingnotificationtypes_enum" AS ENUM('follow', 'mention', 'reply', 'renote', 'quote', 'reaction', 'pollVote', 'receiveFollowRequest', 'followRequestAccepted', 'groupInvited', 'app')`, ); @@ -10,7 +11,7 @@ export class IncludingNotificationTypes1597236229720 { `ALTER TABLE "user_profile" ADD "includingNotificationTypes" "user_profile_includingnotificationtypes_enum" array`, ); } - async down(queryRunner) { + async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "user_profile" DROP COLUMN "includingNotificationTypes"`, ); diff --git a/packages/backend/migration/1597385880794-add-sensitive-index.js b/packages/backend/src/migration/1597385880794-add-sensitive-index.ts similarity index 52% rename from packages/backend/migration/1597385880794-add-sensitive-index.js rename to packages/backend/src/migration/1597385880794-add-sensitive-index.ts index d7c818bbf..8e14ac686 100644 --- a/packages/backend/migration/1597385880794-add-sensitive-index.js +++ b/packages/backend/src/migration/1597385880794-add-sensitive-index.ts @@ -1,13 +1,14 @@ -export class addSensitiveIndex1597385880794 { +import { MigrationInterface, QueryRunner } from "typeorm"; +export class addSensitiveIndex1597385880794 implements MigrationInterface { constructor() { this.name = "addSensitiveIndex1597385880794"; } - async up(queryRunner) { + async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `CREATE INDEX "IDX_a7eba67f8b3fa27271e85d2e26" ON "drive_file" ("isSensitive") `, ); } - async down(queryRunner) { + async down(queryRunner: QueryRunner): Promise { await queryRunner.query(`DROP INDEX "IDX_a7eba67f8b3fa27271e85d2e26"`); } } diff --git a/packages/backend/migration/1597459042300-channel-unread.js b/packages/backend/src/migration/1597459042300-channel-unread.ts similarity index 86% rename from packages/backend/migration/1597459042300-channel-unread.js rename to packages/backend/src/migration/1597459042300-channel-unread.ts index 4975a84f9..64fd23f4c 100644 --- a/packages/backend/migration/1597459042300-channel-unread.js +++ b/packages/backend/src/migration/1597459042300-channel-unread.ts @@ -1,8 +1,9 @@ -export class channelUnread1597459042300 { +import { MigrationInterface, QueryRunner } from "typeorm"; +export class channelUnread1597459042300 implements MigrationInterface { constructor() { this.name = "channelUnread1597459042300"; } - async up(queryRunner) { + async up(queryRunner: QueryRunner): Promise { await queryRunner.query(`TRUNCATE TABLE "note_unread"`, undefined); await queryRunner.query( `ALTER TABLE "channel_following" DROP COLUMN "readCursor"`, @@ -26,7 +27,7 @@ export class channelUnread1597459042300 { `CREATE INDEX "IDX_6a57f051d82c6d4036c141e107" ON "note_unread" ("noteChannelId") `, ); } - async down(queryRunner) { + async down(queryRunner: QueryRunner): Promise { await queryRunner.query(`DROP INDEX "IDX_6a57f051d82c6d4036c141e107"`); await queryRunner.query(`DROP INDEX "IDX_29e8c1d579af54d4232939f994"`); await queryRunner.query(`DROP INDEX "IDX_89a29c9237b8c3b6b3cbb4cb30"`); diff --git a/packages/backend/migration/1597893996136-ChannelNoteIdDescIndex.js b/packages/backend/src/migration/1597893996136-ChannelNoteIdDescIndex.ts similarity index 65% rename from packages/backend/migration/1597893996136-ChannelNoteIdDescIndex.js rename to packages/backend/src/migration/1597893996136-ChannelNoteIdDescIndex.ts index 5a31d51e8..0ee24fe2d 100644 --- a/packages/backend/migration/1597893996136-ChannelNoteIdDescIndex.js +++ b/packages/backend/src/migration/1597893996136-ChannelNoteIdDescIndex.ts @@ -1,14 +1,15 @@ -export class ChannelNoteIdDescIndex1597893996136 { +import { MigrationInterface, QueryRunner } from "typeorm"; +export class ChannelNoteIdDescIndex1597893996136 implements MigrationInterface { constructor() { this.name = "ChannelNoteIdDescIndex1597893996136"; } - async up(queryRunner) { + async up(queryRunner: QueryRunner): Promise { 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) { + async down(queryRunner: QueryRunner): Promise { 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/src/migration/1600353287890-mutingNotificationTypes.ts similarity index 84% rename from packages/backend/migration/1600353287890-mutingNotificationTypes.js rename to packages/backend/src/migration/1600353287890-mutingNotificationTypes.ts index 2a317b3f9..7663f1215 100644 --- a/packages/backend/migration/1600353287890-mutingNotificationTypes.js +++ b/packages/backend/src/migration/1600353287890-mutingNotificationTypes.ts @@ -1,8 +1,9 @@ -export class mutingNotificationTypes1600353287890 { +import { MigrationInterface, QueryRunner } from "typeorm"; +export class mutingNotificationTypes1600353287890 implements MigrationInterface { constructor() { this.name = "mutingNotificationTypes1600353287890"; } - async up(queryRunner) { + async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "user_profile" DROP COLUMN "includingNotificationTypes"`, ); @@ -16,7 +17,7 @@ export class mutingNotificationTypes1600353287890 { `ALTER TABLE "user_profile" ADD "mutingNotificationTypes" "user_profile_mutingnotificationtypes_enum" array NOT NULL DEFAULT '{}'`, ); } - async down(queryRunner) { + async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "user_profile" DROP COLUMN "mutingNotificationTypes"`, ); diff --git a/packages/backend/migration/1603094348345-refine-abuse-user-report.js b/packages/backend/src/migration/1603094348345-refine-abuse-user-report.ts similarity index 90% rename from packages/backend/migration/1603094348345-refine-abuse-user-report.js rename to packages/backend/src/migration/1603094348345-refine-abuse-user-report.ts index 1aaf2685e..5ba8e1e9b 100644 --- a/packages/backend/migration/1603094348345-refine-abuse-user-report.js +++ b/packages/backend/src/migration/1603094348345-refine-abuse-user-report.ts @@ -1,8 +1,9 @@ -export class refineAbuseUserReport1603094348345 { +import { MigrationInterface, QueryRunner } from "typeorm"; +export class refineAbuseUserReport1603094348345 implements MigrationInterface { constructor() { this.name = "refineAbuseUserReport1603094348345"; } - async up(queryRunner) { + async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "abuse_user_report" DROP CONSTRAINT "FK_d049123c413e68ca52abe734203"`, ); @@ -30,7 +31,7 @@ export class refineAbuseUserReport1603094348345 { `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) { + async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "abuse_user_report" DROP CONSTRAINT "FK_08b883dd5fdd6f9c4c1572b36de"`, ); diff --git a/packages/backend/migration/1603095701770-refine-abuse-user-report2.js b/packages/backend/src/migration/1603095701770-refine-abuse-user-report2.ts similarity index 78% rename from packages/backend/migration/1603095701770-refine-abuse-user-report2.js rename to packages/backend/src/migration/1603095701770-refine-abuse-user-report2.ts index 301a8e538..794f27090 100644 --- a/packages/backend/migration/1603095701770-refine-abuse-user-report2.js +++ b/packages/backend/src/migration/1603095701770-refine-abuse-user-report2.ts @@ -1,8 +1,9 @@ -export class refineAbuseUserReport21603095701770 { +import { MigrationInterface, QueryRunner } from "typeorm"; +export class refineAbuseUserReport21603095701770 implements MigrationInterface { constructor() { this.name = "refineAbuseUserReport21603095701770"; } - async up(queryRunner) { + async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "abuse_user_report" ADD "targetUserHost" character varying(128)`, ); @@ -16,7 +17,7 @@ export class refineAbuseUserReport21603095701770 { `CREATE INDEX "IDX_f8d8b93740ad12c4ce8213a199" ON "abuse_user_report" ("reporterHost") `, ); } - async down(queryRunner) { + async down(queryRunner: QueryRunner): Promise { await queryRunner.query(`DROP INDEX "IDX_f8d8b93740ad12c4ce8213a199"`); await queryRunner.query(`DROP INDEX "IDX_4ebbf7f93cdc10e8d1ef2fc6cd"`); await queryRunner.query( diff --git a/packages/backend/migration/1603776877564-instance-theme-color.js b/packages/backend/src/migration/1603776877564-instance-theme-color.ts similarity index 52% rename from packages/backend/migration/1603776877564-instance-theme-color.js rename to packages/backend/src/migration/1603776877564-instance-theme-color.ts index 9bb3d65c0..c714670e6 100644 --- a/packages/backend/migration/1603776877564-instance-theme-color.js +++ b/packages/backend/src/migration/1603776877564-instance-theme-color.ts @@ -1,13 +1,14 @@ -export class instanceThemeColor1603776877564 { +import { MigrationInterface, QueryRunner } from "typeorm"; +export class instanceThemeColor1603776877564 implements MigrationInterface { constructor() { this.name = "instanceThemeColor1603776877564"; } - async up(queryRunner) { + async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "instance" ADD "themeColor" character varying(64) DEFAULT null`, ); } - async down(queryRunner) { + async down(queryRunner: QueryRunner): Promise { await queryRunner.query(`ALTER TABLE "instance" DROP COLUMN "themeColor"`); } } diff --git a/packages/backend/migration/1603781553011-instance-favicon.js b/packages/backend/src/migration/1603781553011-instance-favicon.ts similarity index 52% rename from packages/backend/migration/1603781553011-instance-favicon.js rename to packages/backend/src/migration/1603781553011-instance-favicon.ts index 4b2442692..c855a81a0 100644 --- a/packages/backend/migration/1603781553011-instance-favicon.js +++ b/packages/backend/src/migration/1603781553011-instance-favicon.ts @@ -1,13 +1,14 @@ -export class instanceFavicon1603781553011 { +import { MigrationInterface, QueryRunner } from "typeorm"; +export class instanceFavicon1603781553011 implements MigrationInterface { constructor() { this.name = "instanceFavicon1603781553011"; } - async up(queryRunner) { + async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "instance" ADD "faviconUrl" character varying(256) DEFAULT null`, ); } - async down(queryRunner) { + async down(queryRunner: QueryRunner): Promise { await queryRunner.query(`ALTER TABLE "instance" DROP COLUMN "faviconUrl"`); } } diff --git a/packages/backend/migration/1604821689616-delete-auto-watch.js b/packages/backend/src/migration/1604821689616-delete-auto-watch.ts similarity index 53% rename from packages/backend/migration/1604821689616-delete-auto-watch.js rename to packages/backend/src/migration/1604821689616-delete-auto-watch.ts index 6a8333ce1..f8577f417 100644 --- a/packages/backend/migration/1604821689616-delete-auto-watch.js +++ b/packages/backend/src/migration/1604821689616-delete-auto-watch.ts @@ -1,13 +1,14 @@ -export class deleteAutoWatch1604821689616 { +import { MigrationInterface, QueryRunner } from "typeorm"; +export class deleteAutoWatch1604821689616 implements MigrationInterface { constructor() { this.name = "deleteAutoWatch1604821689616"; } - async up(queryRunner) { + async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "user_profile" DROP COLUMN "autoWatch"`, ); } - async down(queryRunner) { + async down(queryRunner: QueryRunner): Promise { 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/src/migration/1605408848373-clip-description.ts similarity index 51% rename from packages/backend/migration/1605408848373-clip-description.js rename to packages/backend/src/migration/1605408848373-clip-description.ts index 99cda6534..2652fb2c6 100644 --- a/packages/backend/migration/1605408848373-clip-description.js +++ b/packages/backend/src/migration/1605408848373-clip-description.ts @@ -1,13 +1,14 @@ -export class clipDescription1605408848373 { +import { MigrationInterface, QueryRunner } from "typeorm"; +export class clipDescription1605408848373 implements MigrationInterface { constructor() { this.name = "clipDescription1605408848373"; } - async up(queryRunner) { + async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "clip" ADD "description" character varying(2048) DEFAULT null`, ); } - async down(queryRunner) { + async down(queryRunner: QueryRunner): Promise { await queryRunner.query(`ALTER TABLE "clip" DROP COLUMN "description"`); } } diff --git a/packages/backend/migration/1605408971051-comments.js b/packages/backend/src/migration/1605408971051-comments.ts similarity index 99% rename from packages/backend/migration/1605408971051-comments.js rename to packages/backend/src/migration/1605408971051-comments.ts index 363fec5cd..7a3dd7e47 100644 --- a/packages/backend/migration/1605408971051-comments.js +++ b/packages/backend/src/migration/1605408971051-comments.ts @@ -1,8 +1,9 @@ -export class comments1605408971051 { +import { MigrationInterface, QueryRunner } from "typeorm"; +export class comments1605408971051 implements MigrationInterface { constructor() { this.name = "comments1605408971051"; } - async up(queryRunner) { + async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `COMMENT ON COLUMN "log"."createdAt" IS 'The created date of the Log.'`, ); @@ -621,7 +622,7 @@ export class comments1605408971051 { `COMMENT ON COLUMN "channel_note_pining"."createdAt" IS 'The created date of the ChannelNotePining.'`, ); } - async down(queryRunner) { + async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `COMMENT ON COLUMN "channel_note_pining"."createdAt" IS NULL`, ); diff --git a/packages/backend/migration/1605585339718-instance-pinned-pages.js b/packages/backend/src/migration/1605585339718-instance-pinned-pages.ts similarity index 59% rename from packages/backend/migration/1605585339718-instance-pinned-pages.js rename to packages/backend/src/migration/1605585339718-instance-pinned-pages.ts index 09e161764..4105b7c1a 100644 --- a/packages/backend/migration/1605585339718-instance-pinned-pages.js +++ b/packages/backend/src/migration/1605585339718-instance-pinned-pages.ts @@ -1,13 +1,14 @@ -export class instancePinnedPages1605585339718 { +import { MigrationInterface, QueryRunner } from "typeorm"; +export class instancePinnedPages1605585339718 implements MigrationInterface { constructor() { this.name = "instancePinnedPages1605585339718"; } - async up(queryRunner) { + async up(queryRunner: QueryRunner): Promise { 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) { + async down(queryRunner: QueryRunner): Promise { await queryRunner.query(`ALTER TABLE "meta" DROP COLUMN "pinnedPages"`); } } diff --git a/packages/backend/migration/1605965516823-instance-images.js b/packages/backend/src/migration/1605965516823-instance-images.ts similarity index 64% rename from packages/backend/migration/1605965516823-instance-images.js rename to packages/backend/src/migration/1605965516823-instance-images.ts index ed9a26a65..24730d583 100644 --- a/packages/backend/migration/1605965516823-instance-images.js +++ b/packages/backend/src/migration/1605965516823-instance-images.ts @@ -1,8 +1,9 @@ -export class instanceImages1605965516823 { +import { MigrationInterface, QueryRunner } from "typeorm"; +export class instanceImages1605965516823 implements MigrationInterface { constructor() { this.name = "instanceImages1605965516823"; } - async up(queryRunner) { + async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "meta" ADD "backgroundImageUrl" character varying(512)`, ); @@ -10,7 +11,7 @@ export class instanceImages1605965516823 { `ALTER TABLE "meta" ADD "logoImageUrl" character varying(512)`, ); } - async down(queryRunner) { + async down(queryRunner: QueryRunner): Promise { 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/src/migration/1606191203881-no-crawle.ts similarity index 68% rename from packages/backend/migration/1606191203881-no-crawle.js rename to packages/backend/src/migration/1606191203881-no-crawle.ts index 4e7e82277..1fd5c0efc 100644 --- a/packages/backend/migration/1606191203881-no-crawle.js +++ b/packages/backend/src/migration/1606191203881-no-crawle.ts @@ -1,8 +1,9 @@ -export class noCrawle1606191203881 { +import { MigrationInterface, QueryRunner } from "typeorm"; +export class noCrawle1606191203881 implements MigrationInterface { constructor() { this.name = "noCrawle1606191203881"; } - async up(queryRunner) { + async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "user_profile" ADD "noCrawle" boolean NOT NULL DEFAULT false`, ); @@ -10,7 +11,7 @@ export class noCrawle1606191203881 { `COMMENT ON COLUMN "user_profile"."noCrawle" IS 'Whether reject index by crawler.'`, ); } - async down(queryRunner) { + async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `COMMENT ON COLUMN "user_profile"."noCrawle" IS 'Whether reject index by crawler.'`, ); diff --git a/packages/backend/migration/1607151207216-instance-pinned-clip.js b/packages/backend/src/migration/1607151207216-instance-pinned-clip.ts similarity index 50% rename from packages/backend/migration/1607151207216-instance-pinned-clip.js rename to packages/backend/src/migration/1607151207216-instance-pinned-clip.ts index 655b4c7fb..8e069c697 100644 --- a/packages/backend/migration/1607151207216-instance-pinned-clip.js +++ b/packages/backend/src/migration/1607151207216-instance-pinned-clip.ts @@ -1,13 +1,14 @@ -export class instancePinnedClip1607151207216 { +import { MigrationInterface, QueryRunner } from "typeorm"; +export class instancePinnedClip1607151207216 implements MigrationInterface { constructor() { this.name = "instancePinnedClip1607151207216"; } - async up(queryRunner) { + async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "meta" ADD "pinnedClipId" character varying(32)`, ); } - async down(queryRunner) { + async down(queryRunner: QueryRunner): Promise { await queryRunner.query(`ALTER TABLE "meta" DROP COLUMN "pinnedClipId"`); } } diff --git a/packages/backend/migration/1607353487793-isExplorable.js b/packages/backend/src/migration/1607353487793-isExplorable.ts similarity index 73% rename from packages/backend/migration/1607353487793-isExplorable.js rename to packages/backend/src/migration/1607353487793-isExplorable.ts index d654ee121..59ce435a9 100644 --- a/packages/backend/migration/1607353487793-isExplorable.js +++ b/packages/backend/src/migration/1607353487793-isExplorable.ts @@ -1,8 +1,9 @@ -export class isExplorable1607353487793 { +import { MigrationInterface, QueryRunner } from "typeorm"; +export class isExplorable1607353487793 implements MigrationInterface { constructor() { this.name = "isExplorable1607353487793"; } - async up(queryRunner) { + async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "user" ADD "isExplorable" boolean NOT NULL DEFAULT true`, ); @@ -13,7 +14,7 @@ export class isExplorable1607353487793 { `CREATE INDEX "IDX_d5a1b83c7cab66f167e6888188" ON "user" ("isExplorable") `, ); } - async down(queryRunner) { + async down(queryRunner: QueryRunner): Promise { await queryRunner.query(`DROP INDEX "IDX_d5a1b83c7cab66f167e6888188"`); await queryRunner.query( `COMMENT ON COLUMN "user"."isExplorable" IS 'Whether the User is explorable.'`, diff --git a/packages/backend/migration/1610277136869-registry.js b/packages/backend/src/migration/1610277136869-registry.ts similarity index 88% rename from packages/backend/migration/1610277136869-registry.js rename to packages/backend/src/migration/1610277136869-registry.ts index 023519302..53934820e 100644 --- a/packages/backend/migration/1610277136869-registry.js +++ b/packages/backend/src/migration/1610277136869-registry.ts @@ -1,8 +1,9 @@ -export class registry1610277136869 { +import { MigrationInterface, QueryRunner } from "typeorm"; +export class registry1610277136869 implements MigrationInterface { constructor() { this.name = "registry1610277136869"; } - async up(queryRunner) { + async up(queryRunner: QueryRunner): Promise { 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.'`, ); @@ -19,7 +20,7 @@ export class registry1610277136869 { `ALTER TABLE "registry_item" ADD CONSTRAINT "FK_fb9d21ba0abb83223263df6bcb3" FOREIGN KEY ("userId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, ); } - async down(queryRunner) { + async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "registry_item" DROP CONSTRAINT "FK_fb9d21ba0abb83223263df6bcb3"`, ); diff --git a/packages/backend/migration/1610277585759-registry2.js b/packages/backend/src/migration/1610277585759-registry2.ts similarity index 67% rename from packages/backend/migration/1610277585759-registry2.js rename to packages/backend/src/migration/1610277585759-registry2.ts index a2c1fb01b..587c9da22 100644 --- a/packages/backend/migration/1610277585759-registry2.js +++ b/packages/backend/src/migration/1610277585759-registry2.ts @@ -1,8 +1,9 @@ -export class registry21610277585759 { +import { MigrationInterface, QueryRunner } from "typeorm"; +export class registry21610277585759 implements MigrationInterface { constructor() { this.name = "registry21610277585759"; } - async up(queryRunner) { + async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "registry_item" ADD "value" jsonb NOT NULL DEFAULT '{}'`, ); @@ -10,7 +11,7 @@ export class registry21610277585759 { `COMMENT ON COLUMN "registry_item"."value" IS 'The value of the RegistryItem.'`, ); } - async down(queryRunner) { + async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `COMMENT ON COLUMN "registry_item"."value" IS 'The value of the RegistryItem.'`, ); diff --git a/packages/backend/migration/1610283021566-registry3.js b/packages/backend/src/migration/1610283021566-registry3.ts similarity index 53% rename from packages/backend/migration/1610283021566-registry3.js rename to packages/backend/src/migration/1610283021566-registry3.ts index a1d55b2dc..6f968bdc3 100644 --- a/packages/backend/migration/1610283021566-registry3.js +++ b/packages/backend/src/migration/1610283021566-registry3.ts @@ -1,13 +1,14 @@ -export class registry31610283021566 { +import { MigrationInterface, QueryRunner } from "typeorm"; +export class registry31610283021566 implements MigrationInterface { constructor() { this.name = "registry31610283021566"; } - async up(queryRunner) { + async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "registry_item" ALTER COLUMN "value" DROP NOT NULL`, ); } - async down(queryRunner) { + async down(queryRunner: QueryRunner): Promise { 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/src/migration/1611354329133-followersUri.ts similarity index 71% rename from packages/backend/migration/1611354329133-followersUri.js rename to packages/backend/src/migration/1611354329133-followersUri.ts index c7ca5c895..c00da944d 100644 --- a/packages/backend/migration/1611354329133-followersUri.js +++ b/packages/backend/src/migration/1611354329133-followersUri.ts @@ -1,8 +1,9 @@ -export class followersUri1611354329133 { +import { MigrationInterface, QueryRunner } from "typeorm"; +export class followersUri1611354329133 implements MigrationInterface { constructor() { this.name = "followersUri1611354329133"; } - async up(queryRunner) { + async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "user" ADD "followersUri" varchar(512) DEFAULT NULL`, ); @@ -10,7 +11,7 @@ export class followersUri1611354329133 { `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) { + async down(queryRunner: QueryRunner): Promise { 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.'`, ); diff --git a/packages/backend/migration/1611397665007-gallery.js b/packages/backend/src/migration/1611397665007-gallery.ts similarity index 94% rename from packages/backend/migration/1611397665007-gallery.js rename to packages/backend/src/migration/1611397665007-gallery.ts index 1f36acbc1..dc5021a20 100644 --- a/packages/backend/migration/1611397665007-gallery.js +++ b/packages/backend/src/migration/1611397665007-gallery.ts @@ -1,8 +1,9 @@ -export class gallery1611397665007 { +import { MigrationInterface, QueryRunner } from "typeorm"; +export class gallery1611397665007 implements MigrationInterface { constructor() { this.name = "gallery1611397665007"; } - async up(queryRunner) { + async up(queryRunner: QueryRunner): Promise { 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.'`, ); @@ -46,7 +47,7 @@ export class gallery1611397665007 { `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) { + async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "gallery_like" DROP CONSTRAINT "FK_b1cb568bfe569e47b7051699fc8"`, ); diff --git a/packages/backend/migration/1611547387175-objectStorageS3ForcePathStyle.js b/packages/backend/src/migration/1611547387175-objectStorageS3ForcePathStyle.ts similarity index 55% rename from packages/backend/migration/1611547387175-objectStorageS3ForcePathStyle.js rename to packages/backend/src/migration/1611547387175-objectStorageS3ForcePathStyle.ts index b65ca2a57..20e2924a4 100644 --- a/packages/backend/migration/1611547387175-objectStorageS3ForcePathStyle.js +++ b/packages/backend/src/migration/1611547387175-objectStorageS3ForcePathStyle.ts @@ -1,13 +1,14 @@ -export class objectStorageS3ForcePathStyle1611547387175 { +import { MigrationInterface, QueryRunner } from "typeorm"; +export class objectStorageS3ForcePathStyle1611547387175 implements MigrationInterface { constructor() { this.name = "objectStorageS3ForcePathStyle1611547387175"; } - async up(queryRunner) { + async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "meta" ADD "objectStorageS3ForcePathStyle" boolean NOT NULL DEFAULT true`, ); } - async down(queryRunner) { + async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "meta" DROP COLUMN "objectStorageS3ForcePathStyle"`, ); diff --git a/packages/backend/migration/1612619156584-announcement-email.js b/packages/backend/src/migration/1612619156584-announcement-email.ts similarity index 55% rename from packages/backend/migration/1612619156584-announcement-email.js rename to packages/backend/src/migration/1612619156584-announcement-email.ts index a3b7292f8..6309a4a4e 100644 --- a/packages/backend/migration/1612619156584-announcement-email.js +++ b/packages/backend/src/migration/1612619156584-announcement-email.ts @@ -1,13 +1,14 @@ -export class announcementEmail1612619156584 { +import { MigrationInterface, QueryRunner } from "typeorm"; +export class announcementEmail1612619156584 implements MigrationInterface { constructor() { this.name = "announcementEmail1612619156584"; } - async up(queryRunner) { + async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "user_profile" ADD "receiveAnnouncementEmail" boolean NOT NULL DEFAULT true`, ); } - async down(queryRunner) { + async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "user_profile" DROP COLUMN "receiveAnnouncementEmail"`, ); diff --git a/packages/backend/migration/1613155914446-emailNotificationTypes.js b/packages/backend/src/migration/1613155914446-emailNotificationTypes.ts similarity index 58% rename from packages/backend/migration/1613155914446-emailNotificationTypes.js rename to packages/backend/src/migration/1613155914446-emailNotificationTypes.ts index e64aada7b..ae8a42c0e 100644 --- a/packages/backend/migration/1613155914446-emailNotificationTypes.js +++ b/packages/backend/src/migration/1613155914446-emailNotificationTypes.ts @@ -1,13 +1,14 @@ -export class emailNotificationTypes1613155914446 { +import { MigrationInterface, QueryRunner } from "typeorm"; +export class emailNotificationTypes1613155914446 implements MigrationInterface { constructor() { this.name = "emailNotificationTypes1613155914446"; } - async up(queryRunner) { + async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "user_profile" ADD "emailNotificationTypes" jsonb NOT NULL DEFAULT '["follow","receiveFollowRequest","groupInvited"]'`, ); } - async down(queryRunner) { + async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "user_profile" DROP COLUMN "emailNotificationTypes"`, ); diff --git a/packages/backend/migration/1613181457597-user-lang.js b/packages/backend/src/migration/1613181457597-user-lang.ts similarity index 50% rename from packages/backend/migration/1613181457597-user-lang.js rename to packages/backend/src/migration/1613181457597-user-lang.ts index aa5bf7de8..a72622688 100644 --- a/packages/backend/migration/1613181457597-user-lang.js +++ b/packages/backend/src/migration/1613181457597-user-lang.ts @@ -1,13 +1,14 @@ -export class userLang1613181457597 { +import { MigrationInterface, QueryRunner } from "typeorm"; +export class userLang1613181457597 implements MigrationInterface { constructor() { this.name = "userLang1613181457597"; } - async up(queryRunner) { + async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "user_profile" ADD "lang" character varying(32)`, ); } - async down(queryRunner) { + async down(queryRunner: QueryRunner): Promise { 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/src/migration/1613503367223-use-bigint-for-driveUsage.ts similarity index 59% rename from packages/backend/migration/1613503367223-use-bigint-for-driveUsage.js rename to packages/backend/src/migration/1613503367223-use-bigint-for-driveUsage.ts index a8f1e33bf..1da4bd168 100644 --- a/packages/backend/migration/1613503367223-use-bigint-for-driveUsage.js +++ b/packages/backend/src/migration/1613503367223-use-bigint-for-driveUsage.ts @@ -1,13 +1,14 @@ -export class useBigintForDriveUsage1613503367223 { +import { MigrationInterface, QueryRunner } from "typeorm"; +export class useBigintForDriveUsage1613503367223 implements MigrationInterface { constructor() { this.name = "useBigintForDriveUsage1613503367223"; } - async up(queryRunner) { + async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "instance" ALTER COLUMN "driveUsage" TYPE bigint`, ); } - async down(queryRunner) { + async down(queryRunner: QueryRunner): Promise { 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/src/migration/1615965918224-chart-v2.ts similarity index 98% rename from packages/backend/migration/1615965918224-chart-v2.js rename to packages/backend/src/migration/1615965918224-chart-v2.ts index 0460a57f5..28e0f754f 100644 --- a/packages/backend/migration/1615965918224-chart-v2.js +++ b/packages/backend/src/migration/1615965918224-chart-v2.ts @@ -1,8 +1,9 @@ -export class chartV21615965918224 { +import { MigrationInterface, QueryRunner } from "typeorm"; +export class chartV21615965918224 implements MigrationInterface { constructor() { this.name = "chartV21615965918224"; } - async up(queryRunner) { + async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `DELETE FROM "__chart__active_users" WHERE "span" = 'day'`, ); @@ -218,7 +219,7 @@ export class chartV21615965918224 { `ALTER TABLE "__chart__users" DROP COLUMN "unique"`, ); } - async down(queryRunner) { + async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "__chart__users" ADD "unique" jsonb NOT NULL DEFAULT '{}'`, ); diff --git a/packages/backend/migration/1615966519402-chart-v2-2.js b/packages/backend/src/migration/1615966519402-chart-v2-2.ts similarity index 84% rename from packages/backend/migration/1615966519402-chart-v2-2.js rename to packages/backend/src/migration/1615966519402-chart-v2-2.ts index ce7596103..0b1999c27 100644 --- a/packages/backend/migration/1615966519402-chart-v2-2.js +++ b/packages/backend/src/migration/1615966519402-chart-v2-2.ts @@ -1,8 +1,9 @@ -export class chartV221615966519402 { +import { MigrationInterface, QueryRunner } from "typeorm"; +export class chartV221615966519402 implements MigrationInterface { constructor() { this.name = "chartV221615966519402"; } - async up(queryRunner) { + async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "__chart__active_users" ADD "___local_users" character varying array NOT NULL DEFAULT '{}'::varchar[]`, ); @@ -19,7 +20,7 @@ export class chartV221615966519402 { `ALTER TABLE "__chart__test_unique" ADD "___foo" character varying array NOT NULL DEFAULT '{}'::varchar[]`, ); } - async down(queryRunner) { + async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "__chart__test_unique" DROP COLUMN "___foo"`, ); diff --git a/packages/backend/migration/1618637372000-user-last-active-date.js b/packages/backend/src/migration/1618637372000-user-last-active-date.ts similarity index 65% rename from packages/backend/migration/1618637372000-user-last-active-date.js rename to packages/backend/src/migration/1618637372000-user-last-active-date.ts index 0211c256b..57c70c5a9 100644 --- a/packages/backend/migration/1618637372000-user-last-active-date.js +++ b/packages/backend/src/migration/1618637372000-user-last-active-date.ts @@ -1,8 +1,9 @@ -export class userLastActiveDate1618637372000 { +import { MigrationInterface, QueryRunner } from "typeorm"; +export class userLastActiveDate1618637372000 implements MigrationInterface { constructor() { this.name = "userLastActiveDate1618637372000"; } - async up(queryRunner) { + async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "user" ADD "lastActiveDate" TIMESTAMP WITH TIME ZONE DEFAULT NULL`, ); @@ -10,7 +11,7 @@ export class userLastActiveDate1618637372000 { `CREATE INDEX "IDX_seoignmeoprigmkpodgrjmkpormg" ON "user" ("lastActiveDate") `, ); } - async down(queryRunner) { + async down(queryRunner: QueryRunner): Promise { 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/src/migration/1618639857000-user-hide-online-status.ts similarity index 53% rename from packages/backend/migration/1618639857000-user-hide-online-status.js rename to packages/backend/src/migration/1618639857000-user-hide-online-status.ts index 8d7632608..f2c3bde75 100644 --- a/packages/backend/migration/1618639857000-user-hide-online-status.js +++ b/packages/backend/src/migration/1618639857000-user-hide-online-status.ts @@ -1,13 +1,14 @@ -export class userHideOnlineStatus1618639857000 { +import { MigrationInterface, QueryRunner } from "typeorm"; +export class userHideOnlineStatus1618639857000 implements MigrationInterface { constructor() { this.name = "userHideOnlineStatus1618639857000"; } - async up(queryRunner) { + async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "user" ADD "hideOnlineStatus" boolean NOT NULL DEFAULT false`, ); } - async down(queryRunner) { + async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "user" DROP COLUMN "hideOnlineStatus"`, ); diff --git a/packages/backend/migration/1619942102890-password-reset.js b/packages/backend/src/migration/1619942102890-password-reset.ts similarity index 83% rename from packages/backend/migration/1619942102890-password-reset.js rename to packages/backend/src/migration/1619942102890-password-reset.ts index e3adeb95e..3e60ee3b8 100644 --- a/packages/backend/migration/1619942102890-password-reset.js +++ b/packages/backend/src/migration/1619942102890-password-reset.ts @@ -1,8 +1,9 @@ -export class passwordReset1619942102890 { +import { MigrationInterface, QueryRunner } from "typeorm"; +export class passwordReset1619942102890 implements MigrationInterface { constructor() { this.name = "passwordReset1619942102890"; } - async up(queryRunner) { + async up(queryRunner: QueryRunner): Promise { 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"))`, ); @@ -16,7 +17,7 @@ export class passwordReset1619942102890 { `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) { + async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "password_reset_request" DROP CONSTRAINT "FK_4bb7fd4a34492ae0e6cc8d30ac8"`, ); diff --git a/packages/backend/migration/1620019354680-ad.js b/packages/backend/src/migration/1620019354680-ad.ts similarity index 82% rename from packages/backend/migration/1620019354680-ad.js rename to packages/backend/src/migration/1620019354680-ad.ts index e39b38101..2bb4ab285 100644 --- a/packages/backend/migration/1620019354680-ad.js +++ b/packages/backend/src/migration/1620019354680-ad.ts @@ -1,8 +1,9 @@ -export class ad1620019354680 { +import { MigrationInterface, QueryRunner } from "typeorm"; +export class ad1620019354680 implements MigrationInterface { constructor() { this.name = "ad1620019354680"; } - async up(queryRunner) { + async up(queryRunner: QueryRunner): Promise { 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.'`, ); @@ -13,7 +14,7 @@ export class ad1620019354680 { `CREATE INDEX "IDX_2da24ce20ad209f1d9dc032457" ON "ad" ("expiresAt") `, ); } - async down(queryRunner) { + async down(queryRunner: QueryRunner): Promise { 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/src/migration/1620364649428-ad2.ts b/packages/backend/src/migration/1620364649428-ad2.ts new file mode 100644 index 000000000..8e964d587 --- /dev/null +++ b/packages/backend/src/migration/1620364649428-ad2.ts @@ -0,0 +1,14 @@ +import { MigrationInterface, QueryRunner } from "typeorm"; +export class ad21620364649428 implements MigrationInterface { + constructor() { + this.name = "ad21620364649428"; + } + async up(queryRunner: QueryRunner): Promise { + await queryRunner.query( + `ALTER TABLE "ad" ADD "ratio" integer NOT NULL DEFAULT '1'`, + ); + } + async down(queryRunner: QueryRunner): Promise { + await queryRunner.query(`ALTER TABLE "ad" DROP COLUMN "ratio"`); + } +} diff --git a/packages/backend/migration/1621479946000-add-note-indexes.js b/packages/backend/src/migration/1621479946000-add-note-indexes.ts similarity index 66% rename from packages/backend/migration/1621479946000-add-note-indexes.js rename to packages/backend/src/migration/1621479946000-add-note-indexes.ts index f9ffbbff1..24e41bc2b 100644 --- a/packages/backend/migration/1621479946000-add-note-indexes.js +++ b/packages/backend/src/migration/1621479946000-add-note-indexes.ts @@ -1,8 +1,9 @@ -export class addNoteIndexes1621479946000 { +import { MigrationInterface, QueryRunner } from "typeorm"; +export class addNoteIndexes1621479946000 implements MigrationInterface { constructor() { this.name = "addNoteIndexes1621479946000"; } - async up(queryRunner) { + async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `CREATE INDEX "IDX_NOTE_MENTIONS" ON "note" USING gin ("mentions")`, undefined, @@ -12,7 +13,7 @@ export class addNoteIndexes1621479946000 { undefined, ); } - async down(queryRunner) { + async down(queryRunner: QueryRunner): Promise { await queryRunner.query(`DROP INDEX "IDX_NOTE_MENTIONS"`, undefined); await queryRunner.query( `DROP INDEX "IDX_NOTE_VISIBLE_USER_IDS"`, diff --git a/packages/backend/migration/1622679304522-user-profile-description-length.js b/packages/backend/src/migration/1622679304522-user-profile-description-length.ts similarity index 58% rename from packages/backend/migration/1622679304522-user-profile-description-length.js rename to packages/backend/src/migration/1622679304522-user-profile-description-length.ts index 7c761c92a..bbf038c95 100644 --- a/packages/backend/migration/1622679304522-user-profile-description-length.js +++ b/packages/backend/src/migration/1622679304522-user-profile-description-length.ts @@ -1,14 +1,15 @@ -export class userProfileDescriptionLength1622679304522 { +import { MigrationInterface, QueryRunner } from "typeorm"; +export class userProfileDescriptionLength1622679304522 implements MigrationInterface { constructor() { this.name = "userProfileDescriptionLength1622679304522"; } - async up(queryRunner) { + async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "user_profile" ALTER COLUMN "description" TYPE character varying(2048)`, undefined, ); } - async down(queryRunner) { + async down(queryRunner: QueryRunner): Promise { 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/src/migration/1622681548499-log-message-length.ts similarity index 56% rename from packages/backend/migration/1622681548499-log-message-length.js rename to packages/backend/src/migration/1622681548499-log-message-length.ts index 9dfb7ed3d..693fd7546 100644 --- a/packages/backend/migration/1622681548499-log-message-length.js +++ b/packages/backend/src/migration/1622681548499-log-message-length.ts @@ -1,14 +1,15 @@ -export class logMessageLength1622681548499 { +import { MigrationInterface, QueryRunner } from "typeorm"; +export class logMessageLength1622681548499 implements MigrationInterface { constructor() { this.name = "logMessageLength1622681548499"; } - async up(queryRunner) { + async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "log" ALTER COLUMN "message" TYPE character varying(2048)`, undefined, ); } - async down(queryRunner) { + async down(queryRunner: QueryRunner): Promise { 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/src/migration/1626509500668-fix-remote-file-proxy.ts similarity index 79% rename from packages/backend/migration/1626509500668-fix-remote-file-proxy.js rename to packages/backend/src/migration/1626509500668-fix-remote-file-proxy.ts index f79cfb006..dbd6d4c35 100644 --- a/packages/backend/migration/1626509500668-fix-remote-file-proxy.js +++ b/packages/backend/src/migration/1626509500668-fix-remote-file-proxy.ts @@ -1,8 +1,9 @@ -export class fixRemoteFileProxy1626509500668 { +import { MigrationInterface, QueryRunner } from "typeorm"; +export class fixRemoteFileProxy1626509500668 implements MigrationInterface { constructor() { this.name = "fixRemoteFileProxy1626509500668"; } - async up(queryRunner) { + async up(queryRunner: QueryRunner): Promise { 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"`); @@ -11,7 +12,7 @@ export class fixRemoteFileProxy1626509500668 { `ALTER TABLE "meta" DROP COLUMN "proxyRemoteFiles"`, ); } - async down(queryRunner) { + async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "meta" ADD "proxyRemoteFiles" boolean NOT NULL DEFAULT false`, ); diff --git a/packages/backend/migration/1626733991004-allowlist-secure-mode.js b/packages/backend/src/migration/1626733991004-allowlist-secure-mode.ts similarity index 70% rename from packages/backend/migration/1626733991004-allowlist-secure-mode.js rename to packages/backend/src/migration/1626733991004-allowlist-secure-mode.ts index 6d2dd6842..8fd300011 100644 --- a/packages/backend/migration/1626733991004-allowlist-secure-mode.js +++ b/packages/backend/src/migration/1626733991004-allowlist-secure-mode.ts @@ -1,6 +1,7 @@ -export class allowlistSecureMode1626733991004 { +import { MigrationInterface, QueryRunner } from "typeorm"; +export class allowlistSecureMode1626733991004 implements MigrationInterface { name = "allowlistSecureMode1626733991004"; - async up(queryRunner) { + async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "meta" ADD "allowedHosts" character varying(256) [] default '{}'`, ); @@ -12,7 +13,7 @@ export class allowlistSecureMode1626733991004 { ); } - async down(queryRunner) { + async down(queryRunner: QueryRunner): Promise { 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/src/migration/1629004542760-chart-reindex.ts similarity index 98% rename from packages/backend/migration/1629004542760-chart-reindex.js rename to packages/backend/src/migration/1629004542760-chart-reindex.ts index 8cc564b32..ad49e082f 100644 --- a/packages/backend/migration/1629004542760-chart-reindex.js +++ b/packages/backend/src/migration/1629004542760-chart-reindex.ts @@ -1,8 +1,9 @@ -export class chartReindex1629004542760 { +import { MigrationInterface, QueryRunner } from "typeorm"; +export class chartReindex1629004542760 implements MigrationInterface { constructor() { this.name = "chartReindex1629004542760"; } - async up(queryRunner) { + async up(queryRunner: QueryRunner): Promise { 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;`, ); @@ -181,7 +182,7 @@ export class chartReindex1629004542760 { `CREATE UNIQUE INDEX "IDX_66feba81e1795d176d06c0b1e6" ON "__chart__users" ("date") WHERE "group" IS NULL`, ); } - async down(queryRunner) { + async down(queryRunner: QueryRunner): Promise { await queryRunner.query(`DROP INDEX "IDX_66feba81e1795d176d06c0b1e6"`); await queryRunner.query(`DROP INDEX "IDX_337e9599f278bd7537fe30876f"`); await queryRunner.query(`DROP INDEX "IDX_dab383a36f3c9db4a0c9b02cf3"`); diff --git a/packages/backend/migration/1629024377804-deepl-integration.js b/packages/backend/src/migration/1629024377804-deepl-integration.ts similarity index 50% rename from packages/backend/migration/1629024377804-deepl-integration.js rename to packages/backend/src/migration/1629024377804-deepl-integration.ts index 1dd5465fb..7b05f712e 100644 --- a/packages/backend/migration/1629024377804-deepl-integration.js +++ b/packages/backend/src/migration/1629024377804-deepl-integration.ts @@ -1,13 +1,14 @@ -export class deeplIntegration1629024377804 { +import { MigrationInterface, QueryRunner } from "typeorm"; +export class deeplIntegration1629024377804 implements MigrationInterface { constructor() { this.name = "deeplIntegration1629024377804"; } - async up(queryRunner) { + async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "meta" ADD "deeplAuthKey" character varying(128)`, ); } - async down(queryRunner) { + async down(queryRunner: QueryRunner): Promise { await queryRunner.query(`ALTER TABLE "meta" DROP COLUMN "deeplAuthKey"`); } } diff --git a/packages/backend/migration/1629288472000-fix-channel-userId.js b/packages/backend/src/migration/1629288472000-fix-channel-userId.ts similarity index 52% rename from packages/backend/migration/1629288472000-fix-channel-userId.js rename to packages/backend/src/migration/1629288472000-fix-channel-userId.ts index e02549b11..15b32cd37 100644 --- a/packages/backend/migration/1629288472000-fix-channel-userId.js +++ b/packages/backend/src/migration/1629288472000-fix-channel-userId.ts @@ -1,13 +1,14 @@ -export class fixChannelUserId1629288472000 { +import { MigrationInterface, QueryRunner } from "typeorm"; +export class fixChannelUserId1629288472000 implements MigrationInterface { constructor() { this.name = "fixChannelUserId1629288472000"; } - async up(queryRunner) { + async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "channel" ALTER COLUMN "userId" DROP NOT NULL;`, ); } - async down(queryRunner) { + async down(queryRunner: QueryRunner): Promise { 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/src/migration/1629512953000-user-is-deleted.ts similarity index 59% rename from packages/backend/migration/1629512953000-user-is-deleted.js rename to packages/backend/src/migration/1629512953000-user-is-deleted.ts index 448535276..f47fdeeaf 100644 --- a/packages/backend/migration/1629512953000-user-is-deleted.js +++ b/packages/backend/src/migration/1629512953000-user-is-deleted.ts @@ -1,8 +1,9 @@ -export class isUserDeleted1629512953000 { +import { MigrationInterface, QueryRunner } from "typeorm"; +export class isUserDeleted1629512953000 implements MigrationInterface { constructor() { this.name = "isUserDeleted1629512953000"; } - async up(queryRunner) { + async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "user" ADD "isDeleted" boolean NOT NULL DEFAULT false`, ); @@ -10,7 +11,7 @@ export class isUserDeleted1629512953000 { `COMMENT ON COLUMN "user"."isDeleted" IS 'Whether the User is deleted.'`, ); } - async down(queryRunner) { + async down(queryRunner: QueryRunner): Promise { await queryRunner.query(`ALTER TABLE "user" DROP COLUMN "isDeleted"`); } } diff --git a/packages/backend/migration/1629778475000-deepl-integration2.js b/packages/backend/src/migration/1629778475000-deepl-integration2.ts similarity index 51% rename from packages/backend/migration/1629778475000-deepl-integration2.js rename to packages/backend/src/migration/1629778475000-deepl-integration2.ts index 138e00d24..309f84134 100644 --- a/packages/backend/migration/1629778475000-deepl-integration2.js +++ b/packages/backend/src/migration/1629778475000-deepl-integration2.ts @@ -1,13 +1,14 @@ -export class deeplIntegration21629778475000 { +import { MigrationInterface, QueryRunner } from "typeorm"; +export class deeplIntegration21629778475000 implements MigrationInterface { constructor() { this.name = "deeplIntegration21629778475000"; } - async up(queryRunner) { + async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "meta" ADD "deeplIsPro" boolean NOT NULL DEFAULT false`, ); } - async down(queryRunner) { + async down(queryRunner: QueryRunner): Promise { await queryRunner.query(`ALTER TABLE "meta" DROP COLUMN "deeplIsPro"`); } } diff --git a/packages/backend/migration/1629833361000-AddShowTLReplies.js b/packages/backend/src/migration/1629833361000-AddShowTLReplies.ts similarity index 64% rename from packages/backend/migration/1629833361000-AddShowTLReplies.js rename to packages/backend/src/migration/1629833361000-AddShowTLReplies.ts index 78e9f417b..6d8b249a9 100644 --- a/packages/backend/migration/1629833361000-AddShowTLReplies.js +++ b/packages/backend/src/migration/1629833361000-AddShowTLReplies.ts @@ -1,8 +1,9 @@ -export class addShowTLReplies1629833361000 { +import { MigrationInterface, QueryRunner } from "typeorm"; +export class addShowTLReplies1629833361000 implements MigrationInterface { constructor() { this.name = "addShowTLReplies1629833361000"; } - async up(queryRunner) { + async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "user" ADD "showTimelineReplies" boolean NOT NULL DEFAULT false`, ); @@ -10,7 +11,7 @@ export class addShowTLReplies1629833361000 { `COMMENT ON COLUMN "user"."showTimelineReplies" IS 'Whether to show users replying to other users in the timeline.'`, ); } - async down(queryRunner) { + async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "user" DROP COLUMN "showTimelineReplies"`, ); diff --git a/packages/backend/migration/1629968054000_userInstanceBlocks.js b/packages/backend/src/migration/1629968054000_userInstanceBlocks.ts similarity index 62% rename from packages/backend/migration/1629968054000_userInstanceBlocks.js rename to packages/backend/src/migration/1629968054000_userInstanceBlocks.ts index 666aaba28..60ad2b983 100644 --- a/packages/backend/migration/1629968054000_userInstanceBlocks.js +++ b/packages/backend/src/migration/1629968054000_userInstanceBlocks.ts @@ -1,8 +1,9 @@ -export class userInstanceBlocks1629968054000 { +import { MigrationInterface, QueryRunner } from "typeorm"; +export class userInstanceBlocks1629968054000 implements MigrationInterface { constructor() { this.name = "userInstanceBlocks1629968054000"; } - async up(queryRunner) { + async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "user_profile" ADD "mutedInstances" jsonb NOT NULL DEFAULT '[]'`, ); @@ -10,7 +11,7 @@ export class userInstanceBlocks1629968054000 { `COMMENT ON COLUMN "user_profile"."mutedInstances" IS 'List of instances muted by the user.'`, ); } - async down(queryRunner) { + async down(queryRunner: QueryRunner): Promise { 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/src/migration/1633068642000-email-required-for-signup.ts similarity index 54% rename from packages/backend/migration/1633068642000-email-required-for-signup.js rename to packages/backend/src/migration/1633068642000-email-required-for-signup.ts index 45c0894a7..140c8fbc2 100644 --- a/packages/backend/migration/1633068642000-email-required-for-signup.js +++ b/packages/backend/src/migration/1633068642000-email-required-for-signup.ts @@ -1,13 +1,14 @@ -export class emailRequiredForSignup1633068642000 { +import { MigrationInterface, QueryRunner } from "typeorm"; +export class emailRequiredForSignup1633068642000 implements MigrationInterface { constructor() { this.name = "emailRequiredForSignup1633068642000"; } - async up(queryRunner) { + async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "meta" ADD "emailRequiredForSignup" boolean NOT NULL DEFAULT false`, ); } - async down(queryRunner) { + async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "meta" DROP COLUMN "emailRequiredForSignup"`, ); diff --git a/packages/backend/migration/1633071909016-user-pending.js b/packages/backend/src/migration/1633071909016-user-pending.ts similarity index 74% rename from packages/backend/migration/1633071909016-user-pending.js rename to packages/backend/src/migration/1633071909016-user-pending.ts index b37e51629..8da5a756f 100644 --- a/packages/backend/migration/1633071909016-user-pending.js +++ b/packages/backend/src/migration/1633071909016-user-pending.ts @@ -1,8 +1,9 @@ -export class userPending1633071909016 { +import { MigrationInterface, QueryRunner } from "typeorm"; +export class userPending1633071909016 implements MigrationInterface { constructor() { this.name = "userPending1633071909016"; } - async up(queryRunner) { + async up(queryRunner: QueryRunner): Promise { 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"))`, ); @@ -10,7 +11,7 @@ export class userPending1633071909016 { `CREATE UNIQUE INDEX "IDX_4e5c4c99175638ec0761714ab0" ON "user_pending" ("code") `, ); } - async down(queryRunner) { + async down(queryRunner: QueryRunner): Promise { 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/src/migration/1634486652000-user-public-reactions.ts similarity index 54% rename from packages/backend/migration/1634486652000-user-public-reactions.js rename to packages/backend/src/migration/1634486652000-user-public-reactions.ts index 95b957f11..42401f168 100644 --- a/packages/backend/migration/1634486652000-user-public-reactions.js +++ b/packages/backend/src/migration/1634486652000-user-public-reactions.ts @@ -1,13 +1,14 @@ -export class userPublicReactions1634486652000 { +import { MigrationInterface, QueryRunner } from "typeorm"; +export class userPublicReactions1634486652000 implements MigrationInterface { constructor() { this.name = "userPublicReactions1634486652000"; } - async up(queryRunner) { + async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "user_profile" ADD "publicReactions" boolean NOT NULL DEFAULT false`, ); } - async down(queryRunner) { + async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "user_profile" DROP COLUMN "publicReactions"`, ); diff --git a/packages/backend/src/migration/1634902659689-delete-log.ts b/packages/backend/src/migration/1634902659689-delete-log.ts new file mode 100644 index 000000000..b965aca45 --- /dev/null +++ b/packages/backend/src/migration/1634902659689-delete-log.ts @@ -0,0 +1,10 @@ +import { MigrationInterface, QueryRunner } from "typeorm"; +export class deleteLog1634902659689 implements MigrationInterface { + constructor() { + this.name = "deleteLog1634902659689"; + } + async up(queryRunner: QueryRunner): Promise { + await queryRunner.query(`DROP TABLE "log"`); + } + async down(queryRunner: QueryRunner): Promise {} +} diff --git a/packages/backend/migration/1635500777168-note-thread-mute.js b/packages/backend/src/migration/1635500777168-note-thread-mute.ts similarity index 88% rename from packages/backend/migration/1635500777168-note-thread-mute.js rename to packages/backend/src/migration/1635500777168-note-thread-mute.ts index 5fcfa40c0..a08d0d26a 100644 --- a/packages/backend/migration/1635500777168-note-thread-mute.js +++ b/packages/backend/src/migration/1635500777168-note-thread-mute.ts @@ -1,8 +1,9 @@ -export class noteThreadMute1635500777168 { +import { MigrationInterface, QueryRunner } from "typeorm"; +export class noteThreadMute1635500777168 implements MigrationInterface { constructor() { this.name = "noteThreadMute1635500777168"; } - async up(queryRunner) { + async up(queryRunner: QueryRunner): Promise { 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"))`, ); @@ -25,7 +26,7 @@ export class noteThreadMute1635500777168 { `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) { + async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "note_thread_muting" DROP CONSTRAINT "FK_29c11c7deb06615076f8c95b80a"`, ); diff --git a/packages/backend/migration/1636197624383-ff-visibility.js b/packages/backend/src/migration/1636197624383-ff-visibility.ts similarity index 69% rename from packages/backend/migration/1636197624383-ff-visibility.js rename to packages/backend/src/migration/1636197624383-ff-visibility.ts index a3af8f718..539a9d8e2 100644 --- a/packages/backend/migration/1636197624383-ff-visibility.js +++ b/packages/backend/src/migration/1636197624383-ff-visibility.ts @@ -1,8 +1,9 @@ -export class ffVisibility1636197624383 { +import { MigrationInterface, QueryRunner } from "typeorm"; +export class ffVisibility1636197624383 implements MigrationInterface { constructor() { this.name = "ffVisibility1636197624383"; } - async up(queryRunner) { + async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `CREATE TYPE "public"."user_profile_ffvisibility_enum" AS ENUM('public', 'followers', 'private')`, ); @@ -10,7 +11,7 @@ export class ffVisibility1636197624383 { `ALTER TABLE "user_profile" ADD "ffVisibility" "public"."user_profile_ffvisibility_enum" NOT NULL DEFAULT 'public'`, ); } - async down(queryRunner) { + async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "user_profile" DROP COLUMN "ffVisibility"`, ); diff --git a/packages/backend/src/migration/1636697408073-remove-via-mobile.ts b/packages/backend/src/migration/1636697408073-remove-via-mobile.ts new file mode 100644 index 000000000..775fcc948 --- /dev/null +++ b/packages/backend/src/migration/1636697408073-remove-via-mobile.ts @@ -0,0 +1,14 @@ +import { MigrationInterface, QueryRunner } from "typeorm"; +export class removeViaMobile1636697408073 implements MigrationInterface { + name = "removeViaMobile1636697408073"; + + async up(queryRunner: QueryRunner): Promise { + await queryRunner.query(`ALTER TABLE "note" DROP COLUMN "viaMobile"`); + } + + async down(queryRunner: QueryRunner): Promise { + 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/src/migration/1637320813000-forwarded-report.ts similarity index 51% rename from packages/backend/migration/1637320813000-forwarded-report.js rename to packages/backend/src/migration/1637320813000-forwarded-report.ts index 18ec17206..2a2f80caa 100644 --- a/packages/backend/migration/1637320813000-forwarded-report.js +++ b/packages/backend/src/migration/1637320813000-forwarded-report.ts @@ -1,13 +1,14 @@ -export class forwardedReport1637320813000 { +import { MigrationInterface, QueryRunner } from "typeorm"; +export class forwardedReport1637320813000 implements MigrationInterface { name = "forwardedReport1637320813000"; - async up(queryRunner) { + async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "abuse_user_report" ADD "forwarded" boolean NOT NULL DEFAULT false`, ); } - async down(queryRunner) { + async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "abuse_user_report" DROP COLUMN "forwarded"`, ); diff --git a/packages/backend/migration/1639325650583-chart-v3.js b/packages/backend/src/migration/1639325650583-chart-v3.ts similarity index 99% rename from packages/backend/migration/1639325650583-chart-v3.js rename to packages/backend/src/migration/1639325650583-chart-v3.ts index 011708c0f..a2d0da765 100644 --- a/packages/backend/migration/1639325650583-chart-v3.js +++ b/packages/backend/src/migration/1639325650583-chart-v3.ts @@ -1,7 +1,8 @@ -export class chartV31639325650583 { +import { MigrationInterface, QueryRunner } from "typeorm"; +export class chartV31639325650583 implements MigrationInterface { name = "chartV31639325650583"; - async up(queryRunner) { + async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `DELETE FROM "__chart__per_user_drive" WHERE "group" IS NULL`, ); @@ -266,7 +267,7 @@ export class chartV31639325650583 { ); } - async down(queryRunner) { + async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "__chart__per_user_drive" DROP CONSTRAINT "UQ_30bf67687f483ace115c5ca6429"`, ); diff --git a/packages/backend/migration/1642611822809-emoji-url.js b/packages/backend/src/migration/1642611822809-emoji-url.ts similarity index 64% rename from packages/backend/migration/1642611822809-emoji-url.js rename to packages/backend/src/migration/1642611822809-emoji-url.ts index e1852c002..e0279b929 100644 --- a/packages/backend/migration/1642611822809-emoji-url.js +++ b/packages/backend/src/migration/1642611822809-emoji-url.ts @@ -1,7 +1,8 @@ -export class emojiUrl1642611822809 { +import { MigrationInterface, QueryRunner } from "typeorm"; +export class emojiUrl1642611822809 implements MigrationInterface { name = "emojiUrl1642611822809"; - async up(queryRunner) { + async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "emoji" RENAME COLUMN "url" TO "originalUrl"`, ); @@ -10,7 +11,7 @@ export class emojiUrl1642611822809 { ); } - async down(queryRunner) { + async down(queryRunner: QueryRunner): Promise { 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/src/migration/1642613870898-drive-file-webpublic-type.ts similarity index 50% rename from packages/backend/migration/1642613870898-drive-file-webpublic-type.js rename to packages/backend/src/migration/1642613870898-drive-file-webpublic-type.ts index df5ab7899..feaa35448 100644 --- a/packages/backend/migration/1642613870898-drive-file-webpublic-type.js +++ b/packages/backend/src/migration/1642613870898-drive-file-webpublic-type.ts @@ -1,13 +1,14 @@ -export class driveFileWebpublicType1642613870898 { +import { MigrationInterface, QueryRunner } from "typeorm"; +export class driveFileWebpublicType1642613870898 implements MigrationInterface { name = "driveFileWebpublicType1642613870898"; - async up(queryRunner) { + async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "drive_file" ADD "webpublicType" character varying(128)`, ); } - async down(queryRunner) { + async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "drive_file" DROP COLUMN "webpublicType"`, ); diff --git a/packages/backend/migration/1643963705770-chart-v4.js b/packages/backend/src/migration/1643963705770-chart-v4.ts similarity index 96% rename from packages/backend/migration/1643963705770-chart-v4.js rename to packages/backend/src/migration/1643963705770-chart-v4.ts index 1e7233cc7..59f1441e8 100644 --- a/packages/backend/migration/1643963705770-chart-v4.js +++ b/packages/backend/src/migration/1643963705770-chart-v4.ts @@ -1,7 +1,8 @@ -export class chartV41643963705770 { +import { MigrationInterface, QueryRunner } from "typeorm"; +export class chartV41643963705770 implements MigrationInterface { name = "chartV41643963705770"; - async up(queryRunner) { + async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "__chart__instance" DROP COLUMN "___drive_totalUsage"`, ); @@ -82,7 +83,7 @@ export class chartV41643963705770 { ); } - async down(queryRunner) { + async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "__chart_day__hashtag" DROP COLUMN "___remote_users"`, ); diff --git a/packages/backend/migration/1643966656277-chart-v5.js b/packages/backend/src/migration/1643966656277-chart-v5.ts similarity index 90% rename from packages/backend/migration/1643966656277-chart-v5.js rename to packages/backend/src/migration/1643966656277-chart-v5.ts index 826f28ee3..28647fa38 100644 --- a/packages/backend/migration/1643966656277-chart-v5.js +++ b/packages/backend/src/migration/1643966656277-chart-v5.ts @@ -1,7 +1,8 @@ -export class chartV51643966656277 { +import { MigrationInterface, QueryRunner } from "typeorm"; +export class chartV51643966656277 implements MigrationInterface { name = "chartV51643966656277"; - async up(queryRunner) { + async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "__chart__active_users" ADD "unique_temp___local_users" character varying array NOT NULL DEFAULT '{}'`, ); @@ -28,7 +29,7 @@ export class chartV51643966656277 { ); } - async down(queryRunner) { + async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "__chart_day__hashtag" DROP COLUMN "unique_temp___remote_users"`, ); diff --git a/packages/backend/migration/1643967331284-chart-v6.js b/packages/backend/src/migration/1643967331284-chart-v6.ts similarity index 99% rename from packages/backend/migration/1643967331284-chart-v6.js rename to packages/backend/src/migration/1643967331284-chart-v6.ts index 9dfbf24be..6945ebbfa 100644 --- a/packages/backend/migration/1643967331284-chart-v6.js +++ b/packages/backend/src/migration/1643967331284-chart-v6.ts @@ -1,7 +1,8 @@ -export class chartV61643967331284 { +import { MigrationInterface, QueryRunner } from "typeorm"; +export class chartV61643967331284 implements MigrationInterface { name = "chartV61643967331284"; - async up(queryRunner) { + async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "__chart__federation" ALTER COLUMN "___instance_total" SET DEFAULT '0'`, ); @@ -502,7 +503,7 @@ export class chartV61643967331284 { ); } - async down(queryRunner) { + async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "__chart_day__per_user_drive" ALTER COLUMN "___decSize" DROP DEFAULT`, ); diff --git a/packages/backend/migration/1644010796173-convert-hard-mutes.js b/packages/backend/src/migration/1644010796173-convert-hard-mutes.ts similarity index 87% rename from packages/backend/migration/1644010796173-convert-hard-mutes.js rename to packages/backend/src/migration/1644010796173-convert-hard-mutes.ts index 39c5b080f..0ddd2bdf3 100644 --- a/packages/backend/migration/1644010796173-convert-hard-mutes.js +++ b/packages/backend/src/migration/1644010796173-convert-hard-mutes.ts @@ -1,9 +1,10 @@ +import { MigrationInterface, QueryRunner } from "typeorm"; import RE2 from "re2"; -export class convertHardMutes1644010796173 { +export class convertHardMutes1644010796173 implements MigrationInterface { name = "convertHardMutes1644010796173"; - async up(queryRunner) { + async up(queryRunner: QueryRunner): Promise { let entries = await queryRunner.query( `SELECT "userId", "mutedWords" FROM "user_profile" WHERE "userHost" IS NULL`, ); @@ -40,7 +41,7 @@ export class convertHardMutes1644010796173 { } } - async down(queryRunner) { + async down(queryRunner: QueryRunner): Promise { let entries = await queryRunner.query( `SELECT "userId", "mutedWords" FROM "user_profile"`, ); diff --git a/packages/backend/migration/1644058404077-chart-v7.js b/packages/backend/src/migration/1644058404077-chart-v7.ts similarity index 99% rename from packages/backend/migration/1644058404077-chart-v7.js rename to packages/backend/src/migration/1644058404077-chart-v7.ts index ab48c9ab3..420f38b2b 100644 --- a/packages/backend/migration/1644058404077-chart-v7.js +++ b/packages/backend/src/migration/1644058404077-chart-v7.ts @@ -1,7 +1,8 @@ -export class chartV71644058404077 { +import { MigrationInterface, QueryRunner } from "typeorm"; +export class chartV71644058404077 implements MigrationInterface { name = "chartV71644058404077"; - async up(queryRunner) { + async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `UPDATE "__chart__federation" SET "___instance_total"=2147483647 WHERE "___instance_total" > 2147483647`, ); @@ -967,7 +968,7 @@ export class chartV71644058404077 { ); } - async down(queryRunner) { + async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "__chart__federation" ALTER COLUMN "___instance_total" TYPE bigint USING "___instance_total"::bigint`, ); diff --git a/packages/backend/migration/1644059847460-chart-v8.js b/packages/backend/src/migration/1644059847460-chart-v8.ts similarity index 88% rename from packages/backend/migration/1644059847460-chart-v8.js rename to packages/backend/src/migration/1644059847460-chart-v8.ts index f9357c8ca..5e9d18591 100644 --- a/packages/backend/migration/1644059847460-chart-v8.js +++ b/packages/backend/src/migration/1644059847460-chart-v8.ts @@ -1,7 +1,8 @@ -export class chartV81644059847460 { +import { MigrationInterface, QueryRunner } from "typeorm"; +export class chartV81644059847460 implements MigrationInterface { name = "chartV81644059847460"; - async up(queryRunner) { + async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `UPDATE "__chart__active_users" SET "___local_users"=2147483647 WHERE "___local_users" > 2147483647`, ); @@ -29,7 +30,7 @@ export class chartV81644059847460 { ); } - async down(queryRunner) { + async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "__chart__active_users" ALTER COLUMN "___local_users" TYPE bigint USING "___local_users"::bigint`, ); diff --git a/packages/backend/migration/1644060125705-chart-v9.js b/packages/backend/src/migration/1644060125705-chart-v9.ts similarity index 88% rename from packages/backend/migration/1644060125705-chart-v9.js rename to packages/backend/src/migration/1644060125705-chart-v9.ts index 7d7934e31..b8bc3d438 100644 --- a/packages/backend/migration/1644060125705-chart-v9.js +++ b/packages/backend/src/migration/1644060125705-chart-v9.ts @@ -1,7 +1,8 @@ -export class chartV91644060125705 { +import { MigrationInterface, QueryRunner } from "typeorm"; +export class chartV91644060125705 implements MigrationInterface { name = "chartV91644060125705"; - async up(queryRunner) { + async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `UPDATE "__chart__hashtag" SET "___local_users"=2147483647 WHERE "___local_users" > 2147483647`, ); @@ -29,7 +30,7 @@ export class chartV91644060125705 { ); } - async down(queryRunner) { + async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "__chart__hashtag" ALTER COLUMN "___local_users" TYPE bigint USING "___local_users"::bigint`, ); diff --git a/packages/backend/migration/1644073149413-chart-v10.js b/packages/backend/src/migration/1644073149413-chart-v10.ts similarity index 93% rename from packages/backend/migration/1644073149413-chart-v10.js rename to packages/backend/src/migration/1644073149413-chart-v10.ts index 8038dad15..9bd0a1012 100644 --- a/packages/backend/migration/1644073149413-chart-v10.js +++ b/packages/backend/src/migration/1644073149413-chart-v10.ts @@ -1,7 +1,8 @@ -export class chartV101644073149413 { +import { MigrationInterface, QueryRunner } from "typeorm"; +export class chartV101644073149413 implements MigrationInterface { name = "chartV101644073149413"; - async up(queryRunner) { + async up(queryRunner: QueryRunner): Promise { 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"))`, ); @@ -40,7 +41,7 @@ export class chartV101644073149413 { ); } - async down(queryRunner) { + async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "__chart_day__federation" DROP COLUMN "___inboxInstances"`, ); diff --git a/packages/backend/migration/1644095659741-chart-v11.js b/packages/backend/src/migration/1644095659741-chart-v11.ts similarity index 97% rename from packages/backend/migration/1644095659741-chart-v11.js rename to packages/backend/src/migration/1644095659741-chart-v11.ts index 8db122d4f..1e7b560e4 100644 --- a/packages/backend/migration/1644095659741-chart-v11.js +++ b/packages/backend/src/migration/1644095659741-chart-v11.ts @@ -1,7 +1,8 @@ -export class chartV111644095659741 { +import { MigrationInterface, QueryRunner } from "typeorm"; +export class chartV111644095659741 implements MigrationInterface { name = "chartV111644095659741"; - async up(queryRunner) { + async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "__chart__active_users" DROP COLUMN "___local_users"`, ); @@ -124,7 +125,7 @@ export class chartV111644095659741 { ); } - async down(queryRunner) { + async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "__chart_day__active_users" DROP COLUMN "___registeredOutsideYear"`, ); diff --git a/packages/backend/migration/1644328606241-chart-v12.js b/packages/backend/src/migration/1644328606241-chart-v12.ts similarity index 89% rename from packages/backend/migration/1644328606241-chart-v12.js rename to packages/backend/src/migration/1644328606241-chart-v12.ts index ea363e12f..d3d643920 100644 --- a/packages/backend/migration/1644328606241-chart-v12.js +++ b/packages/backend/src/migration/1644328606241-chart-v12.ts @@ -1,7 +1,8 @@ -export class chartV121644328606241 { +import { MigrationInterface, QueryRunner } from "typeorm"; +export class chartV121644328606241 implements MigrationInterface { name = "chartV121644328606241"; - async up(queryRunner) { + async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "__chart__notes" ADD "___local_diffs_withFile" integer NOT NULL DEFAULT '0'`, ); @@ -28,7 +29,7 @@ export class chartV121644328606241 { ); } - async down(queryRunner) { + async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "__chart_day__per_user_notes" DROP COLUMN "___diffs_withFile"`, ); diff --git a/packages/backend/migration/1644331238153-chart-v13.js b/packages/backend/src/migration/1644331238153-chart-v13.ts similarity index 81% rename from packages/backend/migration/1644331238153-chart-v13.js rename to packages/backend/src/migration/1644331238153-chart-v13.ts index cbb1830f5..bbcab6962 100644 --- a/packages/backend/migration/1644331238153-chart-v13.js +++ b/packages/backend/src/migration/1644331238153-chart-v13.ts @@ -1,7 +1,8 @@ -export class chartV131644331238153 { +import { MigrationInterface, QueryRunner } from "typeorm"; +export class chartV131644331238153 implements MigrationInterface { name = "chartV131644331238153"; - async up(queryRunner) { + async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "__chart__federation" ADD "unique_temp___stalled" character varying array NOT NULL DEFAULT '{}'`, ); @@ -16,7 +17,7 @@ export class chartV131644331238153 { ); } - async down(queryRunner) { + async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "__chart_day__federation" DROP COLUMN "___stalled"`, ); diff --git a/packages/backend/migration/1644344266289-chart-v14.js b/packages/backend/src/migration/1644344266289-chart-v14.ts similarity index 94% rename from packages/backend/migration/1644344266289-chart-v14.js rename to packages/backend/src/migration/1644344266289-chart-v14.ts index 6e6c03083..8bbc190d7 100644 --- a/packages/backend/migration/1644344266289-chart-v14.js +++ b/packages/backend/src/migration/1644344266289-chart-v14.ts @@ -1,7 +1,8 @@ -export class chartV141644344266289 { +import { MigrationInterface, QueryRunner } from "typeorm"; +export class chartV141644344266289 implements MigrationInterface { name = "chartV141644344266289"; - async up(queryRunner) { + async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "__chart__active_users" DROP COLUMN "unique_temp___users"`, ); @@ -58,7 +59,7 @@ export class chartV141644344266289 { ); } - async down(queryRunner) { + async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "__chart_day__active_users" DROP COLUMN "___write"`, ); diff --git a/packages/backend/src/migration/1644395759931-instance-theme-color.ts b/packages/backend/src/migration/1644395759931-instance-theme-color.ts new file mode 100644 index 000000000..9b27263c6 --- /dev/null +++ b/packages/backend/src/migration/1644395759931-instance-theme-color.ts @@ -0,0 +1,14 @@ +import { MigrationInterface, QueryRunner } from "typeorm"; +export class instanceThemeColor1644395759931 implements MigrationInterface { + name = "instanceThemeColor1644395759931"; + + async up(queryRunner: QueryRunner): Promise { + await queryRunner.query( + `ALTER TABLE "meta" ADD "themeColor" character varying(512)`, + ); + } + + async down(queryRunner: QueryRunner): Promise { + await queryRunner.query(`ALTER TABLE "meta" DROP COLUMN "themeColor"`); + } +} diff --git a/packages/backend/migration/1644481657998-chart-v15.js b/packages/backend/src/migration/1644481657998-chart-v15.ts similarity index 90% rename from packages/backend/migration/1644481657998-chart-v15.js rename to packages/backend/src/migration/1644481657998-chart-v15.ts index a8e1b89cb..6cfd3c3db 100644 --- a/packages/backend/migration/1644481657998-chart-v15.js +++ b/packages/backend/src/migration/1644481657998-chart-v15.ts @@ -1,7 +1,8 @@ -export class chartV151644481657998 { +import { MigrationInterface, QueryRunner } from "typeorm"; +export class chartV151644481657998 implements MigrationInterface { name = "chartV151644481657998"; - async up(queryRunner) { + async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "__chart__federation" DROP COLUMN "___instance_total"`, ); @@ -34,7 +35,7 @@ export class chartV151644481657998 { ); } - async down(queryRunner) { + async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "__chart_day__federation" DROP COLUMN "___pub"`, ); diff --git a/packages/backend/migration/1644551208096-following-indexes.js b/packages/backend/src/migration/1644551208096-following-indexes.ts similarity index 65% rename from packages/backend/migration/1644551208096-following-indexes.js rename to packages/backend/src/migration/1644551208096-following-indexes.ts index b06f764e5..756686080 100644 --- a/packages/backend/migration/1644551208096-following-indexes.js +++ b/packages/backend/src/migration/1644551208096-following-indexes.ts @@ -1,7 +1,8 @@ -export class followingIndexes1644551208096 { +import { MigrationInterface, QueryRunner } from "typeorm"; +export class followingIndexes1644551208096 implements MigrationInterface { name = "followingIndexes1644551208096"; - async up(queryRunner) { + async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `CREATE INDEX "IDX_4ccd2239268ebbd1b35e318754" ON "following" ("followerHost") `, ); @@ -10,7 +11,7 @@ export class followingIndexes1644551208096 { ); } - async down(queryRunner) { + async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `DROP INDEX "public"."IDX_fcdafee716dfe9c3b5fde90f30"`, ); diff --git a/packages/backend/migration/1645340161439-remove-max-note-text-length.js b/packages/backend/src/migration/1645340161439-remove-max-note-text-length.ts similarity index 50% rename from packages/backend/migration/1645340161439-remove-max-note-text-length.js rename to packages/backend/src/migration/1645340161439-remove-max-note-text-length.ts index d17ef8c12..9c7f9df3e 100644 --- a/packages/backend/migration/1645340161439-remove-max-note-text-length.js +++ b/packages/backend/src/migration/1645340161439-remove-max-note-text-length.ts @@ -1,13 +1,14 @@ -export class removeMaxNoteTextLength1645340161439 { +import { MigrationInterface, QueryRunner } from "typeorm"; +export class removeMaxNoteTextLength1645340161439 implements MigrationInterface { name = "removeMaxNoteTextLength1645340161439"; - async up(queryRunner) { + async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "meta" DROP COLUMN "maxNoteTextLength"`, ); } - async down(queryRunner) { + async down(queryRunner: QueryRunner): Promise { 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/src/migration/1645599900873-federation-chart-pubsub.ts similarity index 66% rename from packages/backend/migration/1645599900873-federation-chart-pubsub.js rename to packages/backend/src/migration/1645599900873-federation-chart-pubsub.ts index 58e2b4c00..9a31c4fdc 100644 --- a/packages/backend/migration/1645599900873-federation-chart-pubsub.js +++ b/packages/backend/src/migration/1645599900873-federation-chart-pubsub.ts @@ -1,7 +1,8 @@ -export class federationChartPubsub1645599900873 { +import { MigrationInterface, QueryRunner } from "typeorm"; +export class federationChartPubsub1645599900873 implements MigrationInterface { name = "federationChartPubsub1645599900873"; - async up(queryRunner) { + async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "__chart__federation" ADD "___pubsub" smallint NOT NULL DEFAULT '0'`, ); @@ -10,7 +11,7 @@ export class federationChartPubsub1645599900873 { ); } - async down(queryRunner) { + async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "__chart_day__federation" DROP COLUMN "___pubsub"`, ); diff --git a/packages/backend/migration/1646143552768-instance-default-theme.js b/packages/backend/src/migration/1646143552768-instance-default-theme.ts similarity index 64% rename from packages/backend/migration/1646143552768-instance-default-theme.js rename to packages/backend/src/migration/1646143552768-instance-default-theme.ts index d97efcaa6..89a002e54 100644 --- a/packages/backend/migration/1646143552768-instance-default-theme.js +++ b/packages/backend/src/migration/1646143552768-instance-default-theme.ts @@ -1,7 +1,8 @@ -export class instanceDefaultTheme1646143552768 { +import { MigrationInterface, QueryRunner } from "typeorm"; +export class instanceDefaultTheme1646143552768 implements MigrationInterface { name = "instanceDefaultTheme1646143552768"; - async up(queryRunner) { + async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "meta" ADD "defaultLightTheme" character varying(8192)`, ); @@ -10,7 +11,7 @@ export class instanceDefaultTheme1646143552768 { ); } - async down(queryRunner) { + async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "meta" DROP COLUMN "defaultDarkTheme"`, ); diff --git a/packages/backend/migration/1646387162108-mute-expires-at.js b/packages/backend/src/migration/1646387162108-mute-expires-at.ts similarity index 64% rename from packages/backend/migration/1646387162108-mute-expires-at.js rename to packages/backend/src/migration/1646387162108-mute-expires-at.ts index 52fe101bd..c1cda2ed0 100644 --- a/packages/backend/migration/1646387162108-mute-expires-at.js +++ b/packages/backend/src/migration/1646387162108-mute-expires-at.ts @@ -1,7 +1,8 @@ -export class muteExpiresAt1646387162108 { +import { MigrationInterface, QueryRunner } from "typeorm"; +export class muteExpiresAt1646387162108 implements MigrationInterface { name = "muteExpiresAt1646387162108"; - async up(queryRunner) { + async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "muting" ADD "expiresAt" TIMESTAMP WITH TIME ZONE`, ); @@ -10,7 +11,7 @@ export class muteExpiresAt1646387162108 { ); } - async down(queryRunner) { + async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `DROP INDEX "public"."IDX_c1fd1c3dfb0627aa36c253fd14"`, ); diff --git a/packages/backend/migration/1646549089451-poll-ended-notification.js b/packages/backend/src/migration/1646549089451-poll-ended-notification.ts similarity index 84% rename from packages/backend/migration/1646549089451-poll-ended-notification.js rename to packages/backend/src/migration/1646549089451-poll-ended-notification.ts index cc96a62a7..1ef2f587b 100644 --- a/packages/backend/migration/1646549089451-poll-ended-notification.js +++ b/packages/backend/src/migration/1646549089451-poll-ended-notification.ts @@ -1,7 +1,8 @@ -export class pollEndedNotification1646549089451 { +import { MigrationInterface, QueryRunner } from "typeorm"; +export class pollEndedNotification1646549089451 implements MigrationInterface { name = "pollEndedNotification1646549089451"; - async up(queryRunner) { + async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TYPE "public"."notification_type_enum" RENAME TO "notification_type_enum_old"`, ); @@ -14,7 +15,7 @@ export class pollEndedNotification1646549089451 { await queryRunner.query(`DROP TYPE "public"."notification_type_enum_old"`); } - async down(queryRunner) { + async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `CREATE TYPE "public"."notification_type_enum_old" AS ENUM('follow', 'mention', 'reply', 'renote', 'quote', 'reaction', 'pollVote', 'receiveFollowRequest', 'followRequestAccepted', 'groupInvited', 'app')`, ); diff --git a/packages/backend/migration/1646633030285-chart-federation-active.js b/packages/backend/src/migration/1646633030285-chart-federation-active.ts similarity index 66% rename from packages/backend/migration/1646633030285-chart-federation-active.js rename to packages/backend/src/migration/1646633030285-chart-federation-active.ts index 3cb2dffe3..64ea0d694 100644 --- a/packages/backend/migration/1646633030285-chart-federation-active.js +++ b/packages/backend/src/migration/1646633030285-chart-federation-active.ts @@ -1,7 +1,8 @@ -export class chartFederationActive1646633030285 { +import { MigrationInterface, QueryRunner } from "typeorm"; +export class chartFederationActive1646633030285 implements MigrationInterface { name = "chartFederationActive1646633030285"; - async up(queryRunner) { + async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "__chart__federation" ADD "___active" smallint NOT NULL DEFAULT '0'`, ); @@ -10,7 +11,7 @@ export class chartFederationActive1646633030285 { ); } - async down(queryRunner) { + async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "__chart_day__federation" DROP COLUMN "___active"`, ); diff --git a/packages/backend/migration/1646655454495-remove-instance-drive-columns.js b/packages/backend/src/migration/1646655454495-remove-instance-drive-columns.ts similarity index 63% rename from packages/backend/migration/1646655454495-remove-instance-drive-columns.js rename to packages/backend/src/migration/1646655454495-remove-instance-drive-columns.ts index 12f56bc2d..e6976a639 100644 --- a/packages/backend/migration/1646655454495-remove-instance-drive-columns.js +++ b/packages/backend/src/migration/1646655454495-remove-instance-drive-columns.ts @@ -1,12 +1,13 @@ -export class removeInstanceDriveColumns1646655454495 { +import { MigrationInterface, QueryRunner } from "typeorm"; +export class removeInstanceDriveColumns1646655454495 implements MigrationInterface { name = "removeInstanceDriveColumns1646655454495"; - async up(queryRunner) { + async up(queryRunner: QueryRunner): Promise { await queryRunner.query(`ALTER TABLE "instance" DROP COLUMN "driveUsage"`); await queryRunner.query(`ALTER TABLE "instance" DROP COLUMN "driveFiles"`); } - async down(queryRunner) { + async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "instance" ADD "driveFiles" integer NOT NULL DEFAULT '0'`, ); diff --git a/packages/backend/migration/1646732390560-chart-federation-active-sub-pub.js b/packages/backend/src/migration/1646732390560-chart-federation-active-sub-pub.ts similarity index 84% rename from packages/backend/migration/1646732390560-chart-federation-active-sub-pub.js rename to packages/backend/src/migration/1646732390560-chart-federation-active-sub-pub.ts index e34b9a22e..253da27a3 100644 --- a/packages/backend/migration/1646732390560-chart-federation-active-sub-pub.js +++ b/packages/backend/src/migration/1646732390560-chart-federation-active-sub-pub.ts @@ -1,7 +1,8 @@ -export class chartFederationActiveSubPub1646732390560 { +import { MigrationInterface, QueryRunner } from "typeorm"; +export class chartFederationActiveSubPub1646732390560 implements MigrationInterface { name = "chartFederationActiveSubPub1646732390560"; - async up(queryRunner) { + async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "__chart__federation" DROP COLUMN "___active"`, ); @@ -22,7 +23,7 @@ export class chartFederationActiveSubPub1646732390560 { ); } - async down(queryRunner) { + async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "__chart_day__federation" DROP COLUMN "___pubActive"`, ); diff --git a/packages/backend/migration/1648548247382-webhook.js b/packages/backend/src/migration/1648548247382-webhook.ts similarity index 87% rename from packages/backend/migration/1648548247382-webhook.js rename to packages/backend/src/migration/1648548247382-webhook.ts index 3e7160e2b..1a5b9c7bd 100644 --- a/packages/backend/migration/1648548247382-webhook.js +++ b/packages/backend/src/migration/1648548247382-webhook.ts @@ -1,7 +1,8 @@ -export class webhook1648548247382 { +import { MigrationInterface, QueryRunner } from "typeorm"; +export class webhook1648548247382 implements MigrationInterface { name = "webhook1648548247382"; - async up(queryRunner) { + async up(queryRunner: QueryRunner): Promise { 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.'`, ); @@ -19,7 +20,7 @@ export class webhook1648548247382 { ); } - async down(queryRunner) { + async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "webhook" DROP CONSTRAINT "FK_f272c8c8805969e6a6449c77b3c"`, ); diff --git a/packages/backend/migration/1648816172177-webhook-2.js b/packages/backend/src/migration/1648816172177-webhook-2.ts similarity index 62% rename from packages/backend/migration/1648816172177-webhook-2.js rename to packages/backend/src/migration/1648816172177-webhook-2.ts index a4ab4ef8f..3cff6fb7c 100644 --- a/packages/backend/migration/1648816172177-webhook-2.js +++ b/packages/backend/src/migration/1648816172177-webhook-2.ts @@ -1,14 +1,15 @@ -export class webhook21648816172177 { +import { MigrationInterface, QueryRunner } from "typeorm"; +export class webhook21648816172177 implements MigrationInterface { name = "webhook21648816172177"; - async up(queryRunner) { + async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "webhook" ADD "latestSentAt" TIMESTAMP WITH TIME ZONE`, ); await queryRunner.query(`ALTER TABLE "webhook" ADD "latestStatus" integer`); } - async down(queryRunner) { + async down(queryRunner: QueryRunner): Promise { 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/src/migration/1651224615271-foreign-key.ts similarity index 96% rename from packages/backend/migration/1651224615271-foreign-key.js rename to packages/backend/src/migration/1651224615271-foreign-key.ts index 7e6bc7962..6bcef0606 100644 --- a/packages/backend/migration/1651224615271-foreign-key.js +++ b/packages/backend/src/migration/1651224615271-foreign-key.ts @@ -1,7 +1,8 @@ -export class foreignKeyReports1651224615271 { +import { MigrationInterface, QueryRunner } from "typeorm"; +export class foreignKeyReports1651224615271 implements MigrationInterface { name = "foreignKeyReports1651224615271"; - async up(queryRunner) { + async up(queryRunner: QueryRunner): Promise { await Promise.all([ queryRunner.query( `ALTER INDEX "public"."IDX_seoignmeoprigmkpodgrjmkpormg" RENAME TO "IDX_c8cc87bd0f2f4487d17c651fbf"`, @@ -104,7 +105,7 @@ export class foreignKeyReports1651224615271 { ]); } - async down(queryRunner) { + async down(queryRunner: QueryRunner): Promise { await Promise.all([ // There is no ALTER TYPE REMOVE VALUE query, so the reverse operation is a bit more complex queryRunner diff --git a/packages/backend/migration/1652859567549-uniform-themecolor.js b/packages/backend/src/migration/1652859567549-uniform-themecolor.ts similarity index 83% rename from packages/backend/migration/1652859567549-uniform-themecolor.js rename to packages/backend/src/migration/1652859567549-uniform-themecolor.ts index 8c91854d5..d885421f2 100644 --- a/packages/backend/migration/1652859567549-uniform-themecolor.js +++ b/packages/backend/src/migration/1652859567549-uniform-themecolor.ts @@ -1,9 +1,10 @@ +import { MigrationInterface, QueryRunner } from "typeorm"; import tinycolor from "tinycolor2"; -export class uniformThemecolor1652859567549 { +export class uniformThemecolor1652859567549 implements MigrationInterface { name = "uniformThemecolor1652859567549"; - async up(queryRunner) { + async up(queryRunner: QueryRunner): Promise { const formatColor = (color) => { let tc = new tinycolor(color); if (tc.isValid()) { @@ -44,7 +45,7 @@ export class uniformThemecolor1652859567549 { }); } - async down(queryRunner) { + async down(queryRunner: QueryRunner): Promise { // 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/src/migration/1655368940105-nsfw-detection.ts similarity index 87% rename from packages/backend/migration/1655368940105-nsfw-detection.js rename to packages/backend/src/migration/1655368940105-nsfw-detection.ts index f1bcda50e..59e9d0ffd 100644 --- a/packages/backend/migration/1655368940105-nsfw-detection.js +++ b/packages/backend/src/migration/1655368940105-nsfw-detection.ts @@ -1,7 +1,8 @@ -export class nsfwDetection1655368940105 { +import { MigrationInterface, QueryRunner } from "typeorm"; +export class nsfwDetection1655368940105 implements MigrationInterface { name = "nsfwDetection1655368940105"; - async up(queryRunner) { + async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "drive_file" ADD "forceIsSensitive" boolean NOT NULL DEFAULT false`, ); @@ -25,7 +26,7 @@ export class nsfwDetection1655368940105 { ); } - async down(queryRunner) { + async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `DROP INDEX "public"."IDX_fc2d74a6d7d8b11292a851d8f8"`, ); diff --git a/packages/backend/migration/1655371960534-nsfw-detection-2.js b/packages/backend/src/migration/1655371960534-nsfw-detection-2.ts similarity index 77% rename from packages/backend/migration/1655371960534-nsfw-detection-2.js rename to packages/backend/src/migration/1655371960534-nsfw-detection-2.ts index 236cd7091..19de858cd 100644 --- a/packages/backend/migration/1655371960534-nsfw-detection-2.js +++ b/packages/backend/src/migration/1655371960534-nsfw-detection-2.ts @@ -1,7 +1,8 @@ -export class nsfwDetection21655371960534 { +import { MigrationInterface, QueryRunner } from "typeorm"; +export class nsfwDetection21655371960534 implements MigrationInterface { name = "nsfwDetection21655371960534"; - async up(queryRunner) { + async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `CREATE TYPE "public"."meta_sensitiveimagedetectionsensitivity_enum" AS ENUM('medium', 'low', 'high')`, ); @@ -13,7 +14,7 @@ export class nsfwDetection21655371960534 { ); } - async down(queryRunner) { + async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "meta" DROP COLUMN "disallowUploadWhenPredictedAsPorn"`, ); diff --git a/packages/backend/migration/1655388169582-nsfw-detection-3.js b/packages/backend/src/migration/1655388169582-nsfw-detection-3.ts similarity index 89% rename from packages/backend/migration/1655388169582-nsfw-detection-3.js rename to packages/backend/src/migration/1655388169582-nsfw-detection-3.ts index 6a6ceeafb..b1730f55f 100644 --- a/packages/backend/migration/1655388169582-nsfw-detection-3.js +++ b/packages/backend/src/migration/1655388169582-nsfw-detection-3.ts @@ -1,7 +1,8 @@ -export class nsfwDetection31655388169582 { +import { MigrationInterface, QueryRunner } from "typeorm"; +export class nsfwDetection31655388169582 implements MigrationInterface { name = "nsfwDetection31655388169582"; - async up(queryRunner) { + async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TYPE "public"."meta_sensitiveimagedetectionsensitivity_enum" RENAME TO "meta_sensitiveimagedetectionsensitivity_enum_old"`, ); @@ -22,7 +23,7 @@ export class nsfwDetection31655388169582 { ); } - async down(queryRunner) { + async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `CREATE TYPE "public"."meta_sensitiveimagedetectionsensitivity_enum_old" AS ENUM('medium', 'low', 'high')`, ); diff --git a/packages/backend/migration/1655393015659-nsfw-detection-4.js b/packages/backend/src/migration/1655393015659-nsfw-detection-4.ts similarity index 89% rename from packages/backend/migration/1655393015659-nsfw-detection-4.js rename to packages/backend/src/migration/1655393015659-nsfw-detection-4.ts index 3e4589732..0adb11e1e 100644 --- a/packages/backend/migration/1655393015659-nsfw-detection-4.js +++ b/packages/backend/src/migration/1655393015659-nsfw-detection-4.ts @@ -1,7 +1,8 @@ -export class nsfwDetection41655393015659 { +import { MigrationInterface, QueryRunner } from "typeorm"; +export class nsfwDetection41655393015659 implements MigrationInterface { name = "nsfwDetection41655393015659"; - async up(queryRunner) { + async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "meta" DROP COLUMN "sensitiveImageDetection"`, ); @@ -28,7 +29,7 @@ export class nsfwDetection41655393015659 { ); } - async down(queryRunner) { + async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "meta" DROP COLUMN "sensitiveMediaDetectionSensitivity"`, ); diff --git a/packages/backend/migration/1655813815729-driveCapacityOverrideMb.js b/packages/backend/src/migration/1655813815729-driveCapacityOverrideMb.ts similarity index 67% rename from packages/backend/migration/1655813815729-driveCapacityOverrideMb.js rename to packages/backend/src/migration/1655813815729-driveCapacityOverrideMb.ts index e43f0af5c..e55939f31 100644 --- a/packages/backend/migration/1655813815729-driveCapacityOverrideMb.js +++ b/packages/backend/src/migration/1655813815729-driveCapacityOverrideMb.ts @@ -1,7 +1,8 @@ -export class driveCapacityOverrideMb1655813815729 { +import { MigrationInterface, QueryRunner } from "typeorm"; +export class driveCapacityOverrideMb1655813815729 implements MigrationInterface { name = "driveCapacityOverrideMb1655813815729"; - async up(queryRunner) { + async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "user" ADD "driveCapacityOverrideMb" integer`, ); @@ -10,7 +11,7 @@ export class driveCapacityOverrideMb1655813815729 { ); } - async down(queryRunner) { + async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `COMMENT ON COLUMN "user"."driveCapacityOverrideMb" IS 'Overrides user drive capacity limit'`, ); diff --git a/packages/backend/migration/1655918165614-user-ip.js b/packages/backend/src/migration/1655918165614-user-ip.ts similarity index 82% rename from packages/backend/migration/1655918165614-user-ip.js rename to packages/backend/src/migration/1655918165614-user-ip.ts index 2c5dc1c82..c4d77e81b 100644 --- a/packages/backend/migration/1655918165614-user-ip.js +++ b/packages/backend/src/migration/1655918165614-user-ip.ts @@ -1,7 +1,8 @@ -export class userIp1655918165614 { +import { MigrationInterface, QueryRunner } from "typeorm"; +export class userIp1655918165614 implements MigrationInterface { name = "userIp1655918165614"; - async up(queryRunner) { + async up(queryRunner: QueryRunner): Promise { 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"))`, ); @@ -16,7 +17,7 @@ export class userIp1655918165614 { ); } - async down(queryRunner) { + async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "user_ip" DROP CONSTRAINT "FK_7f7f1c66f48e9a8e18a33bc5150"`, ); diff --git a/packages/backend/migration/1656122560740-file-ip.js b/packages/backend/src/migration/1656122560740-file-ip.ts similarity index 64% rename from packages/backend/migration/1656122560740-file-ip.js rename to packages/backend/src/migration/1656122560740-file-ip.ts index 534097adb..fa69d8abb 100644 --- a/packages/backend/migration/1656122560740-file-ip.js +++ b/packages/backend/src/migration/1656122560740-file-ip.ts @@ -1,7 +1,8 @@ -export class fileIp1656122560740 { +import { MigrationInterface, QueryRunner } from "typeorm"; +export class fileIp1656122560740 implements MigrationInterface { name = "fileIp1656122560740"; - async up(queryRunner) { + async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "drive_file" ADD "requestHeaders" jsonb DEFAULT '{}'`, ); @@ -10,7 +11,7 @@ export class fileIp1656122560740 { ); } - async down(queryRunner) { + async down(queryRunner: QueryRunner): Promise { 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/src/migration/1656251734807-nsfw-detection-5.ts similarity index 91% rename from packages/backend/migration/1656251734807-nsfw-detection-5.js rename to packages/backend/src/migration/1656251734807-nsfw-detection-5.ts index 7a2206e01..1d69cb592 100644 --- a/packages/backend/migration/1656251734807-nsfw-detection-5.js +++ b/packages/backend/src/migration/1656251734807-nsfw-detection-5.ts @@ -1,7 +1,8 @@ -export class nsfwDetection51656251734807 { +import { MigrationInterface, QueryRunner } from "typeorm"; +export class nsfwDetection51656251734807 implements MigrationInterface { name = "nsfwDetection51656251734807"; - async up(queryRunner) { + async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `DROP INDEX "public"."IDX_fc2d74a6d7d8b11292a851d8f8"`, ); @@ -40,7 +41,7 @@ export class nsfwDetection51656251734807 { ); } - async down(queryRunner) { + async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `DROP INDEX "public"."IDX_8bdcd3dd2bddb78014999a16ce"`, ); diff --git a/packages/backend/migration/1656328812281-ip-2.js b/packages/backend/src/migration/1656328812281-ip-2.ts similarity index 69% rename from packages/backend/migration/1656328812281-ip-2.js rename to packages/backend/src/migration/1656328812281-ip-2.ts index ab4096e9c..75d4f5755 100644 --- a/packages/backend/migration/1656328812281-ip-2.js +++ b/packages/backend/src/migration/1656328812281-ip-2.ts @@ -1,7 +1,8 @@ -export class ip21656328812281 { +import { MigrationInterface, QueryRunner } from "typeorm"; +export class ip21656328812281 implements MigrationInterface { name = "ip21656328812281"; - async up(queryRunner) { + async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "user_ip" DROP CONSTRAINT "FK_7f7f1c66f48e9a8e18a33bc5150"`, ); @@ -10,7 +11,7 @@ export class ip21656328812281 { ); } - async down(queryRunner) { + async down(queryRunner: QueryRunner): Promise { 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/src/migration/1656408772602-nsfw-detection-6.ts similarity index 54% rename from packages/backend/migration/1656408772602-nsfw-detection-6.js rename to packages/backend/src/migration/1656408772602-nsfw-detection-6.ts index 4ef237308..ab1c8fbaa 100644 --- a/packages/backend/migration/1656408772602-nsfw-detection-6.js +++ b/packages/backend/src/migration/1656408772602-nsfw-detection-6.ts @@ -1,13 +1,14 @@ -export class nsfwDetection61656408772602 { +import { MigrationInterface, QueryRunner } from "typeorm"; +export class nsfwDetection61656408772602 implements MigrationInterface { name = "nsfwDetection61656408772602"; - async up(queryRunner) { + async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "meta" ADD "enableSensitiveMediaDetectionForVideos" boolean NOT NULL DEFAULT false`, ); } - async down(queryRunner) { + async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "meta" DROP COLUMN "enableSensitiveMediaDetectionForVideos"`, ); diff --git a/packages/backend/migration/1656772790599-user-moderation-note.js b/packages/backend/src/migration/1656772790599-user-moderation-note.ts similarity index 53% rename from packages/backend/migration/1656772790599-user-moderation-note.js rename to packages/backend/src/migration/1656772790599-user-moderation-note.ts index 11d3124ae..dbc124d03 100644 --- a/packages/backend/migration/1656772790599-user-moderation-note.js +++ b/packages/backend/src/migration/1656772790599-user-moderation-note.ts @@ -1,13 +1,14 @@ -export class userModerationNote1656772790599 { +import { MigrationInterface, QueryRunner } from "typeorm"; +export class userModerationNote1656772790599 implements MigrationInterface { name = "userModerationNote1656772790599"; - async up(queryRunner) { + async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "user_profile" ADD "moderationNote" character varying(8192) NOT NULL DEFAULT ''`, ); } - async down(queryRunner) { + async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "user_profile" DROP COLUMN "moderationNote"`, ); diff --git a/packages/backend/migration/1657346559800-active-email-validation.js b/packages/backend/src/migration/1657346559800-active-email-validation.ts similarity index 52% rename from packages/backend/migration/1657346559800-active-email-validation.js rename to packages/backend/src/migration/1657346559800-active-email-validation.ts index 4e3fd3f82..ed6394b3b 100644 --- a/packages/backend/migration/1657346559800-active-email-validation.js +++ b/packages/backend/src/migration/1657346559800-active-email-validation.ts @@ -1,13 +1,14 @@ -export class activeEmailValidation1657346559800 { +import { MigrationInterface, QueryRunner } from "typeorm"; +export class activeEmailValidation1657346559800 implements MigrationInterface { name = "activeEmailValidation1657346559800"; - async up(queryRunner) { + async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "meta" ADD "enableActiveEmailValidation" boolean NOT NULL DEFAULT true`, ); } - async down(queryRunner) { + async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "meta" DROP COLUMN "enableActiveEmailValidation"`, ); diff --git a/packages/backend/migration/1658203170545firefish.js b/packages/backend/src/migration/1658203170545firefish.ts similarity index 67% rename from packages/backend/migration/1658203170545firefish.js rename to packages/backend/src/migration/1658203170545firefish.ts index c66996d08..65713cd2f 100644 --- a/packages/backend/migration/1658203170545firefish.js +++ b/packages/backend/src/migration/1658203170545firefish.ts @@ -1,7 +1,8 @@ -export class calckey1658203170545 { +import { MigrationInterface, QueryRunner } from "typeorm"; +export class calckey1658203170545 implements MigrationInterface { name = "calckey1658203170545"; - async up(queryRunner) { + async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `UPDATE meta SET "repositoryUrl" = 'https://codeberg/firefish/firefish'`, ); @@ -10,7 +11,7 @@ export class calckey1658203170545 { ); } - async down(queryRunner) { + async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `UPDATE meta SET "repositoryUrl" = 'https://codeberg/firefish/firefish'`, ); diff --git a/packages/backend/migration/1658656633972-note-replies-function.js b/packages/backend/src/migration/1658656633972-note-replies-function.ts similarity index 83% rename from packages/backend/migration/1658656633972-note-replies-function.js rename to packages/backend/src/migration/1658656633972-note-replies-function.ts index 810e23843..7f70bb1ea 100644 --- a/packages/backend/migration/1658656633972-note-replies-function.js +++ b/packages/backend/src/migration/1658656633972-note-replies-function.ts @@ -1,7 +1,8 @@ -export class noteRepliesFunction1658656633972 { +import { MigrationInterface, QueryRunner } from "typeorm"; +export class noteRepliesFunction1658656633972 implements MigrationInterface { name = "noteRepliesFunction1658656633972"; - async up(queryRunner) { + async up(queryRunner: QueryRunner): Promise { await queryRunner.query(` CREATE OR REPLACE FUNCTION note_replies(start_id varchar, max_depth integer, max_breadth integer) RETURNS TABLE (id VARCHAR) AS $$ @@ -46,7 +47,7 @@ export class noteRepliesFunction1658656633972 { `); } - async down(queryRunner) { + async down(queryRunner: QueryRunner): Promise { await queryRunner.query(`DROP FUNCTION note_replies`); } } diff --git a/packages/backend/src/migration/1658939464003CustomMOTD.ts b/packages/backend/src/migration/1658939464003CustomMOTD.ts new file mode 100644 index 000000000..b082a3f67 --- /dev/null +++ b/packages/backend/src/migration/1658939464003CustomMOTD.ts @@ -0,0 +1,11 @@ +import { MigrationInterface, QueryRunner } from "typeorm"; +export class CustomMOTD1658939464003 implements MigrationInterface { + async up(queryRunner: QueryRunner): Promise { + await queryRunner.query( + `ALTER TABLE "meta" ADD "customMOTD" character varying(256) array NOT NULL DEFAULT '{}'::varchar[]`, + ); + } + async down(queryRunner: QueryRunner): Promise { + await queryRunner.query(`ALTER TABLE "meta" DROP COLUMN "customMOTD"`); + } +} diff --git a/packages/backend/src/migration/1658941974648CustomSplashIcons.ts b/packages/backend/src/migration/1658941974648CustomSplashIcons.ts new file mode 100644 index 000000000..4fa2db54c --- /dev/null +++ b/packages/backend/src/migration/1658941974648CustomSplashIcons.ts @@ -0,0 +1,13 @@ +import { MigrationInterface, QueryRunner } from "typeorm"; +export class CustomSplashIcons1658941974648 implements MigrationInterface { + async up(queryRunner: QueryRunner): Promise { + await queryRunner.query( + `ALTER TABLE "meta" ADD "customSplashIcons" character varying(256) array NOT NULL DEFAULT '{}'::varchar[]`, + ); + } + async down(queryRunner: QueryRunner): Promise { + await queryRunner.query( + `ALTER TABLE "meta" DROP COLUMN "customSplashIcons"`, + ); + } +} diff --git a/packages/backend/migration/1658981842728FixCalckey.js b/packages/backend/src/migration/1658981842728FixCalckey.ts similarity index 74% rename from packages/backend/migration/1658981842728FixCalckey.js rename to packages/backend/src/migration/1658981842728FixCalckey.ts index 96dfd77ac..710864028 100644 --- a/packages/backend/migration/1658981842728FixCalckey.js +++ b/packages/backend/src/migration/1658981842728FixCalckey.ts @@ -1,7 +1,8 @@ -export class FixFirefish1658981842728 { +import { MigrationInterface, QueryRunner } from "typeorm"; +export class FixFirefish1658981842728 implements MigrationInterface { name = "FixFirefish1658981842728"; - async up(queryRunner) { + async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `UPDATE "meta" SET "useStarForReactionFallback" = TRUE;`, ); @@ -13,7 +14,7 @@ export class FixFirefish1658981842728 { ); } - async down(queryRunner) { + async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `UPDATE "meta" SET "useStarForReactionFallback" = FALSE;`, ); diff --git a/packages/backend/migration/1659042130648RecommendedTimeline.js b/packages/backend/src/migration/1659042130648RecommendedTimeline.ts similarity index 67% rename from packages/backend/migration/1659042130648RecommendedTimeline.js rename to packages/backend/src/migration/1659042130648RecommendedTimeline.ts index 01d28b2f3..f2688702c 100644 --- a/packages/backend/migration/1659042130648RecommendedTimeline.js +++ b/packages/backend/src/migration/1659042130648RecommendedTimeline.ts @@ -1,6 +1,7 @@ -export class RecommendedTimeline1659042130648 { +import { MigrationInterface, QueryRunner } from "typeorm"; +export class RecommendedTimeline1659042130648 implements MigrationInterface { name = "RecommendedTimeline1659042130648"; - async up(queryRunner) { + async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "meta" ADD "disableRecommendedTimeline" boolean NOT NULL DEFAULT true`, ); @@ -8,7 +9,7 @@ export class RecommendedTimeline1659042130648 { `ALTER TABLE "meta" ADD "recommendedInstances" character varying(256) array NOT NULL DEFAULT '{}'::varchar[]`, ); } - async down(queryRunner) { + async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "meta" DROP COLUMN "disableRecommendedTimeline"`, ); diff --git a/packages/backend/migration/1660068273737GuestTimeline.js b/packages/backend/src/migration/1660068273737GuestTimeline.ts similarity index 51% rename from packages/backend/migration/1660068273737GuestTimeline.js rename to packages/backend/src/migration/1660068273737GuestTimeline.ts index 9a42f602d..fde5e5914 100644 --- a/packages/backend/migration/1660068273737GuestTimeline.js +++ b/packages/backend/src/migration/1660068273737GuestTimeline.ts @@ -1,11 +1,12 @@ -export class GuestTimeline1660068273737 { +import { MigrationInterface, QueryRunner } from "typeorm"; +export class GuestTimeline1660068273737 implements MigrationInterface { name = "GuestTimeline1660068273737"; - async up(queryRunner) { + async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "meta" ADD "enableGuestTimeline" boolean NOT NULL DEFAULT false`, ); } - async down(queryRunner) { + async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "meta" DROP COLUMN "enableGuestTimeline"`, ); diff --git a/packages/backend/migration/1665091090561-add-renote-muting.js b/packages/backend/src/migration/1665091090561-add-renote-muting.ts similarity index 73% rename from packages/backend/migration/1665091090561-add-renote-muting.js rename to packages/backend/src/migration/1665091090561-add-renote-muting.ts index 2c76aaff5..49937528a 100644 --- a/packages/backend/migration/1665091090561-add-renote-muting.js +++ b/packages/backend/src/migration/1665091090561-add-renote-muting.ts @@ -1,9 +1,10 @@ -export class addRenoteMuting1665091090561 { +import { MigrationInterface, QueryRunner } from "typeorm"; +export class addRenoteMuting1665091090561 implements MigrationInterface { constructor() { this.name = "addRenoteMuting1665091090561"; } - async up(queryRunner) { + async up(queryRunner: QueryRunner): Promise { 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"))`, ); @@ -18,5 +19,5 @@ export class addRenoteMuting1665091090561 { ); } - async down(queryRunner) {} + async down(queryRunner: QueryRunner): Promise {} } diff --git a/packages/backend/src/migration/1668828368510PageDraft.ts b/packages/backend/src/migration/1668828368510PageDraft.ts new file mode 100644 index 000000000..e50fd0d35 --- /dev/null +++ b/packages/backend/src/migration/1668828368510PageDraft.ts @@ -0,0 +1,11 @@ +import { MigrationInterface, QueryRunner } from "typeorm"; +export class Page1668828368510 implements MigrationInterface { + async up(queryRunner: QueryRunner): Promise { + await queryRunner.query( + `ALTER TABLE "page" ADD "isPublic" boolean NOT NULL DEFAULT true`, + ); + } + async down(queryRunner: QueryRunner): Promise { + await queryRunner.query(`ALTER TABLE "page" DROP COLUMN "isPublic"`); + } +} diff --git a/packages/backend/src/migration/1668831378728FixCalckeyAgain.ts b/packages/backend/src/migration/1668831378728FixCalckeyAgain.ts new file mode 100644 index 000000000..7ed1ab437 --- /dev/null +++ b/packages/backend/src/migration/1668831378728FixCalckeyAgain.ts @@ -0,0 +1,16 @@ +import { MigrationInterface, QueryRunner } from "typeorm"; +export class FixFirefishAgain1668831378728 implements MigrationInterface { + name = "FixFirefishAgain1668831378728"; + + async up(queryRunner: QueryRunner): Promise { + await queryRunner.query( + `UPDATE "meta" SET "useStarForReactionFallback" = TRUE`, + ); + } + + async down(queryRunner: QueryRunner): Promise { + await queryRunner.query( + `UPDATE "meta" SET "useStarForReactionFallback" = FALSE`, + ); + } +} diff --git a/packages/backend/migration/1669138716634-whetherPushNotifyToSendReadMessage.js b/packages/backend/src/migration/1669138716634-whetherPushNotifyToSendReadMessage.ts similarity index 52% rename from packages/backend/migration/1669138716634-whetherPushNotifyToSendReadMessage.js rename to packages/backend/src/migration/1669138716634-whetherPushNotifyToSendReadMessage.ts index 101972a68..9e277791b 100644 --- a/packages/backend/migration/1669138716634-whetherPushNotifyToSendReadMessage.js +++ b/packages/backend/src/migration/1669138716634-whetherPushNotifyToSendReadMessage.ts @@ -1,13 +1,14 @@ -export class whetherPushNotifyToSendReadMessage1669138716634 { +import { MigrationInterface, QueryRunner } from "typeorm"; +export class whetherPushNotifyToSendReadMessage1669138716634 implements MigrationInterface { name = "whetherPushNotifyToSendReadMessage1669138716634"; - async up(queryRunner) { + async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "sw_subscription" ADD "sendReadMessage" boolean NOT NULL DEFAULT false`, ); } - async down(queryRunner) { + async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "sw_subscription" DROP COLUMN "sendReadMessage"`, ); diff --git a/packages/backend/migration/1669288094000-AddMovedToAndKnownAs.js b/packages/backend/src/migration/1669288094000-AddMovedToAndKnownAs.ts similarity index 71% rename from packages/backend/migration/1669288094000-AddMovedToAndKnownAs.js rename to packages/backend/src/migration/1669288094000-AddMovedToAndKnownAs.ts index c34764e0b..c7d0fa231 100644 --- a/packages/backend/migration/1669288094000-AddMovedToAndKnownAs.js +++ b/packages/backend/src/migration/1669288094000-AddMovedToAndKnownAs.ts @@ -1,7 +1,8 @@ -export class addMovedToAndKnownAs1669288094000 { +import { MigrationInterface, QueryRunner } from "typeorm"; +export class addMovedToAndKnownAs1669288094000 implements MigrationInterface { name = "addMovedToAndKnownAs1669288094000"; - async up(queryRunner) { + async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "user" ADD "movedToUri" character varying(512)`, ); @@ -14,7 +15,7 @@ export class addMovedToAndKnownAs1669288094000 { ); } - async down(queryRunner) { + async down(queryRunner: QueryRunner): Promise { 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/src/migration/1671199573000-AddFkAbuseUserReportTargetUserIdToUserId.ts similarity index 74% rename from packages/backend/migration/1671199573000-AddFkAbuseUserReportTargetUserIdToUserId.js rename to packages/backend/src/migration/1671199573000-AddFkAbuseUserReportTargetUserIdToUserId.ts index 96ed8e1d6..00ea7bf8a 100644 --- a/packages/backend/migration/1671199573000-AddFkAbuseUserReportTargetUserIdToUserId.js +++ b/packages/backend/src/migration/1671199573000-AddFkAbuseUserReportTargetUserIdToUserId.ts @@ -1,7 +1,8 @@ -export class addFkAbuseUserReportTargetUserIdToUserId1671199573000 { +import { MigrationInterface, QueryRunner } from "typeorm"; +export class addFkAbuseUserReportTargetUserIdToUserId1671199573000 implements MigrationInterface { name = "addFkAbuseUserReportTargetUserIdToUserId1671199573000"; - async up(queryRunner) { + async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `DELETE FROM abuse_user_report WHERE NOT EXISTS (SELECT 1 FROM "user" WHERE "user"."id" = "abuse_user_report"."targetUserId")`, ); @@ -10,7 +11,7 @@ export class addFkAbuseUserReportTargetUserIdToUserId1671199573000 { ); } - async down(queryRunner) { + async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE abuse_user_report DROP CONSTRAINT fk_7f4e851a35d81b64dda28eee0`, ); diff --git a/packages/backend/migration/1671388343000-CalckeyRepoMove.js b/packages/backend/src/migration/1671388343000-CalckeyRepoMove.ts similarity index 72% rename from packages/backend/migration/1671388343000-CalckeyRepoMove.js rename to packages/backend/src/migration/1671388343000-CalckeyRepoMove.ts index e11ddcb43..3fa0c548f 100644 --- a/packages/backend/migration/1671388343000-CalckeyRepoMove.js +++ b/packages/backend/src/migration/1671388343000-CalckeyRepoMove.ts @@ -1,9 +1,10 @@ +import { MigrationInterface, QueryRunner } from "typeorm"; /* "FirefishRepoMove1671388343000" is a class that updates the "useStarForReactionFallback" column in the "meta" table to TRUE */ -export class FirefishRepoMove1671388343000 { +export class FirefishRepoMove1671388343000 implements MigrationInterface { name = "FirefishRepoMove1671388343000"; - async up(queryRunner) { + async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `UPDATE meta SET "repositoryUrl" = 'https://codeberg/firefish/firefish'`, ); @@ -12,7 +13,7 @@ export class FirefishRepoMove1671388343000 { ); } - async down(queryRunner) { + async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `UPDATE meta SET "repositoryUrl" = 'https://codeberg/firefish/firefish'`, ); diff --git a/packages/backend/migration/1672882664294-DefaultReaction.js b/packages/backend/src/migration/1672882664294-DefaultReaction.ts similarity index 61% rename from packages/backend/migration/1672882664294-DefaultReaction.js rename to packages/backend/src/migration/1672882664294-DefaultReaction.ts index 6ce1146ec..ee99c7509 100644 --- a/packages/backend/migration/1672882664294-DefaultReaction.js +++ b/packages/backend/src/migration/1672882664294-DefaultReaction.ts @@ -1,7 +1,8 @@ -export class DefaultReaction1672882664294 { +import { MigrationInterface, QueryRunner } from "typeorm"; +export class DefaultReaction1672882664294 implements MigrationInterface { name = "DefaultReaction1672882664294"; - async up(queryRunner) { + async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "meta" ADD "defaultReaction" character varying(256) NOT NULL DEFAULT '⭐'`, ); @@ -10,7 +11,7 @@ export class DefaultReaction1672882664294 { ); } - async down(queryRunner) { + async down(queryRunner: QueryRunner): Promise { await queryRunner.query(`ALTER TABLE "meta" DROP COLUMN "defaultReaction"`); } } diff --git a/packages/backend/migration/1673336077243-PollChoiceLength.js b/packages/backend/src/migration/1673336077243-PollChoiceLength.ts similarity index 53% rename from packages/backend/migration/1673336077243-PollChoiceLength.js rename to packages/backend/src/migration/1673336077243-PollChoiceLength.ts index a0e335016..10cc40f32 100644 --- a/packages/backend/migration/1673336077243-PollChoiceLength.js +++ b/packages/backend/src/migration/1673336077243-PollChoiceLength.ts @@ -1,13 +1,14 @@ -export class PollChoiceLength1673336077243 { +import { MigrationInterface, QueryRunner } from "typeorm"; +export class PollChoiceLength1673336077243 implements MigrationInterface { name = "PollChoiceLength1673336077243"; - async up(queryRunner) { + async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "poll" ALTER COLUMN "choices" TYPE character varying(256) array`, ); } - async down(queryRunner) { + async down(queryRunner: QueryRunner): Promise { 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/src/migration/1676093997212-AntennaInstances.ts similarity index 78% rename from packages/backend/migration/1676093997212-AntennaInstances.js rename to packages/backend/src/migration/1676093997212-AntennaInstances.ts index ffd428f7d..afb7c86da 100644 --- a/packages/backend/migration/1676093997212-AntennaInstances.js +++ b/packages/backend/src/migration/1676093997212-AntennaInstances.ts @@ -1,7 +1,8 @@ -export class AntennaInstances1676093997212 { +import { MigrationInterface, QueryRunner } from "typeorm"; +export class AntennaInstances1676093997212 implements MigrationInterface { name = "AntennaInstances1676093997212"; - async up(queryRunner) { + async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TYPE "antenna_src_enum" ADD VALUE 'instances'`, ); @@ -10,7 +11,7 @@ export class AntennaInstances1676093997212 { ); } - async down(queryRunner) { + async down(queryRunner: QueryRunner): Promise { await queryRunner.query(`DELETE FROM "antenna" WHERE "src" = 'instances'`); await queryRunner.query(`ALTER TABLE "antenna" DROP COLUMN "instances"`); await queryRunner.query( diff --git a/packages/backend/migration/1677935903517-DriveComment.js b/packages/backend/src/migration/1677935903517-DriveComment.ts similarity index 52% rename from packages/backend/migration/1677935903517-DriveComment.js rename to packages/backend/src/migration/1677935903517-DriveComment.ts index 571958f29..f500ecd7c 100644 --- a/packages/backend/migration/1677935903517-DriveComment.js +++ b/packages/backend/src/migration/1677935903517-DriveComment.ts @@ -1,13 +1,14 @@ -export class DriveComment1677935903517 { +import { MigrationInterface, QueryRunner } from "typeorm"; +export class DriveComment1677935903517 implements MigrationInterface { name = "DriveComment1677935903517"; - async up(queryRunner) { + async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "drive_file" ALTER "comment" TYPE character varying(8192)`, ); } - async down(queryRunner) { + async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "drive_file" ALTER "comment" TYPE character varying(512)`, ); diff --git a/packages/backend/migration/1678426061773-tweak-varchar-length.js b/packages/backend/src/migration/1678426061773-tweak-varchar-length.ts similarity index 54% rename from packages/backend/migration/1678426061773-tweak-varchar-length.js rename to packages/backend/src/migration/1678426061773-tweak-varchar-length.ts index 00ddcaebe..65ee46a03 100644 --- a/packages/backend/migration/1678426061773-tweak-varchar-length.js +++ b/packages/backend/src/migration/1678426061773-tweak-varchar-length.ts @@ -1,7 +1,8 @@ -export class tweakVarcharLength1678426061773 { +import { MigrationInterface, QueryRunner } from "typeorm"; +export class tweakVarcharLength1678426061773 implements MigrationInterface { name = "tweakVarcharLength1678426061773"; - async up(queryRunner) { + async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "meta" ALTER COLUMN "smtpUser" TYPE character varying(1024)`, undefined, @@ -12,5 +13,5 @@ export class tweakVarcharLength1678426061773 { ); } - async down(queryRunner) {} + async down(queryRunner: QueryRunner): Promise {} } diff --git a/packages/backend/src/migration/1678945242650-add-props-for-custom-emoji.ts b/packages/backend/src/migration/1678945242650-add-props-for-custom-emoji.ts new file mode 100644 index 000000000..85e0948d2 --- /dev/null +++ b/packages/backend/src/migration/1678945242650-add-props-for-custom-emoji.ts @@ -0,0 +1,14 @@ +import { MigrationInterface, QueryRunner } from "typeorm"; +export class addPropsForCustomEmoji1678945242650 implements MigrationInterface { + name = "addPropsForCustomEmoji1678945242650"; + + async up(queryRunner: QueryRunner): Promise { + await queryRunner.query( + `ALTER TABLE "emoji" ADD "license" character varying(1024)`, + ); + } + + async down(queryRunner: QueryRunner): Promise { + await queryRunner.query(`ALTER TABLE "emoji" DROP COLUMN "license"`); + } +} diff --git a/packages/backend/migration/1679269929000-fix-repo.js b/packages/backend/src/migration/1679269929000-fix-repo.ts similarity index 68% rename from packages/backend/migration/1679269929000-fix-repo.js rename to packages/backend/src/migration/1679269929000-fix-repo.ts index 2abcd71bb..72f660cda 100644 --- a/packages/backend/migration/1679269929000-fix-repo.js +++ b/packages/backend/src/migration/1679269929000-fix-repo.ts @@ -1,7 +1,8 @@ -export class FixRepo1679269929000 { +import { MigrationInterface, QueryRunner } from "typeorm"; +export class FixRepo1679269929000 implements MigrationInterface { name = "FixRepo1679269929000"; - async up(queryRunner) { + async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `UPDATE meta SET "repositoryUrl" = 'https://codeberg.org/firefish/firefish'`, ); @@ -10,7 +11,7 @@ export class FixRepo1679269929000 { ); } - async down(queryRunner) { + async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `UPDATE meta SET "repositoryUrl" = 'https://codeberg.org/firefish/firefish'`, ); diff --git a/packages/backend/migration/1680375641101-clean-charts.js b/packages/backend/src/migration/1680375641101-clean-charts.ts similarity index 75% rename from packages/backend/migration/1680375641101-clean-charts.js rename to packages/backend/src/migration/1680375641101-clean-charts.ts index bfb8aa9d9..c27b6edcf 100644 --- a/packages/backend/migration/1680375641101-clean-charts.js +++ b/packages/backend/src/migration/1680375641101-clean-charts.ts @@ -1,8 +1,9 @@ -export class CleanCharts1680375641101 { +import { MigrationInterface, QueryRunner } from "typeorm"; +export class CleanCharts1680375641101 implements MigrationInterface { constructor() { this.name = "CleanCharts1680375641101"; } - async up(queryRunner) { + async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `delete from __chart__hashtag where ___local_users = 0 and ___remote_users = 0;`, ); @@ -14,7 +15,7 @@ export class CleanCharts1680375641101 { await queryRunner.query(`vacuum __chart_day__hashtag;`); await queryRunner.query(`COMMIT;`); } - async down(queryRunner) { + async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `delete from __chart__hashtag where ___local_users = 0 and ___remote_users = 0;`, ); diff --git a/packages/backend/migration/1680426269172-SpeakAsCat.js b/packages/backend/src/migration/1680426269172-SpeakAsCat.ts similarity index 63% rename from packages/backend/migration/1680426269172-SpeakAsCat.js rename to packages/backend/src/migration/1680426269172-SpeakAsCat.ts index 375098542..35f826168 100644 --- a/packages/backend/migration/1680426269172-SpeakAsCat.js +++ b/packages/backend/src/migration/1680426269172-SpeakAsCat.ts @@ -1,7 +1,8 @@ -export class SpeakAsCat1680426269172 { +import { MigrationInterface, QueryRunner } from "typeorm"; +export class SpeakAsCat1680426269172 implements MigrationInterface { name = "SpeakAsCat1680426269172"; - async up(queryRunner) { + async up(queryRunner: QueryRunner): Promise { await queryRunner.query(` ALTER TABLE "user" ADD "speakAsCat" boolean NOT NULL DEFAULT true @@ -12,7 +13,7 @@ export class SpeakAsCat1680426269172 { `); } - async down(queryRunner) { + async down(queryRunner: QueryRunner): Promise { await queryRunner.query(` ALTER TABLE "user" DROP COLUMN "speakAsCat" `); diff --git a/packages/backend/migration/1682753227899-NoteEdit.js b/packages/backend/src/migration/1682753227899-NoteEdit.ts similarity index 85% rename from packages/backend/migration/1682753227899-NoteEdit.js rename to packages/backend/src/migration/1682753227899-NoteEdit.ts index 55a0de020..8bf908bb8 100644 --- a/packages/backend/migration/1682753227899-NoteEdit.js +++ b/packages/backend/src/migration/1682753227899-NoteEdit.ts @@ -1,7 +1,8 @@ -export class NoteEdit1682753227899 { +import { MigrationInterface, QueryRunner } from "typeorm"; +export class NoteEdit1682753227899 implements MigrationInterface { name = "NoteEdit1682753227899"; - async up(queryRunner) { + async up(queryRunner: QueryRunner): Promise { await queryRunner.query(` CREATE TABLE "note_edit" ( "id" character varying(32) NOT NULL, @@ -39,7 +40,7 @@ export class NoteEdit1682753227899 { `); } - async down(queryRunner) { + async down(queryRunner: QueryRunner): Promise { await queryRunner.query(` ALTER TABLE "note_edit" DROP CONSTRAINT "FK_702ad5ae993a672e4fbffbcd38c" `); diff --git a/packages/backend/migration/1682777547198-LibreTranslate.js b/packages/backend/src/migration/1682777547198-LibreTranslate.ts similarity index 65% rename from packages/backend/migration/1682777547198-LibreTranslate.js rename to packages/backend/src/migration/1682777547198-LibreTranslate.ts index dbaf483e6..deda6ffcc 100644 --- a/packages/backend/migration/1682777547198-LibreTranslate.js +++ b/packages/backend/src/migration/1682777547198-LibreTranslate.ts @@ -1,7 +1,8 @@ -export class LibreTranslate1682777547198 { +import { MigrationInterface, QueryRunner } from "typeorm"; +export class LibreTranslate1682777547198 implements MigrationInterface { name = "LibreTranslate1682777547198"; - async up(queryRunner) { + async up(queryRunner: QueryRunner): Promise { await queryRunner.query(` ALTER TABLE "meta" ADD "libreTranslateApiUrl" character varying(512) @@ -12,7 +13,7 @@ export class LibreTranslate1682777547198 { `); } - async down(queryRunner) { + async down(queryRunner: QueryRunner): Promise { await queryRunner.query(` ALTER TABLE "meta" DROP COLUMN "libreTranslateApiKey" `); diff --git a/packages/backend/migration/1682891890317-InstanceSilence.js b/packages/backend/src/migration/1682891890317-InstanceSilence.ts similarity index 51% rename from packages/backend/migration/1682891890317-InstanceSilence.js rename to packages/backend/src/migration/1682891890317-InstanceSilence.ts index babe64883..b35c69cf0 100644 --- a/packages/backend/migration/1682891890317-InstanceSilence.js +++ b/packages/backend/src/migration/1682891890317-InstanceSilence.ts @@ -1,13 +1,14 @@ -export class InstanceSilence1682891890317 { +import { MigrationInterface, QueryRunner } from "typeorm"; +export class InstanceSilence1682891890317 implements MigrationInterface { name = "InstanceSilence1682891890317"; - async up(queryRunner) { + async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "meta" ADD "silencedHosts" character varying(256) array NOT NULL DEFAULT '{}'`, ); } - async down(queryRunner) { + async down(queryRunner: QueryRunner): Promise { await queryRunner.query(`ALTER TABLE "meta" DROP COLUMN "silencedHosts"`); } } diff --git a/packages/backend/migration/1682891891317-AddHiddenPosts.js b/packages/backend/src/migration/1682891891317-AddHiddenPosts.ts similarity index 51% rename from packages/backend/migration/1682891891317-AddHiddenPosts.js rename to packages/backend/src/migration/1682891891317-AddHiddenPosts.ts index 827470f88..fd0841063 100644 --- a/packages/backend/migration/1682891891317-AddHiddenPosts.js +++ b/packages/backend/src/migration/1682891891317-AddHiddenPosts.ts @@ -1,13 +1,14 @@ -export class AddHiddenPosts1682891891317 { +import { MigrationInterface, QueryRunner } from "typeorm"; +export class AddHiddenPosts1682891891317 implements MigrationInterface { name = "AddHiddenPosts1682891891317"; - async up(queryRunner) { + async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TYPE note_visibility_enum ADD VALUE IF NOT EXISTS 'hidden'`, ); } - async down(queryRunner) { + async down(queryRunner: QueryRunner): Promise { 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/src/migration/1683682889948-PreventAiLearning.ts similarity index 52% rename from packages/backend/migration/1683682889948-PreventAiLearning.js rename to packages/backend/src/migration/1683682889948-PreventAiLearning.ts index afb892ed5..aba88339e 100644 --- a/packages/backend/migration/1683682889948-PreventAiLearning.js +++ b/packages/backend/src/migration/1683682889948-PreventAiLearning.ts @@ -1,13 +1,14 @@ -export class PreventAiLearning1683682889948 { +import { MigrationInterface, QueryRunner } from "typeorm"; +export class PreventAiLearning1683682889948 implements MigrationInterface { name = "PreventAiLearning1683682889948"; - async up(queryRunner) { + async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "user_profile" ADD "preventAiLearning" boolean NOT NULL DEFAULT true`, ); } - async down(queryRunner) { + async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "user_profile" DROP COLUMN "preventAiLearning"`, ); diff --git a/packages/backend/migration/1683980686995-ExperimentalFeatures.js b/packages/backend/src/migration/1683980686995-ExperimentalFeatures.ts similarity index 51% rename from packages/backend/migration/1683980686995-ExperimentalFeatures.js rename to packages/backend/src/migration/1683980686995-ExperimentalFeatures.ts index a289a9ecd..e4f94d8ea 100644 --- a/packages/backend/migration/1683980686995-ExperimentalFeatures.js +++ b/packages/backend/src/migration/1683980686995-ExperimentalFeatures.ts @@ -1,14 +1,15 @@ -export class ExperimentalFeatures1683980686995 { +import { MigrationInterface, QueryRunner } from "typeorm"; +export class ExperimentalFeatures1683980686995 implements MigrationInterface { name = "ExperimentalFeatures1683980686995"; - async up(queryRunner) { + async up(queryRunner: QueryRunner): Promise { await queryRunner.query(` ALTER TABLE "meta" ADD "experimentalFeatures" jsonb NOT NULL DEFAULT '{}' `); } - async down(queryRunner) { + async down(queryRunner: QueryRunner): Promise { await queryRunner.query(` ALTER TABLE "meta" DROP COLUMN "experimentalFeatures" `); diff --git a/packages/backend/migration/1684206886988-remove-showTimelineReplies.js b/packages/backend/src/migration/1684206886988-remove-showTimelineReplies.ts similarity index 51% rename from packages/backend/migration/1684206886988-remove-showTimelineReplies.js rename to packages/backend/src/migration/1684206886988-remove-showTimelineReplies.ts index e5f8483c7..6c88190f9 100644 --- a/packages/backend/migration/1684206886988-remove-showTimelineReplies.js +++ b/packages/backend/src/migration/1684206886988-remove-showTimelineReplies.ts @@ -1,13 +1,14 @@ -export class RemoveShowTimelineReplies1684206886988 { +import { MigrationInterface, QueryRunner } from "typeorm"; +export class RemoveShowTimelineReplies1684206886988 implements MigrationInterface { name = "RemoveShowTimelineReplies1684206886988"; - async up(queryRunner) { + async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "user" DROP COLUMN "showTimelineReplies"`, ); } - async down(queryRunner) { + async down(queryRunner: QueryRunner): Promise { 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/src/migration/1684494870830-EmojiSize.ts similarity index 68% rename from packages/backend/migration/1684494870830-EmojiSize.js rename to packages/backend/src/migration/1684494870830-EmojiSize.ts index 6d42f1a61..c053e6a4e 100644 --- a/packages/backend/migration/1684494870830-EmojiSize.js +++ b/packages/backend/src/migration/1684494870830-EmojiSize.ts @@ -1,7 +1,8 @@ -export class EmojiSize1684494870830 { +import { MigrationInterface, QueryRunner } from "typeorm"; +export class EmojiSize1684494870830 implements MigrationInterface { name = "EmojiSize1684494870830"; - async up(queryRunner) { + async up(queryRunner: QueryRunner): Promise { await queryRunner.query(`ALTER TABLE "emoji" ADD "width" integer`); await queryRunner.query( `COMMENT ON COLUMN "emoji"."width" IS 'Image width'`, @@ -12,7 +13,7 @@ export class EmojiSize1684494870830 { ); } - async down(queryRunner) { + async down(queryRunner: QueryRunner): Promise { await queryRunner.query(`ALTER TABLE "emoji" DROP COLUMN "height"`); await queryRunner.query(`ALTER TABLE "emoji" DROP COLUMN "width"`); } diff --git a/packages/backend/migration/1688280713783-add-meta-options.js b/packages/backend/src/migration/1688280713783-add-meta-options.ts similarity index 66% rename from packages/backend/migration/1688280713783-add-meta-options.js rename to packages/backend/src/migration/1688280713783-add-meta-options.ts index e97a95c42..0463ac6d3 100644 --- a/packages/backend/migration/1688280713783-add-meta-options.js +++ b/packages/backend/src/migration/1688280713783-add-meta-options.ts @@ -1,7 +1,8 @@ -export class AddMetaOptions1688280713783 { +import { MigrationInterface, QueryRunner } from "typeorm"; +export class AddMetaOptions1688280713783 implements MigrationInterface { name = "AddMetaOptions1688280713783"; - async up(queryRunner) { + async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "meta" ADD "enableServerMachineStats" boolean NOT NULL DEFAULT false`, ); @@ -10,7 +11,7 @@ export class AddMetaOptions1688280713783 { ); } - async down(queryRunner) { + async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "meta" DROP COLUMN "enableIdenticonGeneration"`, ); diff --git a/packages/backend/migration/1688845537045-announcement-popup.js b/packages/backend/src/migration/1688845537045-announcement-popup.ts similarity index 65% rename from packages/backend/migration/1688845537045-announcement-popup.js rename to packages/backend/src/migration/1688845537045-announcement-popup.ts index 196590d3e..5fe882a71 100644 --- a/packages/backend/migration/1688845537045-announcement-popup.js +++ b/packages/backend/src/migration/1688845537045-announcement-popup.ts @@ -1,7 +1,8 @@ -export class AnnouncementPopup1688845537045 { +import { MigrationInterface, QueryRunner } from "typeorm"; +export class AnnouncementPopup1688845537045 implements MigrationInterface { name = "AnnouncementPopup1688845537045"; - async up(queryRunner) { + async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "announcement" ADD "showPopup" boolean NOT NULL DEFAULT false`, ); @@ -10,7 +11,7 @@ export class AnnouncementPopup1688845537045 { ); } - async down(queryRunner) { + async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "announcement" DROP COLUMN "isGoodNews"`, ); diff --git a/packages/backend/migration/1689136347561-donation-link.js b/packages/backend/src/migration/1689136347561-donation-link.ts similarity index 50% rename from packages/backend/migration/1689136347561-donation-link.js rename to packages/backend/src/migration/1689136347561-donation-link.ts index dbe0ed7c8..43ed8bc90 100644 --- a/packages/backend/migration/1689136347561-donation-link.js +++ b/packages/backend/src/migration/1689136347561-donation-link.ts @@ -1,13 +1,14 @@ -export class DonationLink1689136347561 { +import { MigrationInterface, QueryRunner } from "typeorm"; +export class DonationLink1689136347561 implements MigrationInterface { name = "DonationLink1689136347561"; - async up(queryRunner) { + async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "meta" ADD "donationLink" character varying(256)`, ); } - async down(queryRunner) { + async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "meta" DROP COLUMN "DonationLink1689136347561"`, ); diff --git a/packages/backend/migration/1689739513827-firefish-repo.js b/packages/backend/src/migration/1689739513827-firefish-repo.ts similarity index 68% rename from packages/backend/migration/1689739513827-firefish-repo.js rename to packages/backend/src/migration/1689739513827-firefish-repo.ts index d2491f213..575eafddb 100644 --- a/packages/backend/migration/1689739513827-firefish-repo.js +++ b/packages/backend/src/migration/1689739513827-firefish-repo.ts @@ -1,7 +1,8 @@ -export class FirefishRepo1689739513827 { +import { MigrationInterface, QueryRunner } from "typeorm"; +export class FirefishRepo1689739513827 implements MigrationInterface { name = "FirefishRepo1689739513827"; - async up(queryRunner) { + async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `UPDATE meta SET "repositoryUrl" = 'https://codeberg.org/firefish/firefish'`, ); @@ -10,7 +11,7 @@ export class FirefishRepo1689739513827 { ); } - async down(queryRunner) { + async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `UPDATE meta SET "repositoryUrl" = 'https://codeberg.org/calckey/calckey'`, ); diff --git a/packages/backend/migration/1689965609061-iceshrimp-repo.js b/packages/backend/src/migration/1689965609061-iceshrimp-repo.ts similarity index 68% rename from packages/backend/migration/1689965609061-iceshrimp-repo.js rename to packages/backend/src/migration/1689965609061-iceshrimp-repo.ts index 0dfc0be8b..c81998133 100644 --- a/packages/backend/migration/1689965609061-iceshrimp-repo.js +++ b/packages/backend/src/migration/1689965609061-iceshrimp-repo.ts @@ -1,7 +1,8 @@ -export class IceshrimpRepo1689965609061 { +import { MigrationInterface, QueryRunner } from "typeorm"; +export class IceshrimpRepo1689965609061 implements MigrationInterface { name = "IceshrimpRepo1689965609061"; - async up(queryRunner) { + async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `UPDATE meta SET "repositoryUrl" = 'https://iceshrimp.dev/iceshrimp/iceshrimp'`, ); @@ -10,7 +11,7 @@ export class IceshrimpRepo1689965609061 { ); } - async down(queryRunner) { + async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `UPDATE meta SET "repositoryUrl" = 'https://codeberg.org/firefish/firefish'`, ); diff --git a/packages/backend/migration/1695747439252-drop-reversi.js b/packages/backend/src/migration/1695747439252-drop-reversi.ts similarity index 93% rename from packages/backend/migration/1695747439252-drop-reversi.js rename to packages/backend/src/migration/1695747439252-drop-reversi.ts index 58c03cc2a..2ba8e5c0a 100644 --- a/packages/backend/migration/1695747439252-drop-reversi.js +++ b/packages/backend/src/migration/1695747439252-drop-reversi.ts @@ -1,12 +1,13 @@ -export class DropReversi1695747439252 { +import { MigrationInterface, QueryRunner } from "typeorm"; +export class DropReversi1695747439252 implements MigrationInterface { name = "DropReversi1695747439252"; - async up(queryRunner) { + async up(queryRunner: QueryRunner): Promise { await queryRunner.query(`DROP TABLE IF EXISTS "reversi_game"`); await queryRunner.query(`DROP TABLE IF EXISTS "reversi_matching"`); } - async down(queryRunner) { + async down(queryRunner: QueryRunner): Promise { 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"))`, ); diff --git a/packages/backend/src/migration/1695748502971-index-note-url.ts b/packages/backend/src/migration/1695748502971-index-note-url.ts new file mode 100644 index 000000000..2d7a54692 --- /dev/null +++ b/packages/backend/src/migration/1695748502971-index-note-url.ts @@ -0,0 +1,11 @@ +import { MigrationInterface, QueryRunner } from "typeorm"; +export class IndexNoteUrl1695748502971 implements MigrationInterface { + name = "IndexNoteUrl1695748502971"; + async up(queryRunner: QueryRunner): Promise { + await queryRunner.query(`CREATE INDEX IF NOT EXISTS "IDX_note_url" ON "note" ("url") `); + } + + async down(queryRunner: QueryRunner): Promise { + await queryRunner.query(`DROP INDEX IF EXISTS "IDX_note_url"`); + } +} diff --git a/packages/backend/migration/1695748874491-drop-ads.js b/packages/backend/src/migration/1695748874491-drop-ads.ts similarity index 83% rename from packages/backend/migration/1695748874491-drop-ads.js rename to packages/backend/src/migration/1695748874491-drop-ads.ts index 8482fb8c4..ea4c834e0 100644 --- a/packages/backend/migration/1695748874491-drop-ads.js +++ b/packages/backend/src/migration/1695748874491-drop-ads.ts @@ -1,12 +1,13 @@ -export class DropAds1695748874491 { +import { MigrationInterface, QueryRunner } from "typeorm"; +export class DropAds1695748874491 implements MigrationInterface { name = "DropAds1695748874491"; - async up(queryRunner) { + async up(queryRunner: QueryRunner): Promise { await queryRunner.query(`DROP INDEX IF EXISTS "IDX_2da24ce20ad209f1d9dc032457"`); await queryRunner.query(`DROP INDEX IF EXISTS "IDX_1129c2ef687fc272df040bafaa"`); await queryRunner.query(`DROP TABLE IF EXISTS "ad"`); } - async down(queryRunner) { + async down(queryRunner: QueryRunner): Promise { 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.'`, ); diff --git a/packages/backend/migration/1695749386779-instance-account-domain-cleanup.js b/packages/backend/src/migration/1695749386779-instance-account-domain-cleanup.ts similarity index 63% rename from packages/backend/migration/1695749386779-instance-account-domain-cleanup.js rename to packages/backend/src/migration/1695749386779-instance-account-domain-cleanup.ts index fb7772f28..3c2e688b7 100644 --- a/packages/backend/migration/1695749386779-instance-account-domain-cleanup.js +++ b/packages/backend/src/migration/1695749386779-instance-account-domain-cleanup.ts @@ -1,11 +1,12 @@ -export class InstanceAccountDomainCleanup1695749386779 { +import { MigrationInterface, QueryRunner } from "typeorm"; +export class InstanceAccountDomainCleanup1695749386779 implements MigrationInterface { name = "InstanceAccountDomainCleanup1695749386779"; - async up(queryRunner) { + async up(queryRunner: QueryRunner): Promise { await queryRunner.query(`ALTER TABLE "instance" DROP COLUMN IF EXISTS "accountDomain"`); await queryRunner.query(`ALTER TABLE "instance" DROP COLUMN IF EXISTS "account_domain"`); } - async down(queryRunner) { + async down(queryRunner: QueryRunner): Promise { // This migration is only here to ensure consistent state if upgrading from certain dev branch commits, skipping the final TypeORM migration. // As such, there is no need to revert it. } diff --git a/packages/backend/migration/1695749948350-move-antenna-to-cache.js b/packages/backend/src/migration/1695749948350-move-antenna-to-cache.ts similarity index 91% rename from packages/backend/migration/1695749948350-move-antenna-to-cache.js rename to packages/backend/src/migration/1695749948350-move-antenna-to-cache.ts index cafa9c75e..68d4bc566 100644 --- a/packages/backend/migration/1695749948350-move-antenna-to-cache.js +++ b/packages/backend/src/migration/1695749948350-move-antenna-to-cache.ts @@ -1,8 +1,9 @@ -import { redisClient } from "../built/db/redis.js"; +import { MigrationInterface, QueryRunner } from "typeorm"; +import { redisClient } from "../db/redis.js"; -export class MoveAntennaToCache1695749948350 { +export class MoveAntennaToCache1695749948350 implements MigrationInterface { name = "MoveAntennaToCache1695749948350"; - async up(queryRunner) { + async up(queryRunner: QueryRunner): Promise { const tableExists = await queryRunner.query(`SELECT EXISTS ( SELECT 1 FROM pg_tables WHERE tablename = 'antenna_note' ) AS table_existence`) .then(p => !!p[0]['table_existence']); @@ -45,7 +46,7 @@ export class MoveAntennaToCache1695749948350 { await queryRunner.query(`DROP TABLE IF EXISTS "antenna_note"`); } - async down(queryRunner) { + async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `CREATE TABLE IF NOT EXISTS "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"))` ); diff --git a/packages/backend/src/migration/1695861526125-index-note-userid.ts b/packages/backend/src/migration/1695861526125-index-note-userid.ts new file mode 100644 index 000000000..b3bb4edf2 --- /dev/null +++ b/packages/backend/src/migration/1695861526125-index-note-userid.ts @@ -0,0 +1,11 @@ +import { MigrationInterface, QueryRunner } from "typeorm"; +export class IndexNoteUserId1695861526125 implements MigrationInterface { + name = "IndexNoteUserId1695861526125"; + async up(queryRunner: QueryRunner): Promise { + await queryRunner.query(`CREATE INDEX "IDX_note_userId_id" ON "note" ("userId", "id")`); + } + + async down(queryRunner: QueryRunner): Promise { + await queryRunner.query(`DROP INDEX "IDX_note_userId_id"`); + } +} diff --git a/packages/backend/ormconfig.js b/packages/backend/src/ormconfig.ts similarity index 67% rename from packages/backend/ormconfig.js rename to packages/backend/src/ormconfig.ts index 5f85cead8..a1891e00d 100644 --- a/packages/backend/ormconfig.js +++ b/packages/backend/src/ormconfig.ts @@ -1,6 +1,6 @@ import { DataSource } from "typeorm"; -import config from "./built/config/index.js"; -import { entities } from "./built/db/postgre.js"; +import config from "./config/index.js"; +import { entities } from "./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: ["built/migration/*.js"], });