import { Column, Entity, ManyToOne, PrimaryGeneratedColumn } from "typeorm"; import { protocol } from "./protocol"; @Entity() export class protocolVotings { @PrimaryGeneratedColumn("increment") id: string; @Column({ type: "varchar", length: 255 }) topic: string; @Column({ type: "varchar", length: 255, default: "" }) context: string; @Column({ type: "int", default: 0 }) favour: number; @Column({ type: "int", default: 0 }) abstain: number; @Column({ type: "int", default: 0 }) against: number; @ManyToOne(() => protocol, { nullable: false, onDelete: "CASCADE", onUpdate: "RESTRICT", }) protocol: protocol; }