This commit is contained in:
Bastian Wagner
2024-10-18 16:52:58 +02:00
parent ed6b2b9c45
commit 76e54cfaa0
32 changed files with 552 additions and 7 deletions

View File

@@ -0,0 +1,32 @@
import {
Column,
CreateDateColumn,
Entity,
ManyToOne,
OneToMany,
PrimaryGeneratedColumn,
UpdateDateColumn,
} from 'typeorm';
import { Key } from './key.entity';
import { KeySystem } from './system.entity';
@Entity()
export class Cylinder {
@PrimaryGeneratedColumn('uuid')
id: string;
@Column({ nullable: false, unique: true })
name: string;
@OneToMany(() => Key, (key) => key.cylinder)
keys: Key[];
@ManyToOne(() => KeySystem, (sys) => sys.cylinders)
system: KeySystem;
@CreateDateColumn({ name: 'created_at' })
createdAt: Date;
@UpdateDateColumn({ name: 'updatet_at' })
updatedAt: Date;
}