refactor (backend): move migrations inside backend/src

This commit is contained in:
naskya 2024-03-03 13:20:32 +09:00
parent a516803cc3
commit bf99167406
No known key found for this signature in database
GPG key ID: 712D413B3A9FED5C
272 changed files with 1547 additions and 1557 deletions

View file

@ -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"`);
}
}

View file

@ -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"`);
}
}

View file

@ -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"`,
);
}
}

View file

@ -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"`,
);
}
}

View file

@ -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"`);
}
}

View file

@ -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,
);
}
}

View file

@ -1,17 +0,0 @@
export class TalkFederationId1576269851876 {
constructor() {
this.name = "TalkFederationId1576269851876";
}
async up(queryRunner) {
await queryRunner.query(
`ALTER TABLE "messaging_message" ADD "uri" character varying(512)`,
undefined,
);
}
async down(queryRunner) {
await queryRunner.query(
`ALTER TABLE "messaging_message" DROP COLUMN "uri"`,
undefined,
);
}
}

View file

@ -1,17 +0,0 @@
export class ProxyRemoteFiles1576869585998 {
constructor() {
this.name = "ProxyRemoteFiles1576869585998";
}
async up(queryRunner) {
await queryRunner.query(
`ALTER TABLE "meta" ADD "proxyRemoteFiles" boolean NOT NULL DEFAULT false`,
undefined,
);
}
async down(queryRunner) {
await queryRunner.query(
`ALTER TABLE "meta" DROP COLUMN "proxyRemoteFiles"`,
undefined,
);
}
}

View file

@ -1,14 +0,0 @@
export class v12131580543501339 {
constructor() {
this.name = "v12131580543501339";
}
async up(queryRunner) {
await queryRunner.query(
`CREATE INDEX "IDX_NOTE_TAGS" ON "note" USING gin ("tags")`,
undefined,
);
}
async down(queryRunner) {
await queryRunner.query(`DROP INDEX "IDX_NOTE_TAGS"`, undefined);
}
}

View file

@ -1,17 +0,0 @@
export class driveUserFolderIdIndex1581708415836 {
constructor() {
this.name = "driveUserFolderIdIndex1581708415836";
}
async up(queryRunner) {
await queryRunner.query(
`CREATE INDEX "IDX_55720b33a61a7c806a8215b825" ON "drive_file" ("userId", "folderId", "id") `,
undefined,
);
}
async down(queryRunner) {
await queryRunner.query(
`DROP INDEX "IDX_55720b33a61a7c806a8215b825"`,
undefined,
);
}
}

View file

@ -1,17 +0,0 @@
export class antennaExclude1582210532752 {
constructor() {
this.name = "antennaExclude1582210532752";
}
async up(queryRunner) {
await queryRunner.query(
`ALTER TABLE "antenna" ADD "excludeKeywords" jsonb NOT NULL DEFAULT '[]'`,
undefined,
);
}
async down(queryRunner) {
await queryRunner.query(
`ALTER TABLE "antenna" DROP COLUMN "excludeKeywords"`,
undefined,
);
}
}

View file

@ -1,14 +0,0 @@
export class apUrl1585772678853 {
constructor() {
this.name = "apUrl1585772678853";
}
async up(queryRunner) {
await queryRunner.query(
`ALTER TABLE "note" ADD "url" character varying(512)`,
undefined,
);
}
async down(queryRunner) {
await queryRunner.query(`ALTER TABLE "note" DROP COLUMN "url"`, undefined);
}
}

View file

@ -1,17 +0,0 @@
export class AddObjectStorageUseProxy1586624197029 {
constructor() {
this.name = "AddObjectStorageUseProxy1586624197029";
}
async up(queryRunner) {
await queryRunner.query(
`ALTER TABLE "meta" ADD "objectStorageUseProxy" boolean NOT NULL DEFAULT true`,
undefined,
);
}
async down(queryRunner) {
await queryRunner.query(
`ALTER TABLE "meta" DROP COLUMN "objectStorageUseProxy"`,
undefined,
);
}
}

View file

@ -1,17 +0,0 @@
export class pageAiScript1586708940386 {
constructor() {
this.name = "pageAiScript1586708940386";
}
async up(queryRunner) {
await queryRunner.query(
`ALTER TABLE "page" ADD "script" character varying(16384) NOT NULL DEFAULT ''`,
undefined,
);
}
async down(queryRunner) {
await queryRunner.query(
`ALTER TABLE "page" DROP COLUMN "script"`,
undefined,
);
}
}

View file

@ -1,13 +0,0 @@
export class blurhash1595075960584 {
constructor() {
this.name = "blurhash1595075960584";
}
async up(queryRunner) {
await queryRunner.query(
`ALTER TABLE "drive_file" ADD "blurhash" character varying(128)`,
);
}
async down(queryRunner) {
await queryRunner.query(`ALTER TABLE "drive_file" DROP COLUMN "blurhash"`);
}
}

View file

@ -1,13 +0,0 @@
export class instanceIconUrl1595676934834 {
constructor() {
this.name = "instanceIconUrl1595676934834";
}
async up(queryRunner) {
await queryRunner.query(
`ALTER TABLE "instance" ADD "iconUrl" character varying(256) DEFAULT null`,
);
}
async down(queryRunner) {
await queryRunner.query(`ALTER TABLE "instance" DROP COLUMN "iconUrl"`);
}
}

View file

