unoffical wafrn mirror
wafrn.net
atproto
social-network
activitypub
1import {
2 Model, Table, Column, DataType, Index, Sequelize, ForeignKey
3} from "sequelize-typescript";
4import { Emoji } from "./emoji.js";
5import { Post } from "./post.js";
6
7export interface PostEmojiRelationsAttributes {
8 id?: number;
9 createdAt?: Date;
10 updatedAt?: Date;
11 postId: string;
12 emojiId: string;
13}
14
15@Table({
16 tableName: "postEmojiRelations",
17 modelName: "postEmojiRelations",
18 timestamps: true
19})
20export class PostEmojiRelations extends Model<PostEmojiRelationsAttributes, PostEmojiRelationsAttributes> implements PostEmojiRelationsAttributes {
21 @ForeignKey(() => Post)
22 @Column({
23 primaryKey: true,
24 type: DataType.UUID
25 })
26 declare postId: string;
27
28 @ForeignKey(() => Emoji)
29 @Column({
30 primaryKey: true,
31 type: DataType.STRING(255)
32 })
33 declare emojiId: string;
34}