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