Commit 65fee32e authored by ncastejon's avatar ncastejon
Browse files

Add elasticSearchMd5 property to Organization entity + migration

parent 39b38fdc
Pipeline #2406 passed with stages
in 1 minute and 19 seconds
import {MigrationInterface, QueryRunner} from 'typeorm';
export class AddESMd51546865861884 implements MigrationInterface {
public async up(queryRunner: QueryRunner): Promise<any> {
await queryRunner.query(`ALTER TABLE "organization" ADD "elasticSearchMd5" character varying(100)`);
}
public async down(queryRunner: QueryRunner): Promise<any> {
await queryRunner.query(`ALTER TABLE "organization" DROP COLUMN "elasticSearchMd5"`);
}
}
......@@ -2,6 +2,7 @@ import { Organization } from './organization.entity';
import { Link } from '../links/link.dto';
import { ApiModelProperty, ApiModelPropertyOptional } from '@nestjs/swagger';
import { IsString, IsOptional, IsArray, MaxLength, IsDefined } from 'class-validator';
import { isString } from 'util';
export class OrganizationDTO {
@ApiModelProperty()
......@@ -13,6 +14,10 @@ export class OrganizationDTO {
@IsString()
description: string;
@ApiModelPropertyOptional()
@IsString()
elasticSearchMd5?: string;
@ApiModelPropertyOptional()
@IsOptional()
@IsString()
......
......@@ -7,9 +7,12 @@ export class Organization {
@PrimaryGeneratedColumn()
id: number;
@Column({ length: 200})
@Column({ length: 200 })
name: string;
@Column({ length: 100, nullable: true })
elasticSearchMd5: string;
@Column('text')
description: string;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment