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

export class IcrHomeworkanswerdraftcoordinate {
  [PrimaryKeyProp]?: 'Id';
  Id!: IType<number, bigint>;
  HomeworkAnswerDraftId!: IType<number, bigint>;
  Content?: unknown;
  Revision!: number;
  CreatedBy?: IType<number, bigint>;
  CreatedTime!: Date;
}

export const IcrHomeworkanswerdraftcoordinateSchema = defineEntity({
  class: IcrHomeworkanswerdraftcoordinate,
  comment: '作业草稿纸',
  properties: {
    Id: p.bigint().primary().name('Id').columnType('bigint').unsigned(false).autoincrement(false).comment('主键Id'),
    HomeworkAnswerDraftId: p.bigint().name('HomeworkAnswerDraftId').columnType('bigint'),
    Content: p.array().name('Content').length(4294967295).nullable(),
    Revision: p.integer().name('Revision').comment('乐观锁'),
    CreatedBy: p.bigint().name('CreatedBy').columnType('bigint').nullable().comment('创建者用户Id'),
    CreatedTime: p.datetime().name('CreatedTime').length(3).comment('创建时间'),
  },
});
