Skip to content

Commit

Permalink
fix: modify percentage damage to float type
Browse files Browse the repository at this point in the history
  • Loading branch information
gulfaraz committed Dec 8, 2022
1 parent 049e85a commit 3c75d47
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
11 changes: 11 additions & 0 deletions migration/1670507261645-AlterTableEventModifyPercentageFloat.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
module.exports = class AlterTableEventModifyPercentageFloat1670507261645 {
name = 'AlterTableEventModifyPercentageFloat1670507261645'

async up(queryRunner) {
await queryRunner.query(`ALTER TABLE \`events\` MODIFY \`buildings_damaged_percentage\` float NOT NULL`);
}

async down(queryRunner) {
await queryRunner.query(`ALTER TABLE \`events\` MODIFY \`buildings_damaged_percentage\` int NOT NULL`);
}
}
2 changes: 1 addition & 1 deletion src/event/event.entity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export default class EventEntity extends BaseEntity {
@Min(0)
buildingsDamaged!: number;

@Column()
@Column("float")
@IsNumber()
@Min(0)
@Max(1)
Expand Down

0 comments on commit 3c75d47

Please sign in to comment.