diff --git a/src/entity/protocol.ts b/src/entity/protocol.ts index ff25531..c82dd88 100644 --- a/src/entity/protocol.ts +++ b/src/entity/protocol.ts @@ -11,12 +11,12 @@ export class protocol { @Column({ type: "date" }) date: Date; - @Column({ type: "timestamp" }) + @Column({ type: "timestamp", nullable: true }) starttime: Date; - @Column({ type: "timestamp" }) + @Column({ type: "timestamp", nullable: true }) endtime: Date; - @Column({ type: "text" }) + @Column({ type: "text", nullable: true }) summary: string; } diff --git a/src/migrations/1728037129072-protocolBase.ts b/src/migrations/1728037129072-protocolBase.ts index e1f9a71..23f56ea 100644 --- a/src/migrations/1728037129072-protocolBase.ts +++ b/src/migrations/1728037129072-protocolBase.ts @@ -9,7 +9,7 @@ export class ProtocolBase1728037129072 implements MigrationInterface { new TableColumn({ name: "starttime", type: "timestamp", - isNullable: false, + isNullable: true, }) ); await queryRunner.addColumn( @@ -17,7 +17,7 @@ export class ProtocolBase1728037129072 implements MigrationInterface { new TableColumn({ name: "endtime", type: "timestamp", - isNullable: false, + isNullable: true, }) ); await queryRunner.addColumn( @@ -25,7 +25,7 @@ export class ProtocolBase1728037129072 implements MigrationInterface { new TableColumn({ name: "summary", type: "text", - isNullable: false, + isNullable: true, }) ); } diff --git a/src/service/protocolService.ts b/src/service/protocolService.ts index 553b550..53e0baf 100644 --- a/src/service/protocolService.ts +++ b/src/service/protocolService.ts @@ -13,7 +13,7 @@ export default abstract class ProtocolService { .createQueryBuilder("protocol") .offset(offset) .limit(count) - .orderBy("date") + .orderBy("date", "DESC") .getManyAndCount() .then((res) => { return res;