This commit is contained in:
TioSam77
2024-06-18 15:21:12 -06:00
parent 77420d2fe5
commit 434cc05a06
4 changed files with 18 additions and 24 deletions
+5 -1
View File
@@ -1,5 +1,6 @@
import { Entity, PrimaryColumn, Column, ManyToOne, JoinColumn } from 'typeorm';
import { Entity, PrimaryColumn, Column, ManyToOne, JoinColumn, OneToMany } from 'typeorm';
import { TipoUsuario } from "../../tipo_usuario/entities/tipo_usuario.entity";
import { Profesor } from 'src/Profesor/entities/profesor.entity';
@Entity({ name: 'usuario' })
export class User {
@@ -31,4 +32,7 @@ export class User {
@ManyToOne(() => TipoUsuario, tipoUsuario => tipoUsuario.users)
@JoinColumn({ name: 'id_tipo_usuario' })
tipoUsuario: TipoUsuario;
@OneToMany(() => Profesor, profesor => profesor.user)
profesores: Profesor[];
}