Skip to content

Commit

Permalink
Merge pull request #84 from TeamHSE/feat/orm
Browse files Browse the repository at this point in the history
feat(backend): change orm
  • Loading branch information
disk0Dancer authored Jun 23, 2024
2 parents 9d2dcc7 + 5716959 commit ed0c5a6
Show file tree
Hide file tree
Showing 7 changed files with 0 additions and 83 deletions.
1 change: 0 additions & 1 deletion backend/src/entity/Course.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import {
ManyToOne,
} from "typeorm";
import { CoursesModule } from "./CoursesModules";
import { CoursesStep } from "./CoursesStep";
import { CoursesViewer } from "./CoursesViewers";

@Entity("courses")
Expand Down
6 changes: 0 additions & 6 deletions backend/src/entity/CoursesModules.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,6 @@ export class CoursesModule extends BaseEntity {
@Column("text")
description: string | undefined;

@Column({ default: false, type: "boolean" })
isVisible: boolean | undefined;

@Column({ type: "integer" })
moduleNumber: number | undefined;

@ManyToOne(() => Course, (course) => course.modules)
course: Course;

Expand Down
10 changes: 0 additions & 10 deletions backend/src/entity/CoursesStep.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import {
PrimaryGeneratedColumn,
} from "typeorm";
import { CoursesModule } from "./CoursesModules";
import { UsersActivity } from "./UsersActivity";

@Entity("courses_steps")
export class CoursesStep extends BaseEntity {
Expand All @@ -26,21 +25,12 @@ export class CoursesStep extends BaseEntity {
@Column({ nullable: true, type: "text" })
youtubeVideoLink: string | undefined;

@Column({ default: false, type: "boolean" })
isVisible: boolean | undefined;

@Column({ type: "integer" })
stepNumber: number | undefined;

@Column({ default: -1, type: "integer" })
deadline: number | undefined;

@Column({ default: 1, type: "integer" })
ratingAward: number | undefined;

@OneToMany(() => UsersActivity, (activity) => activity.step)
activities: UsersActivity[];

@ManyToOne(() => CoursesModule, (module) => module.steps)
module: CoursesModule;
}
7 changes: 0 additions & 7 deletions backend/src/entity/CoursesViewers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import {
OneToMany,
PrimaryGeneratedColumn,
} from "typeorm";
import { UsersRole } from "./UsersRoles";
import { Course } from "./Course";
import { User } from "./User";

Expand All @@ -20,12 +19,6 @@ export class CoursesViewer extends BaseEntity {
@Column({ type: "uuid" })
courseId: "uuid" | undefined;

@Column({ type: "uuid" })
roleId: "uuid" | undefined;

@OneToMany(() => UsersRole, (role) => role.viewer)
roles: UsersRole[];

@OneToMany(() => User, (user) => user.viewers)
user: User[];

Expand Down
8 changes: 0 additions & 8 deletions backend/src/entity/User.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,8 @@ import {
Column,
Entity,
ManyToOne,
OneToMany,
PrimaryGeneratedColumn,
} from "typeorm";
import { UUID } from "crypto";
import { UsersActivity } from "./UsersActivity";
import { UsersRole } from "./UsersRoles";
import { Course } from "./Course";
import { CoursesViewer } from "./CoursesViewers";

@Entity("users")
Expand Down Expand Up @@ -49,9 +44,6 @@ export class User {
@Column({ type: "text", nullable: true })
healthIssues: string;

@OneToMany(() => UsersActivity, (activity) => activity.user)
activities: UsersActivity[];

@ManyToOne(() => CoursesViewer, (viewer) => viewer.user)
viewers: CoursesViewer;
}
30 changes: 0 additions & 30 deletions backend/src/entity/UsersActivity.ts

This file was deleted.

21 changes: 0 additions & 21 deletions backend/src/entity/UsersRoles.ts

This file was deleted.

0 comments on commit ed0c5a6

Please sign in to comment.