feat: move to typeorm
Some checks failed
TrafficCue Server CI / check (push) Failing after 23s

This commit is contained in:
Cfp
2025-08-21 12:18:56 +02:00
parent b8549c6deb
commit 03e602c814
9 changed files with 380 additions and 64 deletions

34
src/entities/Review.ts Normal file
View 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;
}