-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathCourseSettings.pm
More file actions
118 lines (90 loc) · 2.41 KB
/
CourseSettings.pm
File metadata and controls
118 lines (90 loc) · 2.41 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
package DB::Schema::Result::CourseSettings;
use base qw/DBIx::Class::Core/;
use strict;
use warnings;
=head1 DESCRIPTION
This is the database schema for a CourseSetting.
=head2 fields
=over
=item *
C<course_settings_id>: database id (autoincrement integer)
=item *
C<course_id>: database id of the course for the setting (foreign key)
=item *
C<general>: a JSON object of general settings
=item *
C<optional>: a JSON object of optional settings
=item *
C<problem_set>: a JSON object that stores settings on the problem set level
=item *
C<problem>: a JSON object that stores settings on the problem level
=item *
C<permissions>: a JSON object that stores settings for permissions
=item *
C<email>: a JSON object that stores email settings
=back
=cut
__PACKAGE__->table('course_settings');
__PACKAGE__->load_components(qw/InflateColumn::Serializer Core/);
__PACKAGE__->add_columns(
course_settings_id => {
data_type => 'integer',
size => 16,
is_auto_increment => 1,
},
course_id => {
data_type => 'integer',
size => 16,
},
general => {
data_type => 'text',
size => 256,
default_value => '{}',
retrieve_on_insert => 1,
serializer_class => 'JSON',
serializer_options => { utf8 => 1 }
},
optional => {
data_type => 'text',
size => 256,
default_value => '{}',
retrieve_on_insert => 1,
serializer_class => 'JSON',
serializer_options => { utf8 => 1 }
},
problem_set => {
data_type => 'text',
size => 256,
default_value => '{}',
retrieve_on_insert => 1,
serializer_class => 'JSON',
serializer_options => { utf8 => 1 }
},
problem => {
data_type => 'text',
size => 256,
default_value => '{}',
retrieve_on_insert => 1,
serializer_class => 'JSON',
serializer_options => { utf8 => 1 }
},
permissions => {
data_type => 'text',
size => 256,
default_value => '{}',
retrieve_on_insert => 1,
serializer_class => 'JSON',
serializer_options => { utf8 => 1 }
},
email => {
data_type => 'text',
size => 256,
default_value => '{}',
retrieve_on_insert => 1,
serializer_class => 'JSON',
serializer_options => { utf8 => 1 }
}
);
__PACKAGE__->set_primary_key('course_settings_id');
__PACKAGE__->belongs_to(course => 'DB::Schema::Result::Course', 'course_id');
1;