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