@ -1,15 +0,0 @@
export class channel21596786425167 {
constructor() {
this.name = "channel21596786425167";
}
async up(queryRunner) {
await queryRunner.query(
`ALTER TABLE "channel_following" ADD "readCursor" TIMESTAMP WITH TIME ZONE NOT NULL`,
);
}
async down(queryRunner) {
await queryRunner.query(
`ALTER TABLE "channel_following" DROP COLUMN "readCursor"`,
);
}
}

View file

@ -1,15 +0,0 @@
export class objectStorageSetPublicRead1597230137744 {
constructor() {
this.name = "objectStorageSetPublicRead1597230137744";
}
async up(queryRunner) {
await queryRunner.query(
`ALTER TABLE "meta" ADD "objectStorageSetPublicRead" boolean NOT NULL DEFAULT false`,
);
}
async down(queryRunner) {
await queryRunner.query(
`ALTER TABLE "meta" DROP COLUMN "objectStorageSetPublicRead"`,
);
}
}

View file

@ -1,13 +0,0 @@
export class addSensitiveIndex1597385880794 {
constructor() {
this.name = "addSensitiveIndex1597385880794";
}
async up(queryRunner) {
await queryRunner.query(
`CREATE INDEX "IDX_a7eba67f8b3fa27271e85d2e26" ON "drive_file" ("isSensitive") `,
);
}
async down(queryRunner) {
await queryRunner.query(`DROP INDEX "IDX_a7eba67f8b3fa27271e85d2e26"`);
}
}

View file

@ -1,13 +0,0 @@
export class instanceThemeColor1603776877564 {
constructor() {
this.name = "instanceThemeColor1603776877564";
}
async up(queryRunner) {
await queryRunner.query(
`ALTER TABLE "instance" ADD "themeColor" character varying(64) DEFAULT null`,
);
}
async down(queryRunner) {
await queryRunner.query(`ALTER TABLE "instance" DROP COLUMN "themeColor"`);
}
}

View file

@ -1,13 +0,0 @@
export class instanceFavicon1603781553011 {
constructor() {
this.name = "instanceFavicon1603781553011";
}
async up(queryRunner) {
await queryRunner.query(
`ALTER TABLE "instance" ADD "faviconUrl" character varying(256) DEFAULT null`,
);
}
async down(queryRunner) {
await queryRunner.query(`ALTER TABLE "instance" DROP COLUMN "faviconUrl"`);
}
}

View file

@ -1,15 +0,0 @@
export class deleteAutoWatch1604821689616 {
constructor() {
this.name = "deleteAutoWatch1604821689616";
}
async up(queryRunner) {
await queryRunner.query(
`ALTER TABLE "user_profile" DROP COLUMN "autoWatch"`,
);
}
async down(queryRunner) {
await queryRunner.query(
`ALTER TABLE "user_profile" ADD "autoWatch" boolean NOT NULL DEFAULT false`,
);
}
}

View file

@ -1,13 +0,0 @@
export class clipDescription1605408848373 {
constructor() {
this.name = "clipDescription1605408848373";
}
async up(queryRunner) {
await queryRunner.query(
`ALTER TABLE "clip" ADD "description" character varying(2048) DEFAULT null`,
);
}
async down(queryRunner) {
await queryRunner.query(`ALTER TABLE "clip" DROP COLUMN "description"`);
}
}

View file

@ -1,13 +0,0 @@
export class instancePinnedClip1607151207216 {
constructor() {
this.name = "instancePinnedClip1607151207216";
}
async up(queryRunner) {
await queryRunner.query(
`ALTER TABLE "meta" ADD "pinnedClipId" character varying(32)`,
);
}
async down(queryRunner) {
await queryRunner.query(`ALTER TABLE "meta" DROP COLUMN "pinnedClipId"`);
}
}

View file

@ -1,15 +0,0 @@
export class registry31610283021566 {
constructor() {
this.name = "registry31610283021566";
}
async up(queryRunner) {
await queryRunner.query(
`ALTER TABLE "registry_item" ALTER COLUMN "value" DROP NOT NULL`,
);
}
async down(queryRunner) {
await queryRunner.query(
`ALTER TABLE "registry_item" ALTER COLUMN "value" SET NOT NULL`,
);
}
}

View file

@ -1,15 +0,0 @@
export class objectStorageS3ForcePathStyle1611547387175 {
constructor() {
this.name = "objectStorageS3ForcePathStyle1611547387175";
}
async up(queryRunner) {
await queryRunner.query(
`ALTER TABLE "meta" ADD "objectStorageS3ForcePathStyle" boolean NOT NULL DEFAULT true`,
);
}
async down(queryRunner) {
await queryRunner.query(
`ALTER TABLE "meta" DROP COLUMN "objectStorageS3ForcePathStyle"`,
);
}
}

View file

@ -1,15 +0,0 @@
export class announcementEmail1612619156584 {
constructor() {
this.name = "announcementEmail1612619156584";
}
async up(queryRunner) {
await queryRunner.query(
`ALTER TABLE "user_profile" ADD "receiveAnnouncementEmail" boolean NOT NULL DEFAULT true`,
);
}
async down(queryRunner) {
await queryRunner.query(
`ALTER TABLE "user_profile" DROP COLUMN "receiveAnnouncementEmail"`,
);
}
}

View file

@ -1,13 +0,0 @@
export class userLang1613181457597 {
constructor() {
this.name = "userLang1613181457597";
}
async up(queryRunner) {
await queryRunner.query(
`ALTER TABLE "user_profile" ADD "lang" character varying(32)`,
);
}
async down(queryRunner) {
await queryRunner.query(`ALTER TABLE "user_profile" DROP COLUMN "lang"`);
}
}

