summary refs log tree commit diff
path: root/src/database/entities/ReadState.ts
diff options
context:
space:
mode:
authorRory& <root@rory.gay>2026-07-03 15:40:47 +0200
committerRory& <root@rory.gay>2026-07-03 15:40:47 +0200
commitd58aab06a7f0de45b7174c7c36c05eb2c0fd1ae0 (patch)
treef71d98c9fc3d01374da87e65d01b8fa0d5308f93 /src/database/entities/ReadState.ts
parentFix column names for join tables (diff)
downloadserver-ts-d58aab06a7f0de45b7174c7c36c05eb2c0fd1ae0.tar.xz
Fix constraint names
Diffstat (limited to 'src/database/entities/ReadState.ts')
-rw-r--r--src/database/entities/ReadState.ts12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/database/entities/ReadState.ts b/src/database/entities/ReadState.ts

index 4d15c6cc..6a133693 100644 --- a/src/database/entities/ReadState.ts +++ b/src/database/entities/ReadState.ts
@@ -31,30 +31,30 @@ import { ReadStateFlags, ReadStateType } from "@spacebar/schemas"; }) @Index(["channel_id", "user_id"], { unique: true }) export class ReadState extends BaseClass { - @Column() + @Column({ type: "int8" }) @RelationId((read_state: ReadState) => read_state.channel) channel_id: string; - @JoinColumn({ name: "channel_id" }) + @JoinColumn({ name: "channel_id", foreignKeyConstraintName: "FK_read_state_channel_id" }) @ManyToOne(() => Channel, { onDelete: "CASCADE", }) channel: Channel; - @Column() + @Column({ type: "int8" }) @RelationId((read_state: ReadState) => read_state.user) user_id: string; - @JoinColumn({ name: "user_id" }) + @JoinColumn({ name: "user_id", foreignKeyConstraintName: "FK_read_state_user_id" }) @ManyToOne(() => User, { onDelete: "CASCADE", }) user: User; - @Column({ nullable: true }) + @Column({ type: "int8", nullable: true }) last_message_id?: string; - @Column({ nullable: true }) + @Column({ type: "int8", nullable: true }) last_acked_id?: string; @Column({ nullable: true })