Skip to content

Commit

Permalink
fix: add missing enum definitions to orm columns to let migration-cli…
Browse files Browse the repository at this point in the history
… work
  • Loading branch information
kgajowy committed Aug 9, 2021
1 parent d6c666f commit 915bdb2
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ export class ApiEvent {
*/
@ApiProperty()
@IsEnum(Object.values(API_EVENT_KINDS))
@Column('enum')
@Column('enum', { enum: API_EVENT_KINDS })
kind!: string;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export class ApiEventByTopicAndKind {

@ApiProperty()
@IsEnum(Object.values(API_EVENT_KINDS))
@PrimaryColumn('enum')
@PrimaryColumn('enum', { enum: API_EVENT_KINDS })
kind!: API_EVENT_KINDS;

@ApiProperty()
Expand Down
5 changes: 4 additions & 1 deletion api/apps/api/src/modules/projects/project.api.entity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,10 @@ export class Project extends TimeUserEntityMetadata {
* to fromShapefile, and handle the upload of the shapefile separately.
*/
@ApiProperty()
@Column('enum', { name: 'planning_unit_grid_shape' })
@Column('enum', {
name: 'planning_unit_grid_shape',
enum: PlanningUnitGridShape,
})
planningUnitGridShape?: PlanningUnitGridShape;

/**
Expand Down
8 changes: 6 additions & 2 deletions api/apps/api/src/modules/scenarios/scenario.api.entity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,9 @@ export class Scenario extends TimeUserEntityMetadata {
description?: string;

@ApiProperty({ enum: ScenarioType, enumName: 'ScenarioType' })
@Column('enum')
@Column('enum', {
enum: ScenarioType,
})
type!: ScenarioType;

/**
Expand Down Expand Up @@ -151,7 +153,9 @@ export class Scenario extends TimeUserEntityMetadata {
* @todo Check description.
*/
@ApiProperty({ enum: JobStatus, enumName: 'JobStatus' })
@Column('enum')
@Column('enum', {
enum: JobStatus,
})
status!: JobStatus;

/**
Expand Down

0 comments on commit 915bdb2

Please sign in to comment.