unoffical wafrn mirror wafrn.net
atproto social-network activitypub
at cache-folder-container 41 lines 908 B view raw
1import { 2 Model, Table, Column, DataType, ForeignKey, BelongsTo 3} from "sequelize-typescript"; 4import { Post } from "./post.js"; 5import { User } from "./user.js"; 6 7export interface RemoteUserPostViewAttributes { 8 id?: number; 9 createdAt?: Date; 10 updatedAt?: Date; 11 postId: string; 12 userId: string; 13} 14 15@Table({ 16 tableName: "remoteUserPostViews", 17 modelName: "remoteUserPostViews", 18 timestamps: true 19}) 20export class RemoteUserPostView extends Model<RemoteUserPostViewAttributes, RemoteUserPostViewAttributes> implements RemoteUserPostViewAttributes { 21 @ForeignKey(() => Post) 22 @Column({ 23 primaryKey: true, 24 type: DataType.UUID 25 }) 26 declare postId: string; 27 28 @ForeignKey(() => User) 29 @Column({ 30 primaryKey: true, 31 type: DataType.UUID 32 }) 33 declare userId: string; 34 35 @BelongsTo(() => Post, "postId") 36 declare Post: Post; 37 38 @BelongsTo(() => User, "userId") 39 declare User: User; 40 41}