import { Entity, PrimaryGeneratedColumn, 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 { @PrimaryGeneratedColumn() id_usuario: number; @Column({ type: 'int', nullable: false }) id_tipo_usuario: number; @Column({ type: 'varchar', length: 60, nullable: false }) correo: string; @Column({ type: 'varchar', length: 60, nullable: false }) usuario: string; @Column({ type: 'varchar', length: 60, nullable: false }) contraseƱa: string; @Column({ type: 'varchar', length: 255, nullable: true }) jwt: string; @Column({ type: 'datetime', nullable: true }) expirationjwt: Date; @Column({ type: 'datetime', nullable: true }) lastlog: Date; @ManyToOne(() => TipoUsuario, tipoUsuario => tipoUsuario.users) @JoinColumn({ name: 'id_tipo_usuario' }) tipoUsuario: TipoUsuario; @OneToMany(() => Profesor, profesor => profesor.user) profesores: Profesor[]; }