File tree Expand file tree Collapse file tree 1 file changed +15
-1
lines changed
data-migration/src/migrators Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -39,6 +39,20 @@ class ChallengeWinnerMigrator extends BaseMigrator {
3939 record [ this . getIdField ( ) ] = uuidv4 ( ) ;
4040 }
4141
42+ if ( typeof record . userId === 'string' ) {
43+ const trimmedUserId = record . userId . trim ( ) ;
44+ if ( / ^ - ? \d + $ / . test ( trimmedUserId ) ) {
45+ record . userId = Number . parseInt ( trimmedUserId , 10 ) ;
46+ }
47+ }
48+
49+ if ( typeof record . placement === 'string' ) {
50+ const trimmedPlacement = record . placement . trim ( ) ;
51+ if ( / ^ - ? \d + $ / . test ( trimmedPlacement ) ) {
52+ record . placement = Number . parseInt ( trimmedPlacement , 10 ) ;
53+ }
54+ }
55+
4256 if ( record . type ) {
4357 record . type = prizeSetTypeMap [ record . type ] || Prisma . skip ;
4458 }
@@ -48,4 +62,4 @@ class ChallengeWinnerMigrator extends BaseMigrator {
4862
4963}
5064
51- module . exports = { ChallengeWinnerMigrator }
65+ module . exports = { ChallengeWinnerMigrator }
You can’t perform that action at this time.
0 commit comments