mirror of
https://github.com/outline/outline.git
synced 2026-01-06 11:09:55 -06:00
* groupuser namespace * remove namespace * handle reactions * handle group memberships * cache changeset before all create and update flows
54 lines
1.1 KiB
TypeScript
54 lines
1.1 KiB
TypeScript
import { InferAttributes, InferCreationAttributes } from "sequelize";
|
|
import {
|
|
Column,
|
|
DataType,
|
|
BelongsTo,
|
|
ForeignKey,
|
|
Table,
|
|
Length,
|
|
} from "sequelize-typescript";
|
|
import Collection from "./Collection";
|
|
import Document from "./Document";
|
|
import User from "./User";
|
|
import IdModel from "./base/IdModel";
|
|
import Fix from "./decorators/Fix";
|
|
|
|
@Table({ tableName: "stars", modelName: "star" })
|
|
@Fix
|
|
class Star extends IdModel<
|
|
InferAttributes<Star>,
|
|
Partial<InferCreationAttributes<Star>>
|
|
> {
|
|
@Length({
|
|
max: 256,
|
|
msg: `index must be 256 characters or less`,
|
|
})
|
|
@Column
|
|
index: string | null;
|
|
|
|
// associations
|
|
|
|
@BelongsTo(() => User, "userId")
|
|
user: User;
|
|
|
|
@ForeignKey(() => User)
|
|
@Column(DataType.UUID)
|
|
userId: string;
|
|
|
|
@BelongsTo(() => Document, "documentId")
|
|
document: Document | null;
|
|
|
|
@ForeignKey(() => Document)
|
|
@Column(DataType.UUID)
|
|
documentId: string | null;
|
|
|
|
@BelongsTo(() => Collection, "collectionId")
|
|
collection: Collection | null;
|
|
|
|
@ForeignKey(() => Collection)
|
|
@Column(DataType.UUID)
|
|
collectionId: string | null;
|
|
}
|
|
|
|
export default Star;
|