unoffical wafrn mirror
wafrn.net
atproto
social-network
activitypub
1import {
2 Model, Table, Column, DataType, ForeignKey, BelongsTo
3} from "sequelize-typescript";
4import { User } from "./user.js";
5
6export interface UserOptionsAttributes {
7 id?: number;
8 createdAt?: Date;
9 updatedAt?: Date;
10 userId: string;
11 optionName: string;
12 optionValue?: string;
13 public?: boolean;
14}
15
16@Table({
17 tableName: "userOptions",
18 modelName: "userOptions",
19 timestamps: true
20})
21export class UserOptions extends Model<UserOptionsAttributes, UserOptionsAttributes> implements UserOptionsAttributes {
22
23 @ForeignKey(() => User)
24 @Column({
25 primaryKey: true,
26 type: DataType.UUID
27 })
28 declare userId: string;
29
30 @Column({
31 primaryKey: true,
32 type: DataType.STRING(255)
33 })
34 declare optionName: string;
35
36 @Column({
37 allowNull: true,
38 type: DataType.STRING
39 })
40 declare optionValue: string;
41
42 @Column({
43 allowNull: true,
44 type: DataType.BOOLEAN,
45 defaultValue: false
46 })
47 declare public: boolean;
48
49 @BelongsTo(() => User)
50 declare user: User;
51
52}