Revert "Create an index for contextURL column"

This reverts commit e0f7bfe976924005a4591ed9d3eb9e919111336a.
This commit is contained in:
Gero Posmyk-Leinemann 2022-02-14 16:18:34 +00:00 committed by Robo Quat
parent 7c8c846b9d
commit bcf031498e
2 changed files with 0 additions and 26 deletions

View File

@ -27,7 +27,6 @@ export class DBWorkspace implements Workspace {
ownerId: string;
@Column("text")
@Index('ind_contextURL')
contextURL: string;
@Column({

View File

@ -1,25 +0,0 @@
/**
* Copyright (c) 2022 Gitpod GmbH. All rights reserved.
* Licensed under the GNU Affero General Public License (AGPL).
* See License-AGPL.txt in the project root for license information.
*/
import {MigrationInterface, QueryRunner} from "typeorm";
import { indexExists } from "./helper/helper";
export class IndexWorkspaceContextUrl1644327547997 implements MigrationInterface {
public async up(queryRunner: QueryRunner): Promise<void> {
const TABLE_NAME = "d_b_workspace";
const INDEX_NAME = "ind_contextURL";
if(!(await indexExists(queryRunner, TABLE_NAME, INDEX_NAME))) {
await queryRunner.query("ALTER TABLE d_b_workspace MODIFY COLUMN `contextURL` varchar(255) NOT NULL");
await queryRunner.query(`CREATE INDEX ${INDEX_NAME} ON ${TABLE_NAME} (contextURL)`);
}
}
public async down(queryRunner: QueryRunner): Promise<void> {
}
}