3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-03-18 23:09:59 +00:00
zeppelin/backend/src/data/entities/ArchiveEntry.ts
Dragory 2f50232cf3
Fix TypeORM errors for nullable fields
For fields with '| null' in the TS type, the column type needs to be
specified explicitly in column options when using MySQL.

See:
https://github.com/typeorm/typeorm/issues/1358#issuecomment-391736766
2020-11-09 20:12:16 +02:00

21 lines
500 B
TypeScript

import { Column, Entity, PrimaryGeneratedColumn } from "typeorm";
import { createEncryptedTextTransformer } from "../encryptedTextTransformer";
@Entity("archives")
export class ArchiveEntry {
@Column()
@PrimaryGeneratedColumn("uuid")
id: string;
@Column() guild_id: string;
@Column({
type: "mediumtext",
transformer: createEncryptedTextTransformer(),
})
body: string;
@Column() created_at: string;
@Column({ type: String, nullable: true }) expires_at: string | null;
}