Skip to content

Commit

Permalink
Merge pull request #3362 from energywebfoundation/fix-importing-irec-…
Browse files Browse the repository at this point in the history
…device

fix(origin-device-registry-irec-local-api): fix importing irec device
  • Loading branch information
soanvig authored Jul 25, 2022
2 parents 8bbd97d + 0cc03d1 commit 4048d1b
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { MigrationInterface, QueryRunner } from 'typeorm';

export class OptionalDeviceDefaultAccount1658754779650 implements MigrationInterface {
name = 'OptionalDeviceDefaultAccount1658754779650';

public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(
`ALTER TABLE "irec_device_registry_device" ALTER COLUMN "defaultAccount" DROP NOT NULL`
);
}

public async down(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(
`ALTER TABLE "irec_device_registry_device" ALTER COLUMN "defaultAccount" SET NOT NULL`
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ export class Device extends ExtendedBaseEntity implements DeviceDTO {
name: string;

@ApiProperty({ type: String })
@Column()
defaultAccount: string;
@Column({ nullable: true })
defaultAccount: string | null;

@ApiProperty({ type: String })
@Column()
Expand Down

0 comments on commit 4048d1b

Please sign in to comment.