View file

@ -1,15 +0,0 @@
export class userHideOnlineStatus1618639857000 {
constructor() {
this.name = "userHideOnlineStatus1618639857000";
}
async up(queryRunner) {
await queryRunner.query(
`ALTER TABLE "user" ADD "hideOnlineStatus" boolean NOT NULL DEFAULT false`,
);
}
async down(queryRunner) {
await queryRunner.query(
`ALTER TABLE "user" DROP COLUMN "hideOnlineStatus"`,
);
}
}

View file

@ -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"`);
}
}

View file

@ -1,13 +0,0 @@
export class deeplIntegration1629024377804 {
constructor() {
this.name = "deeplIntegration1629024377804";
}
async up(queryRunner) {
await queryRunner.query(
`ALTER TABLE "meta" ADD "deeplAuthKey" character varying(128)`,
);
}
async down(queryRunner) {
await queryRunner.query(`ALTER TABLE "meta" DROP COLUMN "deeplAuthKey"`);
}
}

View file

@ -1,15 +0,0 @@
export class fixChannelUserId1629288472000 {
constructor() {
this.name = "fixChannelUserId1629288472000";
}
async up(queryRunner) {
await queryRunner.query(
`ALTER TABLE "channel" ALTER COLUMN "userId" DROP NOT NULL;`,
);
}
async down(queryRunner) {
await queryRunner.query(
`ALTER TABLE "channel" ALTER COLUMN "userId" SET NOT NULL;`,
);
}
}

View file

@ -1,13 +0,0 @@
export class deeplIntegration21629778475000 {
constructor() {
this.name = "deeplIntegration21629778475000";
}
async up(queryRunner) {
await queryRunner.query(
`ALTER TABLE "meta" ADD "deeplIsPro" boolean NOT NULL DEFAULT false`,
);
}
async down(queryRunner) {
await queryRunner.query(`ALTER TABLE "meta" DROP COLUMN "deeplIsPro"`);
}
}

View file

@ -1,15 +0,0 @@
export class emailRequiredForSignup1633068642000 {
constructor() {
this.name = "emailRequiredForSignup1633068642000";
}
async up(queryRunner) {
await queryRunner.query(
`ALTER TABLE "meta" ADD "emailRequiredForSignup" boolean NOT NULL DEFAULT false`,
);
}
async down(queryRunner) {
await queryRunner.query(
`ALTER TABLE "meta" DROP COLUMN "emailRequiredForSignup"`,
);
}
}

View file

@ -1,15 +0,0 @@
export class userPublicReactions1634486652000 {
constructor() {
this.name = "userPublicReactions1634486652000";
}
async up(queryRunner) {
await queryRunner.query(
`ALTER TABLE "user_profile" ADD "publicReactions" boolean NOT NULL DEFAULT false`,
);
}
async down(queryRunner) {
await queryRunner.query(
`ALTER TABLE "user_profile" DROP COLUMN "publicReactions"`,
);
}
}

View file

@ -1,9 +0,0 @@
export class deleteLog1634902659689 {
constructor() {
this.name = "deleteLog1634902659689";
}
async up(queryRunner) {
await queryRunner.query(`DROP TABLE "log"`);
}
async down(queryRunner) {}
}

View file

@ -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`,
);
}
}

View file

@ -1,15 +0,0 @@
export class forwardedReport1637320813000 {
name = "forwardedReport1637320813000";
async up(queryRunner) {
await queryRunner.query(
`ALTER TABLE "abuse_user_report" ADD "forwarded" boolean NOT NULL DEFAULT false`,
);
}
async down(queryRunner) {
await queryRunner.query(
`ALTER TABLE "abuse_user_report" DROP COLUMN "forwarded"`,
);
}
}

View file

@ -1,15 +0,0 @@
export class driveFileWebpublicType1642613870898 {
name = "driveFileWebpublicType1642613870898";
async up(queryRunner) {
await queryRunner.query(
`ALTER TABLE "drive_file" ADD "webpublicType" character varying(128)`,
);
}
async down(queryRunner) {
await queryRunner.query(
`ALTER TABLE "drive_file" DROP COLUMN "webpublicType"`,
);
}
}

View file

@ -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"`);
}
}

View file

@ -1,15 +0,0 @@
export class removeMaxNoteTextLength1645340161439 {
name = "removeMaxNoteTextLength1645340161439";
async up(queryRunner) {
await queryRunner.query(
`ALTER TABLE "meta" DROP COLUMN "maxNoteTextLength"`,
);
}
async down(queryRunner) {
await queryRunner.query(
`ALTER TABLE "meta" ADD "maxNoteTextLength" integer NOT NULL DEFAULT '500'`,
);
}
}

View file

@ -1,15 +0,0 @@
export class userModerationNote1656772790599 {
name = "userModerationNote1656772790599";
async up(queryRunner) {
await queryRunner.query(
`ALTER TABLE "user_profile" ADD "moderationNote" character varying(8192) NOT NULL DEFAULT ''`,
);
}
async down(queryRunner) {
await queryRunner.query(
`ALTER TABLE "user_profile" DROP COLUMN "moderationNote"`,
);
}
}

View file

@ -1,15 +0,0 @@
export class activeEmailValidation1657346559800 {
name = "activeEmailValidation1657346559800";
async up(queryRunner) {
await queryRunner.query(
`ALTER TABLE "meta" ADD "enableActiveEmailValidation" boolean NOT NULL DEFAULT true`,
);
}
async down(queryRunner) {
await queryRunner.query(
`ALTER TABLE "meta" DROP COLUMN "enableActiveEmailValidation"`,
);
}
}

View file

@ -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"`);
}
}

View file

@ -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"`,
);
}
}

View file

@ -1,13 +0,0 @@
export class GuestTimeline1660068273737 {
name = "GuestTimeline1660068273737";
async up(queryRunner) {
await queryRunner.query(
`ALTER TABLE "meta" ADD "enableGuestTimeline" boolean NOT NULL DEFAULT false`,
);
}
async down(queryRunner) {
await queryRunner.query(
`ALTER TABLE "meta" DROP COLUMN "enableGuestTimeline"`,
);
}
}

View file

@ -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"`);
}
}

View file

@ -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`,
);
}
}

View file

@ -1,15 +0,0 @@
export class whetherPushNotifyToSendReadMessage1669138716634 {
name = "whetherPushNotifyToSendReadMessage1669138716634";
async up(queryRunner) {
await queryRunner.query(
`ALTER TABLE "sw_subscription" ADD "sendReadMessage" boolean NOT NULL DEFAULT false`,
);
}
async down(queryRunner) {
await queryRunner.query(
`ALTER TABLE "sw_subscription" DROP COLUMN "sendReadMessage"`,
);
}
}

View file

@ -1,15 +0,0 @@
export class PollChoiceLength1673336077243 {
name = "PollChoiceLength1673336077243";
async up(queryRunner) {
await queryRunner.query(
`ALTER TABLE "poll" ALTER COLUMN "choices" TYPE character varying(256) array`,
);
}
async down(queryRunner) {
await queryRunner.query(
`ALTER TABLE "poll" ALTER COLUMN "choices" TYPE character varying(128) array`,
);
}
}

View file

@ -1,15 +0,0 @@
export class DriveComment1677935903517 {
name = "DriveComment1677935903517";
async up(queryRunner) {
await queryRunner.query(
`ALTER TABLE "drive_file" ALTER "comment" TYPE character varying(8192)`,
);
}
async down(queryRunner) {
await queryRunner.query(
`ALTER TABLE "drive_file" ALTER "comment" TYPE character varying(512)`,
);
}
}

View file

@ -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"`);
}
}

View file

@ -1,13 +0,0 @@
export class InstanceSilence1682891890317 {
name = "InstanceSilence1682891890317";
async up(queryRunner) {
await queryRunner.query(
`ALTER TABLE "meta" ADD "silencedHosts" character varying(256) array NOT NULL DEFAULT '{}'`,
);
}
async down(queryRunner) {
await queryRunner.query(`ALTER TABLE "meta" DROP COLUMN "silencedHosts"`);
}
}

View file

@ -1,15 +0,0 @@
export class AddHiddenPosts1682891891317 {
name = "AddHiddenPosts1682891891317";
async up(queryRunner) {
await queryRunner.query(
`ALTER TYPE note_visibility_enum ADD VALUE IF NOT EXISTS 'hidden'`,
);
}
async down(queryRunner) {
await queryRunner.query(
`ALTER TYPE note_visibility_enum REMOVE VALUE IF EXISTS 'hidden'`,
);
}
}

View file

@ -1,15 +0,0 @@
export class PreventAiLearning1683682889948 {
name = "PreventAiLearning1683682889948";
async up(queryRunner) {
await queryRunner.query(
`ALTER TABLE "user_profile" ADD "preventAiLearning" boolean NOT NULL DEFAULT true`,
);
}
async down(queryRunner) {
await queryRunner.query(
`ALTER TABLE "user_profile" DROP COLUMN "preventAiLearning"`,
);
}
}

View file

@ -1,16 +0,0 @@
export class ExperimentalFeatures1683980686995 {
name = "ExperimentalFeatures1683980686995";
async up(queryRunner) {
await queryRunner.query(`
ALTER TABLE "meta"
ADD "experimentalFeatures" jsonb NOT NULL DEFAULT '{}'
`);
}
async down(queryRunner) {
await queryRunner.query(`
ALTER TABLE "meta" DROP COLUMN "experimentalFeatures"
`);
}
}

View file

@ -1,15 +0,0 @@
export class RemoveShowTimelineReplies1684206886988 {
name = "RemoveShowTimelineReplies1684206886988";
async up(queryRunner) {
await queryRunner.query(
`ALTER TABLE "user" DROP COLUMN "showTimelineReplies"`,
);
}
async down(queryRunner) {
await queryRunner.query(
`ALTER TABLE "user" ADD "showTimelineReplies" boolean NOT NULL DEFAULT false`,
);
}
}

View file

@ -1,15 +0,0 @@
export class DonationLink1689136347561 {
name = "DonationLink1689136347561";
async up(queryRunner) {
await queryRunner.query(
`ALTER TABLE "meta" ADD "donationLink" character varying(256)`,
);
}
async down(queryRunner) {
await queryRunner.query(
`ALTER TABLE "meta" DROP COLUMN "DonationLink1689136347561"`,
);
}
}

View file

@ -1,13 +0,0 @@
export class AddPostLang1695334243217 {
name = "AddPostLang1695334243217";
async up(queryRunner) {
await queryRunner.query(
`ALTER TABLE "note" ADD "lang" character varying(10)`,
);
}
async down(queryRunner) {
await queryRunner.query(`ALTER TABLE "note" DROP COLUMN "lang"`);
}
}

View file

