feat(guild-model): add practical indexes for channel/dm/member queries

This commit is contained in:
nav
2026-05-12 10:21:48 +00:00
parent e53c943991
commit ceaece754e
6 changed files with 20 additions and 4 deletions

View File

@@ -1,10 +1,12 @@
import { Column, CreateDateColumn, Entity, Index, PrimaryGeneratedColumn } from 'typeorm';
@Entity('channels')
@Index(['guildId', 'createdAt'])
export class Channel {
@PrimaryGeneratedColumn('uuid')
id!: string;
@Index()
@Column({ type: 'char', length: 36 })
guildId!: string;
@@ -22,5 +24,6 @@ export class Channel {
lastSeq!: number;
@CreateDateColumn()
@Index()
createdAt!: Date;
}