Skip to content

Commit 4868cdc

Browse files
committed
fix: snapshot size column
1 parent 6d70d0c commit 4868cdc

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import { MigrationInterface, QueryRunner } from "typeorm"
2+
3+
export class ChangeColumnSnapshotType1693918720175 implements MigrationInterface {
4+
5+
public async up(queryRunner: QueryRunner): Promise<void> {
6+
await queryRunner.query(
7+
`ALTER TABLE \`menu_revisions\` MODIFY \`snapshot\` LONGTEXT`,
8+
);
9+
}
10+
11+
public async down(queryRunner: QueryRunner): Promise<void> {
12+
await queryRunner.query(
13+
`ALTER TABLE \`menu_revisions\` MODIFY \`snapshot\` TEXT`,
14+
);
15+
}
16+
17+
}

src/menus/entities/menu-revision.entity.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export class MenuRevision {
2626
description: string;
2727

2828
@Field(() => GraphQLJSONObject)
29-
@Column('text', { transformer: { from: JSON.parse, to: JSON.stringify } })
29+
@Column('longtext', { transformer: { from: JSON.parse, to: JSON.stringify } })
3030
snapshot: MenuRevisionSnapshot;
3131

3232
@Field(() => Menu)

0 commit comments

Comments
 (0)