33 lines
543 B
TypeScript
33 lines
543 B
TypeScript
import { EntitySchema } from 'typeorm'
|
|
|
|
export type ClassEntity = {
|
|
id: string
|
|
name: string
|
|
type: string
|
|
familyPhoto: string | null
|
|
}
|
|
|
|
export const ClassEntitySchema = new EntitySchema<ClassEntity>({
|
|
name: 'ClassEntity',
|
|
tableName: 'classes',
|
|
columns: {
|
|
id: {
|
|
type: String,
|
|
primary: true
|
|
},
|
|
name: {
|
|
type: String
|
|
},
|
|
type: {
|
|
type: String,
|
|
default: 'cheap'
|
|
},
|
|
familyPhoto: {
|
|
name: 'family_photo',
|
|
type: String,
|
|
nullable: true
|
|
}
|
|
},
|
|
relations: {}
|
|
})
|