add project creation and listing
This commit is contained in:
18
server/src/entity/project.entity.ts
Normal file
18
server/src/entity/project.entity.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
import { IsNotEmpty } from "class-validator"
|
||||
import { Entity, PrimaryGeneratedColumn, Column, OneToMany, ManyToOne, JoinColumn } from "typeorm"
|
||||
import { User } from "./user.entity"
|
||||
|
||||
@Entity()
|
||||
export class Project {
|
||||
@PrimaryGeneratedColumn()
|
||||
id: number
|
||||
|
||||
@Column()
|
||||
@IsNotEmpty()
|
||||
name: string
|
||||
|
||||
@ManyToOne((_type) => User, (user) => user.projects)
|
||||
@JoinColumn()
|
||||
@IsNotEmpty()
|
||||
user: User
|
||||
}
|
||||
Reference in New Issue
Block a user