Entidades y Realciones(Falta enrutar bien)
This commit is contained in:
@@ -1,14 +1,22 @@
|
||||
import {Entity,Column,PrimaryColumn} from "typeorm";
|
||||
import { Entity, PrimaryColumn, Column, ManyToOne, JoinColumn } from 'typeorm';
|
||||
import { Profesor } from './profesor.entity';
|
||||
|
||||
@Entity()
|
||||
export class proyectos_academicos{
|
||||
@Entity({ name: 'proyectos_academicos' })
|
||||
export class ProyectosAcademicos {
|
||||
|
||||
@PrimaryColumn()
|
||||
id_proyectos:number
|
||||
@PrimaryColumn({ type: 'int', length: 11, nullable: false })
|
||||
id_proyecto: number;
|
||||
|
||||
@Column()
|
||||
id_profesor:number
|
||||
@Column({ type: 'int', nullable: false })
|
||||
id_profesor: number;
|
||||
|
||||
@Column()
|
||||
proyectos: string
|
||||
}
|
||||
@Column({ type: 'varchar', length: 255, nullable: true })
|
||||
proyecto: string;
|
||||
|
||||
@Column({ type: 'varchar', length: 255, nullable: true })
|
||||
proyecto_html: string;
|
||||
|
||||
@ManyToOne(() => Profesor, profesor => profesor.proyectosAcademicos)
|
||||
@JoinColumn({ name: 'id_profesor' })
|
||||
profesor: Profesor;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user