|
|
@ -1,7 +1,5 @@
|
|
|
|
const { MigrationInterface, QueryRunner } = require("typeorm");
|
|
|
|
export class FixOrm1731198456911 {
|
|
|
|
|
|
|
|
name = 'FixOrm1731198456911'
|
|
|
|
module.exports = class FollowsPrivateDefault1731116262060 {
|
|
|
|
|
|
|
|
name = 'FollowsPrivateDefault1731116262060'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
async up(queryRunner) {
|
|
|
|
async up(queryRunner) {
|
|
|
|
await queryRunner.query(`ALTER TABLE "user" DROP CONSTRAINT "FK_q5lm0tbgejtfskzg0rc4wd7t1n"`);
|
|
|
|
await queryRunner.query(`ALTER TABLE "user" DROP CONSTRAINT "FK_q5lm0tbgejtfskzg0rc4wd7t1n"`);
|
|
|
@ -22,32 +20,20 @@ module.exports = class FollowsPrivateDefault1731116262060 {
|
|
|
|
await queryRunner.query(`COMMENT ON COLUMN "note"."updatedAt" IS 'The update time of the Note.'`);
|
|
|
|
await queryRunner.query(`COMMENT ON COLUMN "note"."updatedAt" IS 'The update time of the Note.'`);
|
|
|
|
await queryRunner.query(`ALTER TABLE "system_webhook" ALTER COLUMN "updatedAt" SET DEFAULT now()`);
|
|
|
|
await queryRunner.query(`ALTER TABLE "system_webhook" ALTER COLUMN "updatedAt" SET DEFAULT now()`);
|
|
|
|
await queryRunner.query(`COMMENT ON COLUMN "user_profile"."listenbrainz" IS 'The ListenBrainz username of the User.'`);
|
|
|
|
await queryRunner.query(`COMMENT ON COLUMN "user_profile"."listenbrainz" IS 'The ListenBrainz username of the User.'`);
|
|
|
|
await queryRunner.query(`ALTER TABLE "user_profile" ALTER COLUMN "publicReactions" SET DEFAULT false`);
|
|
|
|
|
|
|
|
await queryRunner.query(`ALTER TABLE "user_profile" ALTER COLUMN "followingVisibility" SET DEFAULT 'private'`);
|
|
|
|
|
|
|
|
await queryRunner.query(`ALTER TYPE "public"."user_profile_followersVisibility_enum" RENAME TO "user_profile_followersVisibility_enum_old"`);
|
|
|
|
await queryRunner.query(`ALTER TYPE "public"."user_profile_followersVisibility_enum" RENAME TO "user_profile_followersVisibility_enum_old"`);
|
|
|
|
await queryRunner.query(`CREATE TYPE "public"."user_profile_followersvisibility_enum" AS ENUM('public', 'followers', 'private')`);
|
|
|
|
await queryRunner.query(`CREATE TYPE "public"."user_profile_followersvisibility_enum" AS ENUM('public', 'followers', 'private')`);
|
|
|
|
await queryRunner.query(`ALTER TABLE "user_profile" ALTER COLUMN "followersVisibility" DROP DEFAULT`);
|
|
|
|
await queryRunner.query(`ALTER TABLE "user_profile" ALTER COLUMN "followersVisibility" DROP DEFAULT`);
|
|
|
|
await queryRunner.query(`ALTER TABLE "user_profile" ALTER COLUMN "followersVisibility" TYPE "public"."user_profile_followersvisibility_enum" USING "followersVisibility"::"text"::"public"."user_profile_followersvisibility_enum"`);
|
|
|
|
await queryRunner.query(`ALTER TABLE "user_profile" ALTER COLUMN "followersVisibility" TYPE "public"."user_profile_followersvisibility_enum" USING "followersVisibility"::"text"::"public"."user_profile_followersvisibility_enum"`);
|
|
|
|
await queryRunner.query(`ALTER TABLE "user_profile" ALTER COLUMN "followersVisibility" SET DEFAULT 'private'`);
|
|
|
|
await queryRunner.query(`ALTER TABLE "user_profile" ALTER COLUMN "followersVisibility" SET DEFAULT 'public'`);
|
|
|
|
await queryRunner.query(`DROP TYPE "public"."user_profile_followersVisibility_enum_old"`);
|
|
|
|
await queryRunner.query(`DROP TYPE "public"."user_profile_followersVisibility_enum_old"`);
|
|
|
|
await queryRunner.query(`ALTER TABLE "abuse_report_notification_recipient" DROP CONSTRAINT "FK_abuse_report_notification_recipient_userId1"`);
|
|
|
|
await queryRunner.query(`ALTER TABLE "abuse_report_notification_recipient" DROP CONSTRAINT "FK_abuse_report_notification_recipient_userId1"`);
|
|
|
|
await queryRunner.query(`ALTER TABLE "abuse_report_notification_recipient" ALTER COLUMN "updatedAt" SET DEFAULT now()`);
|
|
|
|
await queryRunner.query(`ALTER TABLE "abuse_report_notification_recipient" ALTER COLUMN "updatedAt" SET DEFAULT now()`);
|
|
|
|
await queryRunner.query(`ALTER TABLE "abuse_report_notification_recipient" ALTER COLUMN "userId" DROP DEFAULT`);
|
|
|
|
await queryRunner.query(`ALTER TABLE "abuse_report_notification_recipient" ALTER COLUMN "userId" DROP DEFAULT`);
|
|
|
|
await queryRunner.query(`ALTER TABLE "abuse_report_notification_recipient" ALTER COLUMN "systemWebhookId" DROP DEFAULT`);
|
|
|
|
await queryRunner.query(`ALTER TABLE "abuse_report_notification_recipient" ALTER COLUMN "systemWebhookId" DROP DEFAULT`);
|
|
|
|
await queryRunner.query(`ALTER TABLE "meta" ALTER COLUMN "disableRegistration" SET DEFAULT false`);
|
|
|
|
|
|
|
|
await queryRunner.query(`ALTER TABLE "meta" ALTER COLUMN "repositoryUrl" SET NOT NULL`);
|
|
|
|
|
|
|
|
await queryRunner.query(`ALTER TABLE "meta" ALTER COLUMN "preservedUsernames" SET DEFAULT '{ "admin", "administrator", "root", "system", "maintainer", "host", "mod", "moderator", "owner", "superuser", "staff", "auth", "i", "me", "everyone", "all", "mention", "mentions", "example", "user", "users", "account", "accounts", "official", "help", "helps", "support", "supports", "info", "information", "informations", "announce", "announces", "announcement", "announcements", "notice", "notification", "notifications", "dev", "developer", "developers", "tech", "misskey" }'`);
|
|
|
|
await queryRunner.query(`ALTER TABLE "meta" ALTER COLUMN "preservedUsernames" SET DEFAULT '{ "admin", "administrator", "root", "system", "maintainer", "host", "mod", "moderator", "owner", "superuser", "staff", "auth", "i", "me", "everyone", "all", "mention", "mentions", "example", "user", "users", "account", "accounts", "official", "help", "helps", "support", "supports", "info", "information", "informations", "announce", "announces", "announcement", "announcements", "notice", "notification", "notifications", "dev", "developer", "developers", "tech", "misskey" }'`);
|
|
|
|
await queryRunner.query(`ALTER TABLE "meta" ALTER COLUMN "perLocalUserUserTimelineCacheMax" SET DEFAULT '300'`);
|
|
|
|
|
|
|
|
await queryRunner.query(`ALTER TABLE "meta" ALTER COLUMN "perRemoteUserUserTimelineCacheMax" SET DEFAULT '100'`);
|
|
|
|
|
|
|
|
await queryRunner.query(`ALTER TABLE "meta" ALTER COLUMN "perUserHomeTimelineCacheMax" SET DEFAULT '300'`);
|
|
|
|
|
|
|
|
await queryRunner.query(`ALTER TABLE "meta" ALTER COLUMN "perUserListTimelineCacheMax" SET DEFAULT '300'`);
|
|
|
|
|
|
|
|
await queryRunner.query(`ALTER TABLE "meta" ALTER COLUMN "defaultLike" DROP DEFAULT`);
|
|
|
|
|
|
|
|
await queryRunner.query(`ALTER TABLE "meta" ALTER COLUMN "urlPreviewRequireContentLength" SET DEFAULT true`);
|
|
|
|
|
|
|
|
await queryRunner.query(`ALTER TABLE "meta" ALTER COLUMN "urlPreviewUserAgent" DROP DEFAULT`);
|
|
|
|
await queryRunner.query(`ALTER TABLE "meta" ALTER COLUMN "urlPreviewUserAgent" DROP DEFAULT`);
|
|
|
|
await queryRunner.query(`COMMENT ON COLUMN "meta"."trustedLinkUrlPatterns" IS 'An array of URL strings or regex that can be used to omit warnings about redirects to external sites. Separate them with spaces to specify AND, and enclose them with slashes to specify regular expressions. Each item is regarded as an OR.'`);
|
|
|
|
await queryRunner.query(`COMMENT ON COLUMN "meta"."trustedLinkUrlPatterns" IS 'An array of URL strings or regex that can be used to omit warnings about redirects to external sites. Separate them with spaces to specify AND, and enclose them with slashes to specify regular expressions. Each item is regarded as an OR.'`);
|
|
|
|
await queryRunner.query(`ALTER TABLE "user_pending" ALTER COLUMN "reason" SET NOT NULL`);
|
|
|
|
|
|
|
|
await queryRunner.query(`ALTER TABLE "flash" ALTER COLUMN "visibility" SET NOT NULL`);
|
|
|
|
await queryRunner.query(`ALTER TABLE "flash" ALTER COLUMN "visibility" SET NOT NULL`);
|
|
|
|
await queryRunner.query(`ALTER TABLE "note_edit" ALTER COLUMN "oldDate" SET NOT NULL`);
|
|
|
|
|
|
|
|
await queryRunner.query(`COMMENT ON COLUMN "note_edit"."oldDate" IS 'The old date from before the edit'`);
|
|
|
|
await queryRunner.query(`COMMENT ON COLUMN "note_edit"."oldDate" IS 'The old date from before the edit'`);
|
|
|
|
await queryRunner.query(`CREATE INDEX "IDX_58699f75b9cf904f5f007909cb" ON "user_profile" ("birthday") `);
|
|
|
|
await queryRunner.query(`CREATE INDEX "IDX_58699f75b9cf904f5f007909cb" ON "user_profile" ("birthday") `);
|
|
|
|
await queryRunner.query(`CREATE INDEX "IDX_bd5de500bac2e158a7bf8426e8" ON "abuse_report_notification_recipient" ("isActive") `);
|
|
|
|
await queryRunner.query(`CREATE INDEX "IDX_bd5de500bac2e158a7bf8426e8" ON "abuse_report_notification_recipient" ("isActive") `);
|
|
|
@ -85,20 +71,10 @@ module.exports = class FollowsPrivateDefault1731116262060 {
|
|
|
|
await queryRunner.query(`DROP INDEX "public"."IDX_bd5de500bac2e158a7bf8426e8"`);
|
|
|
|
await queryRunner.query(`DROP INDEX "public"."IDX_bd5de500bac2e158a7bf8426e8"`);
|
|
|
|
await queryRunner.query(`DROP INDEX "public"."IDX_58699f75b9cf904f5f007909cb"`);
|
|
|
|
await queryRunner.query(`DROP INDEX "public"."IDX_58699f75b9cf904f5f007909cb"`);
|
|
|
|
await queryRunner.query(`COMMENT ON COLUMN "note_edit"."oldDate" IS NULL`);
|
|
|
|
await queryRunner.query(`COMMENT ON COLUMN "note_edit"."oldDate" IS NULL`);
|
|
|
|
await queryRunner.query(`ALTER TABLE "note_edit" ALTER COLUMN "oldDate" DROP NOT NULL`);
|
|
|
|
|
|
|
|
await queryRunner.query(`ALTER TABLE "flash" ALTER COLUMN "visibility" DROP NOT NULL`);
|
|
|
|
await queryRunner.query(`ALTER TABLE "flash" ALTER COLUMN "visibility" DROP NOT NULL`);
|
|
|
|
await queryRunner.query(`ALTER TABLE "user_pending" ALTER COLUMN "reason" DROP NOT NULL`);
|
|
|
|
|
|
|
|
await queryRunner.query(`COMMENT ON COLUMN "meta"."trustedLinkUrlPatterns" IS NULL`);
|
|
|
|
await queryRunner.query(`COMMENT ON COLUMN "meta"."trustedLinkUrlPatterns" IS NULL`);
|
|
|
|
await queryRunner.query(`ALTER TABLE "meta" ALTER COLUMN "urlPreviewUserAgent" SET DEFAULT NULL`);
|
|
|
|
await queryRunner.query(`ALTER TABLE "meta" ALTER COLUMN "urlPreviewUserAgent" SET DEFAULT NULL`);
|
|
|
|
await queryRunner.query(`ALTER TABLE "meta" ALTER COLUMN "urlPreviewRequireContentLength" SET DEFAULT false`);
|
|
|
|
|
|
|
|
await queryRunner.query(`ALTER TABLE "meta" ALTER COLUMN "defaultLike" SET DEFAULT '❤️'`);
|
|
|
|
|
|
|
|
await queryRunner.query(`ALTER TABLE "meta" ALTER COLUMN "perUserListTimelineCacheMax" SET DEFAULT '800'`);
|
|
|
|
|
|
|
|
await queryRunner.query(`ALTER TABLE "meta" ALTER COLUMN "perUserHomeTimelineCacheMax" SET DEFAULT '800'`);
|
|
|
|
|
|
|
|
await queryRunner.query(`ALTER TABLE "meta" ALTER COLUMN "perRemoteUserUserTimelineCacheMax" SET DEFAULT '800'`);
|
|
|
|
|
|
|
|
await queryRunner.query(`ALTER TABLE "meta" ALTER COLUMN "perLocalUserUserTimelineCacheMax" SET DEFAULT '800'`);
|
|
|
|
|
|
|
|
await queryRunner.query(`ALTER TABLE "meta" ALTER COLUMN "preservedUsernames" SET DEFAULT '{admin,administrator,root,system,maintainer,host,mod,moderator,owner,superuser,staff,auth,i,me,everyone,all,mention,mentions,example,user,users,account,accounts,official,help,helps,support,supports,info,information,informations,announce,announces,announcement,announcements,notice,notification,notifications,dev,developer,developers,tech,misskey}'`);
|
|
|
|
await queryRunner.query(`ALTER TABLE "meta" ALTER COLUMN "preservedUsernames" SET DEFAULT '{admin,administrator,root,system,maintainer,host,mod,moderator,owner,superuser,staff,auth,i,me,everyone,all,mention,mentions,example,user,users,account,accounts,official,help,helps,support,supports,info,information,informations,announce,announces,announcement,announcements,notice,notification,notifications,dev,developer,developers,tech,misskey}'`);
|
|
|
|
await queryRunner.query(`ALTER TABLE "meta" ALTER COLUMN "repositoryUrl" DROP NOT NULL`);
|
|
|
|
|
|
|
|
await queryRunner.query(`ALTER TABLE "meta" ALTER COLUMN "disableRegistration" SET DEFAULT true`);
|
|
|
|
|
|
|
|
await queryRunner.query(`ALTER TABLE "abuse_report_notification_recipient" ALTER COLUMN "systemWebhookId" SET DEFAULT NULL`);
|
|
|
|
await queryRunner.query(`ALTER TABLE "abuse_report_notification_recipient" ALTER COLUMN "systemWebhookId" SET DEFAULT NULL`);
|
|
|
|
await queryRunner.query(`ALTER TABLE "abuse_report_notification_recipient" ALTER COLUMN "userId" SET DEFAULT NULL`);
|
|
|
|
await queryRunner.query(`ALTER TABLE "abuse_report_notification_recipient" ALTER COLUMN "userId" SET DEFAULT NULL`);
|
|
|
|
await queryRunner.query(`ALTER TABLE "abuse_report_notification_recipient" ALTER COLUMN "updatedAt" SET DEFAULT CURRENT_TIMESTAMP`);
|
|
|
|
await queryRunner.query(`ALTER TABLE "abuse_report_notification_recipient" ALTER COLUMN "updatedAt" SET DEFAULT CURRENT_TIMESTAMP`);
|
|
|
@ -109,8 +85,6 @@ module.exports = class FollowsPrivateDefault1731116262060 {
|
|
|
|
await queryRunner.query(`ALTER TABLE "user_profile" ALTER COLUMN "followersVisibility" SET DEFAULT 'public'`);
|
|
|
|
await queryRunner.query(`ALTER TABLE "user_profile" ALTER COLUMN "followersVisibility" SET DEFAULT 'public'`);
|
|
|
|
await queryRunner.query(`DROP TYPE "public"."user_profile_followersvisibility_enum"`);
|
|
|
|
await queryRunner.query(`DROP TYPE "public"."user_profile_followersvisibility_enum"`);
|
|
|
|
await queryRunner.query(`ALTER TYPE "public"."user_profile_followersVisibility_enum_old" RENAME TO "user_profile_followersVisibility_enum"`);
|
|
|
|
await queryRunner.query(`ALTER TYPE "public"."user_profile_followersVisibility_enum_old" RENAME TO "user_profile_followersVisibility_enum"`);
|
|
|
|
await queryRunner.query(`ALTER TABLE "user_profile" ALTER COLUMN "followingVisibility" SET DEFAULT 'public'`);
|
|
|
|
|
|
|
|
await queryRunner.query(`ALTER TABLE "user_profile" ALTER COLUMN "publicReactions" SET DEFAULT true`);
|
|
|
|
|
|
|
|
await queryRunner.query(`COMMENT ON COLUMN "user_profile"."listenbrainz" IS 'listenbrainz username to fetch currently playing.'`);
|
|
|
|
await queryRunner.query(`COMMENT ON COLUMN "user_profile"."listenbrainz" IS 'listenbrainz username to fetch currently playing.'`);
|
|
|
|
await queryRunner.query(`ALTER TABLE "system_webhook" ALTER COLUMN "updatedAt" SET DEFAULT CURRENT_TIMESTAMP`);
|
|
|
|
await queryRunner.query(`ALTER TABLE "system_webhook" ALTER COLUMN "updatedAt" SET DEFAULT CURRENT_TIMESTAMP`);
|
|
|
|
await queryRunner.query(`COMMENT ON COLUMN "note"."updatedAt" IS 'The updated date of the Note.'`);
|
|
|
|
await queryRunner.query(`COMMENT ON COLUMN "note"."updatedAt" IS 'The updated date of the Note.'`);
|