Compare commits

..

3 commits

Author SHA1 Message Date
45245fb9a2
she migrate on my TypeORM till i (GUNSHOTS) 2024-11-08 20:38:37 -05:00
c345ca02e4
Change default settings
Someone needs to generate the TypeORM migrations for me because I can't
get the sodding thing to work on my end and it's driving me absolutely
potty.
2024-11-08 19:31:18 -05:00
5d91293ca5
Remove like button 2024-11-08 19:30:38 -05:00
7 changed files with 46 additions and 45 deletions

View file

@ -1,5 +1,7 @@
export class FixOrm1731198456911 { const { MigrationInterface, QueryRunner } = require("typeorm");
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"`);
@ -20,20 +22,32 @@ export class FixOrm1731198456911 {
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 'public'`); await queryRunner.query(`ALTER TABLE "user_profile" ALTER COLUMN "followersVisibility" SET DEFAULT 'private'`);
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") `);
@ -71,10 +85,20 @@ export class FixOrm1731198456911 {
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`);
@ -85,6 +109,8 @@ export class FixOrm1731198456911 {
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.'`);

View file

@ -1,15 +0,0 @@
export class RelationshipsPrivateByDefault1731198456912 {
name = 'RelationshipsPrivateByDefault1731198456912'
async up(queryRunner) {
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 TABLE "user_profile" ALTER COLUMN "followersVisibility" SET DEFAULT 'private'`);
}
async down(queryRunner) {
await queryRunner.query(`ALTER TABLE "user_profile" ALTER COLUMN "followersVisibility" SET DEFAULT 'public'`);
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`);
}
}

View file

@ -47,7 +47,7 @@ export class MiMeta {
public maintainerEmail: string | null; public maintainerEmail: string | null;
@Column('boolean', { @Column('boolean', {
default: true, default: false,
}) })
public disableRegistration: boolean; public disableRegistration: boolean;
@ -402,7 +402,7 @@ export class MiMeta {
@Column('varchar', { @Column('varchar', {
length: 1024, length: 1024,
default: 'https://activitypub.software/TransFem-org/Sharkey/', default: 'https://activitypub.software/TransFem-org/Sharkey/',
nullable: true, // this is indeed supposed to be nullable. accidentally set wrong in e248e41287 nullable: false,
}) })
public repositoryUrl: string | null; public repositoryUrl: string | null;
@ -625,22 +625,22 @@ export class MiMeta {
public enableFanoutTimelineDbFallback: boolean; public enableFanoutTimelineDbFallback: boolean;
@Column('integer', { @Column('integer', {
default: 800, default: 300,
}) })
public perLocalUserUserTimelineCacheMax: number; public perLocalUserUserTimelineCacheMax: number;
@Column('integer', { @Column('integer', {
default: 800, default: 100,
}) })
public perRemoteUserUserTimelineCacheMax: number; public perRemoteUserUserTimelineCacheMax: number;
@Column('integer', { @Column('integer', {
default: 800, default: 300,
}) })
public perUserHomeTimelineCacheMax: number; public perUserHomeTimelineCacheMax: number;
@Column('integer', { @Column('integer', {
default: 800, default: 300,
}) })
public perUserListTimelineCacheMax: number; public perUserListTimelineCacheMax: number;
@ -654,15 +654,9 @@ export class MiMeta {
}) })
public notesPerOneAd: number; public notesPerOneAd: number;
// FIXME: it seems like this shouldn't actually be nullable,
// because a lot of code assumes it has a value and can't deal
// with it being null. however, i haven't changed it yet because
// it's possible some OTHER code depends on it being nullable...
// this is a mess lol
@Column('varchar', { @Column('varchar', {
length: 500, length: 500,
nullable: true, nullable: true,
default: '❤️'
}) })
public defaultLike: string | null; public defaultLike: string | null;
@ -687,7 +681,7 @@ export class MiMeta {
public urlPreviewMaximumContentLength: number; public urlPreviewMaximumContentLength: number;
@Column('boolean', { @Column('boolean', {
default: false, default: true,
}) })
public urlPreviewRequireContentLength: boolean; public urlPreviewRequireContentLength: boolean;

View file

@ -56,7 +56,6 @@ export class NoteEdit {
@Column("timestamp with time zone", { @Column("timestamp with time zone", {
comment: "The old date from before the edit", comment: "The old date from before the edit",
nullable: true,
}) })
public oldDate: Date | null; public oldDate: Date;
} }

View file

@ -34,7 +34,6 @@ export class MiUserPending {
@Column('varchar', { @Column('varchar', {
length: 1000, length: 1000,
nullable: true,
}) })
public reason: string | null; public reason: string;
} }

View file

@ -6,12 +6,12 @@
//store the URL and if its none of these its a custom one //store the URL and if its none of these its a custom one
export const searchEngineMap = { export const searchEngineMap = {
//The first one is the default search engine //The first one is the default search engine
'https://e621.net/posts?tags={query}': 'e621', 'https://duckduckgo.com/?q={query}': 'Duckduckgo',
'https://www.furaffinity.net/search/?q={query}': 'FurAffinity', 'https://www.google.com/search?q={query}': 'Google',
'https://www.sofurry.com/browse/search?search={query}': 'SoFurry', 'https://www.bing.com/search?q={query}': 'Bing',
'https://www.weasyl.com/search?q={query}': 'Weasyl', 'https://search.yahoo.com/search?p={query}': 'Yahoo',
'https://duckduckgo.com/?q={query}': 'Ask Jeeves', 'https://www.ecosia.org/search?q={query}': 'Ecosia',
'https://www.qwant.com/?q={query}': 'AltaVista', 'https://www.qwant.com/?q={query}': 'Qwant',
'https://wiby.me/?q={query}': 'JumpStation', 'https://search.aol.com/aol/search?q={query}': 'AOL',
'https://yandex.com/search?text={query}': 'Yandex', // because nothing's funnier than Yandex 'https://yandex.com/search?text={query}': 'Yandex',
}; };

View file

@ -5,7 +5,6 @@
font-family: 'FOT-NewRodin Pro'; font-family: 'FOT-NewRodin Pro';
font-style: normal; font-style: normal;
font-weight: 400; font-weight: 400;
font-display: swap;
src: url('/static-assets/fonts/NewRodinPro-DB.woff2') format('woff2'); src: url('/static-assets/fonts/NewRodinPro-DB.woff2') format('woff2');
} }
@ -14,7 +13,6 @@
font-family: 'FOT-NewRodin Pro'; font-family: 'FOT-NewRodin Pro';
font-style: normal; font-style: normal;
font-weight: 700; font-weight: 700;
font-display: swap;
src: url('/static-assets/fonts/NewRodinPro-EB.woff2') format('woff2'); src: url('/static-assets/fonts/NewRodinPro-EB.woff2') format('woff2');
} }