Skip to content

Commit

Permalink
fix: increase error message size
Browse files Browse the repository at this point in the history
  • Loading branch information
sylv committed May 18, 2024
1 parent 2322abf commit 5d0329a
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 6 deletions.
8 changes: 4 additions & 4 deletions packages/api/src/migrations/.snapshot-micro.json
Original file line number Diff line number Diff line change
Expand Up @@ -687,21 +687,21 @@
},
"external_error": {
"name": "external_error",
"type": "varchar(255)",
"type": "text",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": true,
"mappedType": "string"
"mappedType": "text"
},
"thumbnail_error": {
"name": "thumbnail_error",
"type": "varchar(255)",
"type": "text",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": true,
"mappedType": "string"
"mappedType": "text"
},
"owner_id": {
"name": "owner_id",
Expand Down
15 changes: 15 additions & 0 deletions packages/api/src/migrations/Migration20240517030754.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { Migration } from '@mikro-orm/migrations';

export class Migration20240517030754 extends Migration {

async up(): Promise<void> {
this.addSql('alter table "files" alter column "external_error" type text using ("external_error"::text);');
this.addSql('alter table "files" alter column "thumbnail_error" type text using ("thumbnail_error"::text);');
}

async down(): Promise<void> {
this.addSql('alter table "files" alter column "external_error" type varchar(255) using ("external_error"::varchar(255));');
this.addSql('alter table "files" alter column "thumbnail_error" type varchar(255) using ("thumbnail_error"::varchar(255));');
}

}
4 changes: 2 additions & 2 deletions packages/api/src/modules/file/file.entity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export class FileEntity extends ResourceEntity {
@Field()
external: boolean = false;

@Property({ nullable: true })
@Property({ type: "text", nullable: true })
externalError?: string;

@Field(() => ThumbnailEntity, { nullable: true })
Expand All @@ -61,7 +61,7 @@ export class FileEntity extends ResourceEntity {
)
thumbnail?: Ref<ThumbnailEntity>;

@Property({ nullable: true })
@Property({ type: "text", nullable: true })
thumbnailError?: string;

@ManyToOne(() => UserEntity, { ref: true, hidden: true })
Expand Down

0 comments on commit 5d0329a

Please sign in to comment.