Add index stopped at (#766)

* 🚧 add index on sqlite

* 🚧 add migration for postgres

* 🚧 add mysql migration

* 🚧 add mongodb migration

*  revert change of default postgresdb user
This commit is contained in:
Ben Hesseldieck
2020-07-17 17:08:40 +02:00
committed by GitHub
parent 479606753b
commit ebe2775701
15 changed files with 128 additions and 9 deletions

View File

@@ -39,6 +39,7 @@ export class ExecutionEntity implements IExecutionFlattedDb {
@Column('datetime')
startedAt: Date;
@Index()
@Column('datetime')
stoppedAt: Date;

View File

@@ -0,0 +1,20 @@
import {MigrationInterface, QueryRunner} from "typeorm";
import * as config from '../../../../config';
export class CreateIndexStoppedAt1594902918301 implements MigrationInterface {
name = 'CreateIndexStoppedAt1594902918301'
public async up(queryRunner: QueryRunner): Promise<void> {
const tablePrefix = config.get('database.tablePrefix');
await queryRunner.query('CREATE INDEX `IDX_' + tablePrefix + 'cefb067df2402f6aed0638a6c1` ON `' + tablePrefix + 'execution_entity` (`stoppedAt`)');
}
public async down(queryRunner: QueryRunner): Promise<void> {
const tablePrefix = config.get('database.tablePrefix');
await queryRunner.query('DROP INDEX `IDX_' + tablePrefix + 'cefb067df2402f6aed0638a6c1` ON `' + tablePrefix + 'execution_entity`');
}
}

View File

@@ -1,2 +1,3 @@
export * from './1588157391238-InitialMigration';
export * from './1592447867632-WebhookModel';
export * from './1594902918301-CreateIndexStoppedAt';