mirror of
https://github.com/versia-pub/server.git
synced 2025-12-06 16:38:19 +01:00
33 lines
585 B
TypeScript
33 lines
585 B
TypeScript
|
|
import {
|
||
|
|
BaseEntity,
|
||
|
|
CreateDateColumn,
|
||
|
|
Entity,
|
||
|
|
ManyToOne,
|
||
|
|
PrimaryGeneratedColumn,
|
||
|
|
} from "typeorm";
|
||
|
|
import { User } from "./User";
|
||
|
|
import { Status } from "./Status";
|
||
|
|
|
||
|
|
/**
|
||
|
|
* Represents a Like entity in the database.
|
||
|
|
*/
|
||
|
|
@Entity({
|
||
|
|
name: "likes",
|
||
|
|
})
|
||
|
|
export class Like extends BaseEntity {
|
||
|
|
/** The unique identifier of the Like. */
|
||
|
|
@PrimaryGeneratedColumn("uuid")
|
||
|
|
id!: string;
|
||
|
|
|
||
|
|
/** The User who liked the Status. */
|
||
|
|
@ManyToOne(() => User)
|
||
|
|
liker!: User;
|
||
|
|
|
||
|
|
/** The Status that was liked. */
|
||
|
|
@ManyToOne(() => Status)
|
||
|
|
liked!: Status;
|
||
|
|
|
||
|
|
@CreateDateColumn()
|
||
|
|
created_at!: Date;
|
||
|
|
}
|