This commit is contained in:
34
src/entities/Review.ts
Normal file
34
src/entities/Review.ts
Normal file
@ -0,0 +1,34 @@
|
||||
import { BaseEntity, Column, Entity, ManyToOne, PrimaryGeneratedColumn } from "typeorm";
|
||||
import { type User } from "./User";
|
||||
|
||||
@Entity()
|
||||
export class Review extends BaseEntity {
|
||||
@PrimaryGeneratedColumn()
|
||||
id: number;
|
||||
|
||||
@ManyToOne("User", (u: User) => u.reviews)
|
||||
user: User;
|
||||
|
||||
@Column({
|
||||
type: "float"
|
||||
})
|
||||
latitude: number;
|
||||
|
||||
@Column({
|
||||
type: "float"
|
||||
})
|
||||
longitude: number;
|
||||
|
||||
@Column()
|
||||
rating: number;
|
||||
|
||||
@Column({
|
||||
type: "text"
|
||||
})
|
||||
comment: string;
|
||||
|
||||
@Column({
|
||||
default: () => "NOW()"
|
||||
})
|
||||
created_at: Date;
|
||||
}
|
||||
Reference in New Issue
Block a user