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

export enum SysConfigType {
    String = 'string',
    Date = 'date',
    Number = 'number',
    Boolean = 'boolean'
}

@Entity()
@Index('name', ['name'], { unique: true })
export class SysConfig {
    @PrimaryGeneratedColumn()
    id: number

    @Column({ unique: true, length: 50 })
    name: string

    @Column({ length: 50 })
    type: string

    @Column()
    value: string

    @Column({ length: 255 })
    remark: string

    @CreateDateColumn()
    createdAt: Date
}
