import { Column, CreateDateColumn, Entity, PrimaryColumn, PrimaryGeneratedColumn } from 'typeorm'

@Entity()
export class ChatHistory {
    @PrimaryGeneratedColumn()
    id: string

    @Column()
    messageId: string

    @Column({ nullable: true })
    parentMessageId?: string

    @Column()
    userId: number

    @Column({ type: 'text' })
    message: string

    @Column()
    role: string

    @Column()
    token: number

    @Column()
    time: Date

    constructor(data: Partial<ChatHistory> ) {
        Object.assign(this, data)
    }
}
