import { Column, Entity, JoinColumn, ManyToOne, PrimaryGeneratedColumn, } from "typeorm"; import { Country } from "./Country"; @Entity("country_holiday", { comment: "Tabla para guardar los festivos de los países.", }) export class CountryHoliday { @PrimaryGeneratedColumn({ type: "int", comment: "ID único de cada registro.", }) id: number; @Column({ type: "varchar", length: 200, comment: "Nombre del festivo." }) name: string; @Column({ type: "date", comment: "Fecha del festivo.", }) date: string; @ManyToOne(() => Country, (country) => country.country_holidays, { onDelete: "CASCADE", onUpdate: "NO ACTION", }) @JoinColumn({ name: "country" }) country: Country; @Column({ type: "datetime", default: () => "CURRENT_TIMESTAMP", comment: "Fecha de creación del registro.", }) created: Date; }