@ -1,13 +0,0 @@
export class MoreUrls1699305365258 {
name = "MoreUrls1699305365258";
async up(queryRunner) {
queryRunner.query(
`ALTER TABLE "meta" ADD "moreUrls" jsonb NOT NULL DEFAULT '[]'`,
);
}
async down(queryRunner) {
queryRunner.query(`ALTER TABLE "meta" DROP COLUMN "moreUrls"`);
}
}

View file

@ -1,13 +0,0 @@
export class DropUserProfileLanguage1708452631156 {
name = "DropUserProfileLanguage1708452631156";
async up(queryRunner) {
await queryRunner.query(`ALTER TABLE "user_profile" DROP COLUMN "lang"`);
}
async down(queryRunner) {
await queryRunner.query(
`ALTER TABLE "user_profile" ADD COLUMN "lang" character varying(32)`,
);
}
}

View file

@ -1,11 +0,0 @@
export class FixNoteUrlIndex1709129810501 {
name = "FixNoteUrlIndex1709129810501";
async up(queryRunner) {
await queryRunner.query(`DROP INDEX "IDX_note_url"`);
await queryRunner.query(`CREATE INDEX "IDX_note_url" ON "note" ("url")`);
}
async down(queryRunner) {
/* You don't revert this migration */
}
}

View file

