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