feat: initial model

This commit is contained in:
2025-05-30 10:33:26 +02:00
parent 6825726668
commit d11ee1df53
13 changed files with 835 additions and 75 deletions
+29
View File
@@ -0,0 +1,29 @@
import {
Entity,
Column,
PrimaryGeneratedColumn,
Unique,
Generated,
ManyToOne,
} from 'typeorm';
import { Poll } from './poll.entity';
@Entity()
@Unique(['value'])
export class InviteCode {
@PrimaryGeneratedColumn({})
id: number;
@Column()
description: string;
@Column({ nullable: true, default: null })
max_usages: number;
@Column()
@Generated('uuid')
value: string;
@ManyToOne(() => Poll, (poll) => poll.codes)
poll: Poll;
}