Steps to test

1. Run metadata migrations
2. Run sync-metadata on your workspace
3. Enable the following feature flags: 
IS_SEARCH_ENABLED
IS_QUERY_RUNNER_TWENTY_ORM_ENABLED
IS_WORKSPACE_MIGRATED_FOR_SEARCH
4. Type Cmd + K and search anything
This commit is contained in:
Marie
2024-10-03 17:18:49 +02:00
committed by GitHub
parent 4c250dd811
commit 5f9435c718
71 changed files with 1517 additions and 209 deletions

View File

@ -60,6 +60,16 @@ export const seedFeatureFlags = async (
workspaceId: workspaceId,
value: true,
},
{
key: FeatureFlagKey.IsSearchEnabled,
workspaceId: workspaceId,
value: true,
},
{
key: FeatureFlagKey.IsWorkspaceMigratedForSearch,
workspaceId: workspaceId,
value: true,
},
])
.execute();
};

View File

@ -0,0 +1,24 @@
import { MigrationInterface, QueryRunner } from 'typeorm';
export class AddIndexType1725893697807 implements MigrationInterface {
name = 'AddIndexType1725893697807';
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(
`CREATE TYPE metadata."indextype_enum" AS ENUM ('BTREE', 'GIN')`,
);
await queryRunner.query(`
ALTER TABLE metadata."indexMetadata"
ADD COLUMN "indexType" metadata."indextype_enum" NOT NULL DEFAULT 'BTREE';
`);
}
public async down(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`
ALTER TABLE metadata."indexMetadata" DROP COLUMN "indexType"
`);
await queryRunner.query(`DROP TYPE metadata."indextype_enum"`);
}
}

View File

@ -0,0 +1,22 @@
import { MigrationInterface, QueryRunner } from 'typeorm';
export class AddTypeOrmMetadata1726848397026 implements MigrationInterface {
name = 'AddTypeOrmMetadata1726848397026';
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`
CREATE TABLE "core"."typeorm_metadata" (
"type" character varying NOT NULL,
"database" character varying,
"schema" character varying,
"table" character varying,
"name" character varying,
"value" text
)
`);
}
public async down(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`DROP TABLE "core"."typeorm_metadata"`);
}
}

View File

@ -0,0 +1,23 @@
import { MigrationInterface, QueryRunner } from 'typeorm';
export class AddIsCustomColumnToIndexMetadata1727699709905
implements MigrationInterface
{
name = 'AddIsCustomColumnToIndexMetadata1727699709905';
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`
ALTER TABLE "metadata"."indexMetadata"
ADD COLUMN "isCustom" BOOLEAN
NOT NULL
DEFAULT FALSE;
`);
}
public async down(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`
ALTER TABLE "metadata"."indexMetadata"
DROP COLUMN "isCustom"
`);
}
}