Breadbot/src/utilties/storage/entities/DBMessageAttachment.ts

29 lines
687 B
TypeScript

import { Column, Entity, ManyToOne, PrimaryColumn } from "typeorm";
import { DBMessage } from "./DBMessage";
@Entity()
export class DBMessageAttachments {
@PrimaryColumn({"type": "bigint"})
attachment_snowflake: string
@ManyToOne(() => DBMessage, (message: DBMessage) => message.attachments)
message: DBMessage
@Column()
attachment_name: string
@Column({nullable: true})
attachment_description: string | null
@Column({type: "datetime"})
attachment_timestamp: Date
@Column({nullable: true})
attachment_mime_type: string | null
@Column()
attachment_url: string
@Column({default: false})
attachment_download: boolean
}