New version of this thing
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
Fabian Stamm
2023-04-26 00:04:56 +02:00
parent 422ebd0703
commit 9dfb1342e5
16 changed files with 2462 additions and 265 deletions

24
src/models/Feed.ts Normal file
View 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>[];
}