forked from openwebwork/webwork3
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathGlobalSetting.pm
More file actions
117 lines (86 loc) · 2.18 KB
/
GlobalSetting.pm
File metadata and controls
117 lines (86 loc) · 2.18 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
package DB::Schema::Result::GlobalSetting;
use base qw/DBIx::Class::Core/;
use strict;
use warnings;
=head1 DESCRIPTION
This is the database schema for the Global Course Settings.
=head2 fields
=over
=item *
C<setting_id>: database id (autoincrement integer)
=item *
C<setting_name>: the name of the setting
=item *
C<default_value>: a JSON object of the default value for the setting
=item *
C<description>: a short description of the setting
=item *
C<doc>: more extensive help documentation.
=item *
C<type>: a string representation of the type of setting (boolean, text, list, ...)
=item *
C<options>: a JSON object that stores options if the setting is an list or multilist
=item *
C<category>: the category the setting falls into
=item *
C<subcategory>: the subcategory of the setting (may be null)
=back
=cut
__PACKAGE__->table('global_setting');
__PACKAGE__->load_components('InflateColumn::Serializer', 'Core');
__PACKAGE__->add_columns(
setting_id => {
data_type => 'integer',
size => 16,
is_nullable => 0,
is_auto_increment => 1,
},
setting_name => {
data_type => 'varchar',
size => 256,
is_nullable => 0,
},
default_value => {
data_type => 'text',
is_nullable => 0,
default_value => '\'\'',
serializer_class => 'JSON',
serializer_options => { utf8 => 1 }
},
description => {
data_type => 'text',
is_nullable => 0,
default_value => '',
},
doc => {
data_type => 'text',
is_nullable => 1,
},
type => {
data_type => 'varchar',
size => 16,
is_nullable => 0,
default_value => '',
},
options => {
data_type => 'text',
is_nullable => 1,
serializer_class => 'JSON',
serializer_options => { utf8 => 1 }
},
category => {
data_type => 'varchar',
size => 64,
is_nullable => 0,
default_value => ''
},
subcategory => {
data_type => 'varchar',
size => 64,
is_nullable => 1
}
);
__PACKAGE__->set_primary_key('setting_id');
__PACKAGE__->has_many(course_settings => 'DB::Schema::Result::CourseSetting', 'setting_id');
# __PACKAGE__->belongs_to(course => 'DB::Schema::Result::Course', 'course_id');
1;