Increase bio char limit

This commit is contained in:
jaina heartles 2024-03-06 17:24:35 -08:00
parent bd11dabf89
commit 4af3b96746
4 changed files with 17 additions and 4 deletions

View File

@ -0,0 +1,13 @@
export class IncreaseBioLimit1709773838671 {
name = "IncreaseBioLimit1709773838671";
async up(queryRunner) {
await queryRunner.query(`ALTER TABLE user_profile ALTER COLUMN description TYPE text;`);
}
async down(queryRunner) {
await queryRunner.query(`ALTER TABLE user_profile ALTER COLUMN description TYPE varchar(2048) USING left(description, 2048);`);
}
}

View File

@ -51,7 +51,7 @@ import type { ApImageService } from './ApImageService.js';
import type { IActor, IObject } from '../type.js';
const nameLength = 128;
const summaryLength = 2048;
const summaryLength = 65536;
type Field = Record<'name' | 'value', string>;

View File

@ -339,7 +339,7 @@ export type MiPartialRemoteUser = Partial<MiUser> & {
export const localUsernameSchema = { type: 'string', pattern: /^\w{1,20}$/.toString().slice(1, -1) } as const;
export const passwordSchema = { type: 'string', minLength: 1 } as const;
export const nameSchema = { type: 'string', minLength: 1, maxLength: 50 } as const;
export const descriptionSchema = { type: 'string', minLength: 1, maxLength: 1500 } as const;
export const descriptionSchema = { type: 'string', minLength: 1, maxLength: 20000 } as const;
export const locationSchema = { type: 'string', minLength: 1, maxLength: 50 } as const;
export const listenbrainzSchema = { type: "string", minLength: 1, maxLength: 128 } as const;
export const birthdaySchema = { type: 'string', pattern: /^([0-9]{4})-([0-9]{2})-([0-9]{2})$/.toString().slice(1, -1) } as const;

View File

@ -43,8 +43,8 @@ export class MiUserProfile {
})
public listenbrainz: string | null;
@Column('varchar', {
length: 2048, nullable: true,
@Column('text', {
nullable: true,
comment: 'The description (bio) of the User.',
})
public description: string | null;