Fix(backend): ドライブのファイルのurl, uri, src の上限引き上げ (#14323)
* enhance: ドライブurlの上限文字数を引き上げ * Fix: おそらくフォーク独自の変更のように見える部分(metaに関する変更部分)を削除 * UPDATE changelog * Add SPDX prefixes * Fix: インデックスの張り直しを消した --------- Co-authored-by: slofp <phy.public@gmail.com>
This commit is contained in:
		
							parent
							
								
									5eea41b089
								
							
						
					
					
						commit
						7e9c38d6fb
					
				
					 3 changed files with 32 additions and 3 deletions
				
			
		
							
								
								
									
										24
									
								
								packages/backend/migration/1721666053703-fixDriveUrl.js
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										24
									
								
								packages/backend/migration/1721666053703-fixDriveUrl.js
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,24 @@
 | 
			
		|||
/*
 | 
			
		||||
 * SPDX-FileCopyrightText: syuilo and misskey-project
 | 
			
		||||
 * SPDX-License-Identifier: AGPL-3.0-only
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
export class FixDriveUrl1721666053703 {
 | 
			
		||||
    name = 'FixDriveUrl1721666053703'
 | 
			
		||||
 | 
			
		||||
    async up(queryRunner) {
 | 
			
		||||
        await queryRunner.query(`ALTER TABLE "drive_file" ALTER COLUMN "url" TYPE character varying(1024), ALTER COLUMN "url" SET NOT NULL`);
 | 
			
		||||
        await queryRunner.query(`COMMENT ON COLUMN "drive_file"."url" IS 'The URL of the DriveFile.'`);
 | 
			
		||||
        await queryRunner.query(`ALTER TABLE "drive_file" ALTER COLUMN "uri" TYPE character varying(1024)`);
 | 
			
		||||
        await queryRunner.query(`COMMENT ON COLUMN "drive_file"."uri" IS 'The URI of the DriveFile. it will be null when the DriveFile is local.'`);
 | 
			
		||||
        await queryRunner.query(`ALTER TABLE "drive_file" ALTER COLUMN "src" TYPE character varying(1024)`);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    async down(queryRunner) {
 | 
			
		||||
        await queryRunner.query(`ALTER TABLE "drive_file" ALTER COLUMN "src" TYPE character varying(512)`);
 | 
			
		||||
        await queryRunner.query(`COMMENT ON COLUMN "drive_file"."uri" IS 'The URI of the DriveFile. it will be null when the DriveFile is local.'`);
 | 
			
		||||
        await queryRunner.query(`ALTER TABLE "drive_file" ALTER COLUMN "uri" TYPE character varying(512)`);
 | 
			
		||||
        await queryRunner.query(`COMMENT ON COLUMN "drive_file"."url" IS 'The URL of the DriveFile.'`);
 | 
			
		||||
        await queryRunner.query(`ALTER TABLE "drive_file" ALTER COLUMN "url" TYPE character varying(512), ALTER COLUMN "url" SET NOT NULL`);
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -82,7 +82,7 @@ export class MiDriveFile {
 | 
			
		|||
	public storedInternal: boolean;
 | 
			
		||||
 | 
			
		||||
	@Column('varchar', {
 | 
			
		||||
		length: 512,
 | 
			
		||||
		length: 1024,
 | 
			
		||||
		comment: 'The URL of the DriveFile.',
 | 
			
		||||
	})
 | 
			
		||||
	public url: string;
 | 
			
		||||
| 
						 | 
				
			
			@ -124,13 +124,13 @@ export class MiDriveFile {
 | 
			
		|||
 | 
			
		||||
	@Index()
 | 
			
		||||
	@Column('varchar', {
 | 
			
		||||
		length: 512, nullable: true,
 | 
			
		||||
		length: 1024, nullable: true,
 | 
			
		||||
		comment: 'The URI of the DriveFile. it will be null when the DriveFile is local.',
 | 
			
		||||
	})
 | 
			
		||||
	public uri: string | null;
 | 
			
		||||
 | 
			
		||||
	@Column('varchar', {
 | 
			
		||||
		length: 512, nullable: true,
 | 
			
		||||
		length: 1024, nullable: true,
 | 
			
		||||
	})
 | 
			
		||||
	public src: string | null;
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue