Refactor code structure for improved readability and maintainability
This commit is contained in:
18
src/project/entities/project.entity.ts
Normal file
18
src/project/entities/project.entity.ts
Normal file
@ -0,0 +1,18 @@
|
||||
import { Token } from "src/api/entities/token.entity";
|
||||
import { Query } from "src/query/entities/query.enitity";
|
||||
import { Column, Entity, OneToMany, PrimaryGeneratedColumn } from "typeorm";
|
||||
|
||||
@Entity("project")
|
||||
export class Project {
|
||||
@PrimaryGeneratedColumn("uuid")
|
||||
token: string;
|
||||
|
||||
@Column({ type: "varchar", length: 255 })
|
||||
name: string;
|
||||
|
||||
@OneToMany(() => Token, (token) => token.project)
|
||||
apiTokens: Token[];
|
||||
|
||||
@OneToMany(() => Query, (query) => query.project)
|
||||
queries: Query[];
|
||||
}
|
||||
Reference in New Issue
Block a user