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#4078 from activepieces/fiix/remove-un…
…used-index fix: remove unused index
- Loading branch information
Showing
4 changed files
with
59 additions
and
2 deletions.
There are no files selected for viewing
33 changes: 33 additions & 0 deletions
33
packages/server/api/src/app/database/migration/1709505632771-SetNotNullOnPlatform.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,33 @@ | ||
import { MigrationInterface, QueryRunner } from 'typeorm' | ||
|
||
export class SetNotNullOnPlatform1709505632771 implements MigrationInterface { | ||
name = 'SetNotNullOnPlatform1709505632771' | ||
|
||
public async up(queryRunner: QueryRunner): Promise<void> { | ||
await queryRunner.query(` | ||
DROP INDEX "public"."idx_project_platform_id_external_id" | ||
`) | ||
await queryRunner.query(` | ||
ALTER TABLE "project" | ||
ALTER COLUMN "platformId" | ||
SET NOT NULL | ||
`) | ||
await queryRunner.query(` | ||
CREATE UNIQUE INDEX "idx_project_platform_id_external_id" ON "project" ("platformId", "externalId") | ||
`) | ||
} | ||
|
||
public async down(queryRunner: QueryRunner): Promise<void> { | ||
await queryRunner.query(` | ||
DROP INDEX "public"."idx_project_platform_id_external_id" | ||
`) | ||
await queryRunner.query(` | ||
ALTER TABLE "project" | ||
ALTER COLUMN "platformId" DROP NOT NULL | ||
`) | ||
await queryRunner.query(` | ||
CREATE UNIQUE INDEX "idx_project_platform_id_external_id" ON "project" ("platformId", "externalId") | ||
`) | ||
} | ||
|
||
} |
19 changes: 19 additions & 0 deletions
19
...s/server/api/src/app/database/migration/postgres/1709500873378-DropUnusedPlatformIndex.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,19 @@ | ||
import { MigrationInterface, QueryRunner } from 'typeorm' | ||
|
||
export class DropUnusedPlatformIndex1709500873378 implements MigrationInterface { | ||
name = 'DropUnusedPlatformIndex1709500873378' | ||
|
||
public async up(queryRunner: QueryRunner): Promise<void> { | ||
await queryRunner.query(` | ||
ALTER TABLE "project" DROP CONSTRAINT "fk_project_platform_id" | ||
`) | ||
} | ||
|
||
public async down(queryRunner: QueryRunner): Promise<void> { | ||
await queryRunner.query(` | ||
ALTER TABLE "project" | ||
ADD CONSTRAINT "fk_project_platform_id" FOREIGN KEY ("platformId") REFERENCES "platform"("id") ON DELETE NO ACTION ON UPDATE NO ACTION | ||
`) | ||
} | ||
|
||
} |
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