diff --git a/packages/uni-info-watcher/src/entity/Event.ts b/packages/uni-info-watcher/src/entity/Event.ts index a854c405..8bb47f6f 100644 --- a/packages/uni-info-watcher/src/entity/Event.ts +++ b/packages/uni-info-watcher/src/entity/Event.ts @@ -7,7 +7,7 @@ import { BlockProgress } from './BlockProgress'; @Entity() // Index to query events by block and event index. -@Index(['block', 'index']) +@Index(['block', 'index'], { unique: true }) export class Event { @PrimaryGeneratedColumn() id!: number; diff --git a/packages/uni-watcher/src/entity/Event.ts b/packages/uni-watcher/src/entity/Event.ts index 9a2689ad..d2692cc5 100644 --- a/packages/uni-watcher/src/entity/Event.ts +++ b/packages/uni-watcher/src/entity/Event.ts @@ -9,7 +9,7 @@ export const UNKNOWN_EVENT_NAME = '__unknown__'; @Entity() // Index to query events by block and event index. -@Index(['block', 'index']) +@Index(['block', 'index'], { unique: true }) export class Event { @PrimaryGeneratedColumn() id!: number;