File tree Expand file tree Collapse file tree 3 files changed +18
-3
lines changed Expand file tree Collapse file tree 3 files changed +18
-3
lines changed Original file line number Diff line number Diff line change 481
481
},
482
482
{
483
483
"name" : " entry_weekly_recurring_check" ,
484
- "expression" : " weekday >= 1" ,
485
- "definition" : " check ((weekday >= 1))" ,
484
+ "expression" : " weekly_recurring >= 1" ,
485
+ "definition" : " check ((weekly_recurring >= 1))" ,
486
486
"columnName" : " weekly_recurring"
487
487
}
488
488
],
Original file line number Diff line number Diff line change
1
+ import { Migration } from "@mikro-orm/migrations" ;
2
+
3
+ export class Migration20241209144817 extends Migration {
4
+ override async up ( ) : Promise < void > {
5
+ this . addSql ( `alter table "entry" drop constraint entry_weekly_recurring_check;` ) ;
6
+
7
+ this . addSql ( `alter table "entry" add constraint entry_weekly_recurring_check check(weekly_recurring >= 1);` ) ;
8
+ }
9
+
10
+ override async down ( ) : Promise < void > {
11
+ this . addSql ( `alter table "entry" drop constraint entry_weekly_recurring_check;` ) ;
12
+
13
+ this . addSql ( `alter table "entry" add constraint entry_weekly_recurring_check check(weekday >= 1);` ) ;
14
+ }
15
+ }
Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ export class Entry extends BaseEntity {
20
20
weekday ! : number ;
21
21
22
22
@Property ( { default : 1 , columnType : "smallint" } )
23
- @Check < Entry > ( { expression : ( columns ) => `${ columns . weekday } >= 1` } )
23
+ @Check < Entry > ( { expression : ( columns ) => `${ columns . weeklyRecurring } >= 1` } )
24
24
weeklyRecurring ! : number & Opt ;
25
25
26
26
@ManyToOne ( )
You can’t perform that action at this time.
0 commit comments