This commit is contained in:
2026-06-24 14:10:53 +02:00
commit fdb3768d63
122 changed files with 13239 additions and 0 deletions
+23
View File
@@ -0,0 +1,23 @@
import { Field, Int, ObjectType } from 'type-graphql'
import { BaseEntity, Entity, ManyToOne, PrimaryColumn } from 'typeorm'
import { User } from './User'
@ObjectType()
@Entity()
export class UserFollow extends BaseEntity {
@Field(() => Int)
@PrimaryColumn()
followingUserId!: number
@Field(() => User)
@ManyToOne(() => User, user => user.userFollowings, { onDelete: 'CASCADE' })
followingUser?: User
@Field(() => Int)
@PrimaryColumn()
followedUserId!: number
@Field(() => User)
@ManyToOne(() => User, user => user.userFolloweds, { onDelete: 'CASCADE' })
followedUser?: User
}