Implementing Exercise system in database with API and frontend visualization
This commit is contained in:
33
software/backend/models/exercises/exercise.model.ts
Normal file
33
software/backend/models/exercises/exercise.model.ts
Normal file
@@ -0,0 +1,33 @@
|
||||
import { BelongsTo, Column, ForeignKey, Model, Table } from "sequelize-typescript";
|
||||
import { ExerciseGroup } from "./exerciseGroup.model";
|
||||
|
||||
@Table({ timestamps: false })
|
||||
export class Exercise extends Model {
|
||||
@Column
|
||||
nameDe: String
|
||||
|
||||
@Column
|
||||
nameEn: String
|
||||
|
||||
@Column
|
||||
exerciseNr: Number
|
||||
|
||||
@Column
|
||||
descriptionDe: String
|
||||
|
||||
@Column
|
||||
descriptionEn: String
|
||||
|
||||
@Column
|
||||
solved: Boolean
|
||||
|
||||
@ForeignKey(() => ExerciseGroup)
|
||||
@Column
|
||||
exerciseGroupId: Number
|
||||
|
||||
|
||||
// Relations
|
||||
|
||||
@BelongsTo(() => ExerciseGroup)
|
||||
exerciseGroup: ExerciseGroup
|
||||
}
|
||||
Reference in New Issue
Block a user