Search (#7237)
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:
@ -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();
|
||||
};
|
||||
|
||||
@ -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"`);
|
||||
}
|
||||
}
|
||||
@ -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"`);
|
||||
}
|
||||
}
|
||||
@ -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"
|
||||
`);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user