File tree 2 files changed +20
-0
lines changed
2 files changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -23,6 +23,7 @@ import plan from './models/plan';
23
23
import planEntity from './models/planEntity' ;
24
24
import planEntityVersion from './models/planEntityVersion' ;
25
25
import planVersion from './models/planVersion' ;
26
+ import planYear from './models/planYear' ;
26
27
import projectVersion from './models/projectVersion' ;
27
28
import projectVersionAttachment from './models/projectVersionAttachment' ;
28
29
import projectVersionPlan from './models/projectVersionPlan' ;
@@ -54,6 +55,7 @@ export default (conn: Knex) => ({
54
55
planEntity : planEntity ( conn ) ,
55
56
planEntityVersion : planEntityVersion ( conn ) ,
56
57
planVersion : planVersion ( conn ) ,
58
+ planYear : planYear ( conn ) ,
57
59
project : project ( conn ) ,
58
60
projectVersion : projectVersion ( conn ) ,
59
61
projectVersionAttachment : projectVersionAttachment ( conn ) ,
Original file line number Diff line number Diff line change @@ -2,6 +2,9 @@ import * as t from 'io-ts';
2
2
3
3
import { brandedType } from '../../util/io-ts' ;
4
4
import type { Brand } from '../../util/types' ;
5
+ import { defineLegacyVersionedModel } from '../util/legacy-versioned-model' ;
6
+ import { PLAN_ID } from './plan' ;
7
+ import { USAGE_YEAR_ID } from './usageYear' ;
5
8
6
9
export type PlanYearId = Brand <
7
10
number ,
@@ -10,3 +13,18 @@ export type PlanYearId = Brand<
10
13
> ;
11
14
12
15
export const PLAN_YEAR_ID = brandedType < number , PlanYearId > ( t . number ) ;
16
+
17
+ export default defineLegacyVersionedModel ( {
18
+ tableName : 'planYear' ,
19
+ fields : {
20
+ generated : {
21
+ id : { kind : 'branded-integer' , brand : PLAN_YEAR_ID } ,
22
+ } ,
23
+ required : {
24
+ planId : { kind : 'branded-integer' , brand : PLAN_ID } ,
25
+ usageYearId : { kind : 'branded-integer' , brand : USAGE_YEAR_ID } ,
26
+ } ,
27
+ } ,
28
+ idField : 'id' ,
29
+ softDeletionEnabled : true ,
30
+ } ) ;
You can’t perform that action at this time.
0 commit comments