@ -6,8 +6,8 @@
"scripts": {
"start": "pnpm node ./built/index.js",
"start:test": "NODE_ENV=test pnpm node ./built/index.js",
"migrate": "typeorm migration:run -d ormconfig.js",
"revertmigration": "typeorm migration:revert -d ormconfig.js",
"migrate": "typeorm migration:run --dataSource ./built/ormconfig.js",
"revertmigration": "typeorm migration:revert --dataSource ./built/ormconfig.js",
"check:connect": "node ./check_connect.js",
"build": "pnpm swc src --out-dir built --source-maps false --copy-files --strip-leading-paths",
"build:debug": "pnpm swc src --out-dir built --source-maps true --copy-files --strip-leading-paths",

View file

@ -1,5 +1,7 @@
export class Init1000000000000 {
async up(queryRunner) {
import { MigrationInterface, QueryRunner } from "typeorm";
export class Init1000000000000 implements MigrationInterface {
async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(
`CREATE TYPE "log_level_enum" AS ENUM('error', 'warning', 'info', 'success', 'debug')`,
);
@ -712,7 +714,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<void> {
await queryRunner.query(
`ALTER TABLE "user_profile" DROP CONSTRAINT "FK_51cb79b5555effaf7d69ba1cff9"`,
);

View file

@ -1,5 +1,7 @@
export class Pages1556348509290 {
async up(queryRunner) {
import { MigrationInterface, QueryRunner } from "typeorm";
export class Pages1556348509290 implements MigrationInterface {
async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(
`CREATE TYPE "page_visibility_enum" AS ENUM('public', 'followers', 'specified')`,
);
@ -31,7 +33,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<void> {
await queryRunner.query(
`ALTER TABLE "page" DROP CONSTRAINT "FK_3126dd7c502c9e4d7597ef7ef10"`,
);

View file

@ -1,5 +1,7 @@
export class UserProfile1556746559567 {
async up(queryRunner) {
import { MigrationInterface, QueryRunner } from "typeorm";
export class UserProfile1556746559567 implements MigrationInterface {
async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(
`ALTER TABLE "user_profile" ALTER COLUMN "githubId" TYPE VARCHAR(64) USING "githubId"::VARCHAR(64)`,
);
@ -7,7 +9,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<void> {
await queryRunner.query(
`UPDATE "user_profile" SET github = FALSE, discord = FALSE`,
);

View file

@ -0,0 +1,12 @@
import { MigrationInterface, QueryRunner } from "typeorm";
export class PinnedUsers1557476068003 implements MigrationInterface {
async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(
`ALTER TABLE "meta" ADD "pinnedUsers" character varying(256) array NOT NULL DEFAULT '{}'::varchar[]`,
);
}
async down(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`ALTER TABLE "meta" DROP COLUMN "pinnedUsers"`);
}
}

View file

@ -1,5 +1,7 @@
export class AddSomeUrls1557761316509 {
async up(queryRunner) {
import { MigrationInterface, QueryRunner } from "typeorm";
export class AddSomeUrls1557761316509 implements MigrationInterface {
async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(
`ALTER TABLE "meta" ADD "ToSUrl" character varying(512)`,
);
@ -10,7 +12,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<void> {
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"`);

View file

@ -1,5 +1,7 @@
export class ObjectStorageSetting1557932705754 {
async up(queryRunner) {
import { MigrationInterface, QueryRunner } from "typeorm";
export class ObjectStorageSetting1557932705754 implements MigrationInterface {
async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(
`ALTER TABLE "meta" ADD "useObjectStorage" boolean NOT NULL DEFAULT false`,
);
@ -31,7 +33,7 @@ export class ObjectStorageSetting1557932705754 {
`ALTER TABLE "meta" ADD "objectStorageUseSSL" boolean NOT NULL DEFAULT true`,
);
}
async down(queryRunner) {
async down(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(
`ALTER TABLE "meta" DROP COLUMN "objectStorageUseSSL"`,
);

View file

@ -1,5 +1,7 @@
export class PageLike1558072954435 {
async up(queryRunner) {
import { MigrationInterface, QueryRunner } from "typeorm";
export class PageLike1558072954435 implements MigrationInterface {
async up(queryRunner: QueryRunner): Promise<void> {
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 +21,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<void> {
await queryRunner.query(
`ALTER TABLE "page_like" DROP CONSTRAINT "FK_cf8782626dced3176038176a847"`,
);

View file

@ -1,5 +1,7 @@
export class UserGroup1558103093633 {
async up(queryRunner) {
import { MigrationInterface, QueryRunner } from "typeorm";
export class UserGroup1558103093633 implements MigrationInterface {
async up(queryRunner: QueryRunner): Promise<void> {
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 +48,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<void> {
await queryRunner.query(
`ALTER TABLE "user_group_joining" DROP CONSTRAINT "FK_67dc758bc0566985d1b3d399865"`,
);

View file

@ -1,5 +1,7 @@
export class UserGroupInvite1558257926829 {
async up(queryRunner) {
import { MigrationInterface, QueryRunner } from "typeorm";
export class UserGroupInvite1558257926829 implements MigrationInterface {
async up(queryRunner: QueryRunner): Promise<void> {
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 +24,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<void> {
await queryRunner.query(
`ALTER TABLE "user_group_invite" DROP CONSTRAINT "FK_e10924607d058004304611a436a"`,
);

View file

@ -0,0 +1,12 @@
import { MigrationInterface, QueryRunner } from "typeorm";
export class UserListJoining1558266512381 implements MigrationInterface {
async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(
`CREATE UNIQUE INDEX "IDX_90f7da835e4c10aca6853621e1" ON "user_list_joining" ("userId", "userListId") `,
);
}
async down(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`DROP INDEX "IDX_90f7da835e4c10aca6853621e1"`);
}
}

View file

@ -1,5 +1,7 @@
export class webauthn1561706992953 {
async up(queryRunner) {
import { MigrationInterface, QueryRunner } from "typeorm";
export class webauthn1561706992953 implements MigrationInterface {
async up(queryRunner: QueryRunner): Promise<void> {
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 +30,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<void> {
await queryRunner.query(
`ALTER TABLE "user_security_key" DROP CONSTRAINT "FK_ff9ca3b5f3ee3d0681367a9b447"`,
);

View file

@ -1,5 +1,7 @@
export class ChartIndexes1561873850023 {
async up(queryRunner) {
import { MigrationInterface, QueryRunner } from "typeorm";
export class ChartIndexes1561873850023 implements MigrationInterface {
async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(
`CREATE INDEX "IDX_0ad37b7ef50f4ddc84363d7ccc" ON "__chart__active_users" ("date") `,
);
@ -271,7 +273,7 @@ export class ChartIndexes1561873850023 {
`CREATE INDEX "IDX_a770a57c70e668cc61590c9161" ON "__chart__users" ("span", "date", "group") `,
);
}
async down(queryRunner) {
async down(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`DROP INDEX "IDX_a770a57c70e668cc61590c9161"`);
await queryRunner.query(`DROP INDEX "IDX_337e9599f278bd7537fe30876f"`);
await queryRunner.query(`DROP INDEX "IDX_f091abb24193d50c653c6b77fc"`);

View file

@ -0,0 +1,14 @@
import { MigrationInterface, QueryRunner } from "typeorm";
export class PasswordLessLogin1562422242907 implements MigrationInterface {
async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(
`ALTER TABLE "user_profile" ADD COLUMN "usePasswordLessLogin" boolean DEFAULT false NOT NULL`,
);
}
async down(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(
`ALTER TABLE "user_profile" DROP COLUMN "usePasswordLessLogin"`,
);
}
}

View file

@ -1,5 +1,7 @@
export class PinnedPage1562444565093 {
async up(queryRunner) {
import { MigrationInterface, QueryRunner } from "typeorm";
export class PinnedPage1562444565093 implements MigrationInterface {
async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(
`ALTER TABLE "user_profile" ADD "pinnedPageId" character varying(32)`,
);
@ -10,7 +12,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<void> {
await queryRunner.query(
`ALTER TABLE "user_profile" DROP CONSTRAINT "FK_6dc44f1ceb65b1e72bacef2ca27"`,
);

View file

@ -0,0 +1,14 @@
import { MigrationInterface, QueryRunner } from "typeorm";
export class PageTitleHideOption1562448332510 implements MigrationInterface {
async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(
`ALTER TABLE "page" ADD "hideTitleWhenPinned" boolean NOT NULL DEFAULT false`,
);
}
async down(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(
`ALTER TABLE "page" DROP COLUMN "hideTitleWhenPinned"`,
);
}
}

View file

@ -1,5 +1,7 @@
export class ModerationLog1562869971568 {
async up(queryRunner) {
import { MigrationInterface, QueryRunner } from "typeorm";
export class ModerationLog1562869971568 implements MigrationInterface {
async up(queryRunner: QueryRunner): Promise<void> {
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 +12,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<void> {
await queryRunner.query(
`ALTER TABLE "moderation_log" DROP CONSTRAINT "FK_a08ad074601d204e0f69da9a954"`,
);

View file

@ -1,10 +1,12 @@
export class UsedUsername1563757595828 {
async up(queryRunner) {
import { MigrationInterface, QueryRunner } from "typeorm";
export class UsedUsername1563757595828 implements MigrationInterface {
async up(queryRunner: QueryRunner): Promise<void> {
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<void> {
await queryRunner.query(`DROP TABLE "used_username"`);
}
}

View file

@ -0,0 +1,12 @@
import { MigrationInterface, QueryRunner } from "typeorm";
export class room1565634203341 implements MigrationInterface {
async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(
`ALTER TABLE "user_profile" ADD "room" jsonb NOT NULL DEFAULT '{}'`,
);
}
async down(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`ALTER TABLE "user_profile" DROP COLUMN "room"`);
}
}

View file

@ -0,0 +1,16 @@
import { MigrationInterface, QueryRunner } from "typeorm";
export class CustomEmojiCategory1571220798684 implements MigrationInterface {
async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(
`ALTER TABLE "emoji" ADD "category" character varying(128)`,
undefined,
);
}
async down(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(
`ALTER TABLE "emoji" DROP COLUMN "category"`,
undefined,
);
}
}

View file

@ -1,5 +1,7 @@
export class nodeinfo1572760203493 {
async up(queryRunner) {
import { MigrationInterface, QueryRunner } from "typeorm";
export class nodeinfo1572760203493 implements MigrationInterface {
async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(
`ALTER TABLE "instance" DROP COLUMN "system"`,
undefined,
@ -37,7 +39,7 @@ export class nodeinfo1572760203493 {
undefined,
);
}
async down(queryRunner) {
async down(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(
`ALTER TABLE "instance" DROP COLUMN "infoUpdatedAt"`,
undefined,

View file

@ -0,0 +1,16 @@
import { MigrationInterface, QueryRunner } from "typeorm";
export class TalkFederationId1576269851876 implements MigrationInterface {
async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(
`ALTER TABLE "messaging_message" ADD "uri" character varying(512)`,
undefined,
);
}
async down(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(
`ALTER TABLE "messaging_message" DROP COLUMN "uri"`,
undefined,
);
}
}

View file

@ -0,0 +1,16 @@
import { MigrationInterface, QueryRunner } from "typeorm";
export class ProxyRemoteFiles1576869585998 implements MigrationInterface {
async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(
`ALTER TABLE "meta" ADD "proxyRemoteFiles" boolean NOT NULL DEFAULT false`,
undefined,
);
}
async down(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(
`ALTER TABLE "meta" DROP COLUMN "proxyRemoteFiles"`,
undefined,
);
}
}

View file

@ -1,8 +1,7 @@
export class v121579267006611 {
constructor() {
this.name = "v121579267006611";
}
async up(queryRunner) {
import { MigrationInterface, QueryRunner } from "typeorm";
export class v121579267006611 implements MigrationInterface {
async up(queryRunner: QueryRunner): Promise<void> {
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 +47,7 @@ export class v121579267006611 {
undefined,
);
}
async down(queryRunner) {
async down(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(
`ALTER TABLE "announcement_read" DROP CONSTRAINT "FK_603a7b1e7aa0533c6c88e9bfafe"`,
undefined,

View file

@ -1,14 +1,13 @@
export class v1221579270193251 {
constructor() {
this.name = "v1221579270193251";
}
async up(queryRunner) {
import { MigrationInterface, QueryRunner } from "typeorm";
export class v1221579270193251 implements MigrationInterface {
async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(
`ALTER TABLE "announcement_read" ADD "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL`,
undefined,
);
}
async down(queryRunner) {
async down(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(
`ALTER TABLE "announcement_read" DROP COLUMN "createdAt"`,
undefined,

View file

@ -1,14 +1,13 @@
export class v1231579282808087 {
constructor() {
this.name = "v1231579282808087";
}
async up(queryRunner) {
import { MigrationInterface, QueryRunner } from "typeorm";
export class v1231579282808087 implements MigrationInterface {
async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(
`ALTER TABLE "announcement" ADD "updatedAt" TIMESTAMP WITH TIME ZONE`,
undefined,
);
}
async down(queryRunner) {
async down(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(
`ALTER TABLE "announcement" DROP COLUMN "updatedAt"`,
undefined,

View file

@ -1,8 +1,7 @@
export class v1241579544426412 {
constructor() {
this.name = "v1241579544426412";
}
async up(queryRunner) {
import { MigrationInterface, QueryRunner } from "typeorm";
export class v1241579544426412 implements MigrationInterface {
async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(
`ALTER TABLE "notification" ADD "followRequestId" character varying(32)`,
undefined,
@ -12,7 +11,7 @@ export class v1241579544426412 {
undefined,
);
}
async down(queryRunner) {
async down(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(
`ALTER TABLE "notification" DROP CONSTRAINT "FK_bd7fab507621e635b32cd31892c"`,
undefined,

View file

@ -1,8 +1,7 @@
export class v1251579977526288 {
constructor() {
this.name = "v1251579977526288";
}
async up(queryRunner) {
import { MigrationInterface, QueryRunner } from "typeorm";
export class v1251579977526288 implements MigrationInterface {
async up(queryRunner: QueryRunner): Promise<void> {
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 +84,7 @@ export class v1251579977526288 {
undefined,
);
}
async down(queryRunner) {
async down(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(
`ALTER TABLE "antenna_note" DROP CONSTRAINT "FK_0d775946662d2575dfd2068a5f5"`,
undefined,

View file

@ -1,8 +1,7 @@
export class v1261579993013959 {
constructor() {
this.name = "v1261579993013959";
}
async up(queryRunner) {
import { MigrationInterface, QueryRunner } from "typeorm";
export class v1261579993013959 implements MigrationInterface {
async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(
`ALTER TABLE "antenna" DROP COLUMN "hasNewNote"`,
undefined,
@ -16,7 +15,7 @@ export class v1261579993013959 {
undefined,
);
}
async down(queryRunner) {
async down(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(
`DROP INDEX "IDX_9937ea48d7ae97ffb4f3f063a4"`,
undefined,

View file

@ -1,8 +1,7 @@
export class v1271580069531114 {
constructor() {
this.name = "v1271580069531114";
}
async up(queryRunner) {
import { MigrationInterface, QueryRunner } from "typeorm";
export class v1271580069531114 implements MigrationInterface {
async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(
`ALTER TABLE "antenna" ADD "users" character varying(1024) array NOT NULL DEFAULT '{}'::varchar[]`,
undefined,
@ -25,7 +24,7 @@ export class v1271580069531114 {
);
await queryRunner.query(`DROP TYPE "antenna_src_enum_old"`, undefined);
}
async down(queryRunner) {
async down(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(
`CREATE TYPE "antenna_src_enum_old" AS ENUM('home', 'all', 'list')`,
undefined,

View file

@ -1,8 +1,7 @@
export class v1281580148575182 {
constructor() {
this.name = "v1281580148575182";
}
async up(queryRunner) {
import { MigrationInterface, QueryRunner } from "typeorm";
export class v1281580148575182 implements MigrationInterface {
async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(
`ALTER TABLE "note" DROP CONSTRAINT "FK_ec5c201576192ba8904c345c5cc"`,
undefined,
@ -12,7 +11,7 @@ export class v1281580148575182 {
undefined,
);
}
async down(queryRunner) {
async down(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(
`ALTER TABLE "note" ADD "appId" character varying(32)`,
undefined,

View file

@ -1,14 +1,13 @@
export class v1291580154400017 {
constructor() {
this.name = "v1291580154400017";
}
async up(queryRunner) {
import { MigrationInterface, QueryRunner } from "typeorm";
export class v1291580154400017 implements MigrationInterface {
async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(
`ALTER TABLE "antenna" ADD "withReplies" boolean NOT NULL DEFAULT false`,
undefined,
);
}
async down(queryRunner) {
async down(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(
`ALTER TABLE "antenna" DROP COLUMN "withReplies"`,
undefined,

View file

@ -1,8 +1,7 @@
export class v12101580276619901 {
constructor() {
this.name = "v12101580276619901";
}
async up(queryRunner) {
import { MigrationInterface, QueryRunner } from "typeorm";
export class v12101580276619901 implements MigrationInterface {
async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`TRUNCATE TABLE "notification"`, undefined);
await queryRunner.query(
`ALTER TABLE "notification" DROP COLUMN "type"`,
@ -17,7 +16,7 @@ export class v12101580276619901 {
undefined,
);
}
async down(queryRunner) {
async down(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(
`ALTER TABLE "notification" DROP COLUMN "type"`,
undefined,

View file

@ -1,8 +1,7 @@
export class v12111580331224276 {
constructor() {
this.name = "v12111580331224276";
}
async up(queryRunner) {
import { MigrationInterface, QueryRunner } from "typeorm";
export class v12111580331224276 implements MigrationInterface {
async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(
`ALTER TABLE "instance" DROP COLUMN "isMarkedAsClosed"`,
undefined,
@ -16,7 +15,7 @@ export class v12111580331224276 {
undefined,
);
}
async down(queryRunner) {
async down(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(
`DROP INDEX "IDX_34500da2e38ac393f7bb6b299c"`,
undefined,

View file

@ -1,8 +1,7 @@
export class v12121580508795118 {
constructor() {
this.name = "v12121580508795118";
}
async up(queryRunner) {
import { MigrationInterface, QueryRunner } from "typeorm";
export class v12121580508795118 implements MigrationInterface {
async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(
`ALTER TABLE "user_profile" DROP COLUMN "twitter"`,
undefined,
@ -72,7 +71,7 @@ export class v12121580508795118 {
undefined,
);
}
async down(queryRunner) {
async down(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(
`ALTER TABLE "user_profile" DROP COLUMN "integrations"`,
undefined,

View file

@ -0,0 +1,13 @@
import { MigrationInterface, QueryRunner } from "typeorm";
export class v12131580543501339 implements MigrationInterface {
async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(
`CREATE INDEX "IDX_NOTE_TAGS" ON "note" USING gin ("tags")`,
undefined,
);
}
async down(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`DROP INDEX "IDX_NOTE_TAGS"`, undefined);
}
}

View file

@ -1,8 +1,7 @@
export class v12141580864313253 {
constructor() {
this.name = "v12141580864313253";
}
async up(queryRunner) {
import { MigrationInterface, QueryRunner } from "typeorm";
export class v12141580864313253 implements MigrationInterface {
async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(
`ALTER TABLE "meta" RENAME COLUMN "proxyAccount" TO "proxyAccountId"`,
undefined,
@ -20,7 +19,7 @@ export class v12141580864313253 {
undefined,
);
}
async down(queryRunner) {
async down(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(
`ALTER TABLE "meta" DROP CONSTRAINT "FK_ab1bc0c1e209daa77b8e8d212ad"`,
undefined,

View file

@ -1,8 +1,7 @@
export class userGroupInvitation1581526429287 {
constructor() {
this.name = "userGroupInvitation1581526429287";
}
async up(queryRunner) {
import { MigrationInterface, QueryRunner } from "typeorm";
export class userGroupInvitation1581526429287 implements MigrationInterface {
async up(queryRunner: QueryRunner): Promise<void> {
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 +55,7 @@ export class userGroupInvitation1581526429287 {
undefined,
);
}
async down(queryRunner) {
async down(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(
`ALTER TABLE "notification" DROP CONSTRAINT "FK_8fe87814e978053a53b1beb7e98"`,
undefined,

Some files were not shown because too many files have changed in this diff Show more