This commit is contained in:
24
src/models/Feed.ts
Normal file
24
src/models/Feed.ts
Normal file
@ -0,0 +1,24 @@
|
||||
import { Entity, Unique, PrimaryGeneratedColumn, Column, ManyToMany, JoinTable, OneToMany, Relation } from "typeorm";
|
||||
import { User } from "./User.js";
|
||||
import { Post } from "./Post.js";
|
||||
|
||||
@Entity()
|
||||
export class Feed {
|
||||
@PrimaryGeneratedColumn()
|
||||
id: number;
|
||||
|
||||
@Column()
|
||||
url: string;
|
||||
|
||||
@Column({
|
||||
default: "1970-01-01 01:00:00.000"
|
||||
})
|
||||
lastCheck?: Date;
|
||||
|
||||
@ManyToMany(() => User, user => user.feeds)
|
||||
@JoinTable()
|
||||
subscriber: Relation<User>[];
|
||||
|
||||
@OneToMany(() => Post, post => post.feed)
|
||||
oldEntries: Relation<Post>[];
|
||||
}
|
Reference in New Issue
Block a user