unoffical wafrn mirror wafrn.net
atproto social-network activitypub
at angular21 48 lines 1.0 kB view raw
1import { 2 Model, Table, Column, DataType, Sequelize, ForeignKey, BelongsTo 3} from "sequelize-typescript"; 4import { Post } from "./post.js"; 5import { User } from "./user.js"; 6 7export interface SilencedPostAttributes { 8 id?: number; 9 createdAt?: Date; 10 updatedAt?: Date; 11 superMuted?: boolean; 12 userId?: string; 13 postId?: string; 14} 15 16@Table({ 17 tableName: "silencedPosts", 18 modelName: "silencedPosts", 19 timestamps: true 20}) 21export class SilencedPost extends Model<SilencedPostAttributes, SilencedPostAttributes> implements SilencedPostAttributes { 22 @Column({ 23 allowNull: true, 24 type: DataType.BOOLEAN, 25 defaultValue: Sequelize.literal("false") 26 }) 27 declare superMuted: boolean; 28 29 @ForeignKey(() => User) 30 @Column({ 31 allowNull: true, 32 type: DataType.UUID 33 }) 34 declare userId: string; 35 36 @ForeignKey(() => Post) 37 @Column({ 38 allowNull: true, 39 type: DataType.UUID 40 }) 41 declare postId: string; 42 43 @BelongsTo(() => Post, "postId") 44 declare post: Post; 45 46 @BelongsTo(() => User, "userId") 47 declare user: User; 48}