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