Index v2 runner (#14537)

## Introduction
https://github.com/twentyhq/twenty/pull/14363
In this PR we're creating builder and runner for index metadata
Removing its previous integration within object builder

## Next:
- implem index impact on field and object metadata api
- Add integration testing coverage add integration test on index
- Implement uniqueness toggle in field metadata api
- add integration test on uniqueness

related to https://github.com/twentyhq/core-team-issues/issues/1344
This commit is contained in:
Paul Rastoin
2025-09-17 15:02:43 +02:00
committed by GitHub
parent 6e47c1b5c6
commit 2d8669ae71
55 changed files with 1692 additions and 1064 deletions
@@ -0,0 +1,25 @@
import { type MigrationInterface, type QueryRunner } from 'typeorm';
export class AddUniversalIdentifierToIndexMetadata1758038863448
implements MigrationInterface
{
name = 'AddUniversalIdentifierToIndexMetadata1758038863448';
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(
`ALTER TABLE "core"."indexMetadata" ADD "universalIdentifier" uuid`,
);
await queryRunner.query(
`CREATE UNIQUE INDEX "IDX_b27c681286ac581f81498c5d4b" ON "core"."indexMetadata" ("workspaceId", "universalIdentifier") `,
);
}
public async down(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(
`DROP INDEX "core"."IDX_b27c681286ac581f81498c5d4b"`,
);
await queryRunner.query(
`ALTER TABLE "core"."indexMetadata" DROP COLUMN "universalIdentifier"`,
);
}
}