forked from activepieces/activepieces
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request activepieces#5341 from activepieces/fix/event-rout…
…ing-1 fix: db index on app event routing
- Loading branch information
Showing
5 changed files
with
71 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
...erver/api/src/app/database/migration/common/1723549873495-ChangeEventRoutingConstraint.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import { MigrationInterface, QueryRunner } from 'typeorm' | ||
|
||
export class ChangeEventRoutingConstraint1723549873495 implements MigrationInterface { | ||
name = 'ChangeEventRoutingConstraint1723549873495' | ||
|
||
public async up(queryRunner: QueryRunner): Promise<void> { | ||
await queryRunner.query(` | ||
DROP INDEX "idx_app_event_project_id_appName_identifier_value_event" | ||
`) | ||
await queryRunner.query(` | ||
CREATE UNIQUE INDEX "idx_app_event_flow_id_project_id_appName_identifier_value_event" ON "app_event_routing" ( | ||
"appName", | ||
"projectId", | ||
"flowId", | ||
"identifierValue", | ||
"event" | ||
) | ||
`) | ||
} | ||
|
||
public async down(queryRunner: QueryRunner): Promise<void> { | ||
await queryRunner.query(` | ||
DROP INDEX "idx_app_event_flow_id_project_id_appName_identifier_value_event" | ||
`) | ||
await queryRunner.query(` | ||
CREATE UNIQUE INDEX "idx_app_event_project_id_appName_identifier_value_event" ON "app_event_routing" ( | ||
"appName", | ||
"projectId", | ||
"identifierValue", | ||
"event" | ||
) | ||
`) | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters