import { PrimaryKeyProp, defineEntity, p } from '@mikro-orm/core';

export class ScsCoursesourceconvert {
  [PrimaryKeyProp]?: 'Id';
  Id!: bigint;
  CourseId!: bigint;
  CourseSouceId!: bigint;
  FileType!: number;
  Order!: number;
  Extension?: string;
  Urls?: string;
  Revision!: number;
  CreatedBy?: bigint;
  CreatedTime!: Date;
  UpdatedBy?: bigint;
  UpdatedTime?: Date;
  IsDeleted!: unknown;
}

export const ScsCoursesourceconvertSchema = defineEntity({
  class: ScsCoursesourceconvert,
  comment: '课程资源',
  properties: {
    Id: p.bigint().primary().name('Id').unsigned(false).autoincrement(false).comment('主键Id'),
    CourseId: p.bigint().name('CourseId').comment('课程id'),
    CourseSouceId: p.bigint().name('CourseSouceId').comment('课程资源id'),
    FileType: p.integer().name('FileType').comment('文件类型'),
    Order: p.integer().name('Order').comment('排序'),
    Extension: p.string().name('Extension').nullable().comment('文件扩展名'),
    Urls: p.string().name('Urls').length(6000).nullable().comment('文件地址列表'),
    Revision: p.integer().name('Revision').comment('乐观锁'),
    CreatedBy: p.bigint().name('CreatedBy').nullable().comment('创建者用户Id'),
    CreatedTime: p.datetime().name('CreatedTime').length(3).comment('创建时间'),
    UpdatedBy: p.bigint().name('UpdatedBy').nullable().comment('修改者用户Id'),
    UpdatedTime: p.datetime().name('UpdatedTime').length(3).nullable().comment('修改时间'),
    IsDeleted: p.array().name('IsDeleted').comment('是否删除'),
  },
});
