File tree Expand file tree Collapse file tree 4 files changed +33
-2
lines changed Expand file tree Collapse file tree 4 files changed +33
-2
lines changed Original file line number Diff line number Diff line change @@ -42,6 +42,7 @@ export interface ChatInstance {
42
42
resetCron ?: string
43
43
courseId ?: string
44
44
prompts : Prompt [ ]
45
+ courseUnitRealisationTypeUrn ?: string
45
46
}
46
47
47
48
export interface AccessGroup {
Original file line number Diff line number Diff line change
1
+ import { DataTypes } from 'sequelize'
2
+
3
+ import { Migration } from '../connection'
4
+
5
+ export const up : Migration = async ( { context : queryInterface } ) => {
6
+ await queryInterface . addColumn (
7
+ 'chat_instances' ,
8
+ 'course_unit_realisation_type_urn' ,
9
+ {
10
+ type : DataTypes . STRING ,
11
+ allowNull : true ,
12
+ defaultValue : null ,
13
+ }
14
+ )
15
+ }
16
+
17
+ export const down : Migration = async ( { context : queryInterface } ) => {
18
+ await queryInterface . removeColumn (
19
+ 'chat_instances' ,
20
+ 'course_unit_realisation_type_urn'
21
+ )
22
+ }
Original file line number Diff line number Diff line change @@ -28,6 +28,8 @@ class ChatInstance extends Model<
28
28
declare courseId : string | null
29
29
30
30
declare activityPeriod : ActivityPeriod | null
31
+
32
+ declare courseUnitRealisationTypeUrn : string | null
31
33
}
32
34
33
35
ChatInstance . init (
@@ -72,6 +74,11 @@ ChatInstance.init(
72
74
allowNull : true ,
73
75
defaultValue : null ,
74
76
} ,
77
+ courseUnitRealisationTypeUrn : {
78
+ type : DataTypes . STRING ,
79
+ allowNull : true ,
80
+ defaultValue : null ,
81
+ } ,
75
82
} ,
76
83
{
77
84
underscored : true ,
Original file line number Diff line number Diff line change @@ -52,6 +52,7 @@ const createChatInstance = async (
52
52
} ,
53
53
courseId : course . id ,
54
54
activityPeriod : course . activityPeriod ,
55
+ courseUnitRealisationTypeUrn : course . courseUnitRealisationTypeUrn ,
55
56
}
56
57
} )
57
58
@@ -65,8 +66,8 @@ const createChatInstance = async (
65
66
conflictAttributes : [ 'courseId' ] ,
66
67
} ,
67
68
fallbackCreateOptions : {
68
- fields : [ 'courseId' ]
69
- }
69
+ fields : [ 'courseId' ] ,
70
+ } ,
70
71
} )
71
72
}
72
73
You can’t perform that action at this time.
0 commit comments