unoffical wafrn mirror wafrn.net
atproto social-network activitypub
at testPDSNotExplode 47 lines 1.2 kB view raw
1import { 2 Model, Table, Column, DataType, ForeignKey, BelongsTo 3} from "sequelize-typescript"; 4import { QuestionPollQuestion } from "./questionPollQuestion.js"; 5import { User } from "./user.js"; 6 7export interface QuestionPollAnswerAttributes { 8 id?: number; 9 createdAt?: Date; 10 updatedAt?: Date; 11 remoteId?: string; 12 questionPollQuestionId?: number; 13 userId?: string; 14} 15 16@Table({ 17 tableName: "questionPollAnswers", 18 modelName: "questionPollAnswers", 19 timestamps: true 20}) 21export class QuestionPollAnswer extends Model<QuestionPollAnswerAttributes, QuestionPollAnswerAttributes> implements QuestionPollAnswerAttributes { 22 @Column({ 23 allowNull: true, 24 type: DataType.STRING(768) 25 }) 26 declare remoteId: string; 27 28 @ForeignKey(() => QuestionPollQuestion) 29 @Column({ 30 allowNull: true, 31 type: DataType.INTEGER 32 }) 33 declare questionPollQuestionId: number; 34 35 @ForeignKey(() => User) 36 @Column({ 37 allowNull: true, 38 type: DataType.UUID 39 }) 40 declare userId: string; 41 42 @BelongsTo(() => QuestionPollQuestion, "questionPollQuestionId") 43 declare questionPollQuestion: QuestionPollQuestion; 44 45 @BelongsTo(() => User, "userId") 46 declare user: User; 47}