From 26ea83348661e20805f540156c5d9f45090e19d0 Mon Sep 17 00:00:00 2001 From: prathamesh0 Date: Fri, 16 Sep 2022 17:14:12 +0530 Subject: [PATCH] Make index on block and event index unique in event table --- packages/uni-info-watcher/src/entity/Event.ts | 2 +- packages/uni-watcher/src/entity/Event.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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;