mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-03-18 23:09:59 +00:00

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
21 lines
500 B
TypeScript
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;
|
|
}
|