Created
August 20, 2020 10:38
-
-
Save nmchenry01/57e7ca115bcdb2ab0c5dbbee1d61995a to your computer and use it in GitHub Desktop.
Company entity for "Prisma vs. TypeORM"
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @Entity() | |
| export class Company { | |
| @PrimaryGeneratedColumn() | |
| id: number; | |
| @Column({ unique: true }) | |
| name: string; | |
| @CreateDateColumn() | |
| createdAt: string; | |
| @OneToMany(() => Product, (product) => product.company) | |
| products: Product[]; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment