-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCharacteristics.js
More file actions
279 lines (278 loc) · 8.76 KB
/
Copy pathCharacteristics.js
File metadata and controls
279 lines (278 loc) · 8.76 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
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
'use strict'
module.exports = (sequelize, DataTypes) => {
const Characteristics = sequelize.define(
'Characteristics', {
id: {
type: DataTypes.INTEGER(15).UNSIGNED,
primaryKey: true,
allowNull: false,
autoIncrement: true
},
agency_id: {
type: DataTypes.INTEGER(15).UNSIGNED,
allowNull: false
},
source_year: {
type: DataTypes.INTEGER(4),
allowNull: false,
comment: 'XWK_6 - Year of merged data'
},
source_name: {
type: DataTypes.STRING(100),
comment: 'XWK_7 - Data Source Name'
},
is_imputed: {
type: DataTypes.BOOLEAN,
allowNull: false,
defaultValue: false,
comment: 'LEM_1-38 Indicates Imputed Data'
},
incentives_education: {
type: DataTypes.BOOLEAN,
comment: 'LEM_3 Agency Educational Incentives, LEMAS'
},
incentives_tuition: {
type: DataTypes.BOOLEAN,
comment: 'LEM_4 Agency Tuition Incentives, LEMAS'
},
training_types: {
type: DataTypes.INTEGER(3),
comment: 'LEM_5 Count of Training Types, LEMAS'
},
training_types_normalized: {
type: DataTypes.INTEGER(3),
comment: 'LEM_6 Count of Training Types Normalized, LEMAS'
},
required_training_hours_all: {
type: DataTypes.INTEGER(4),
comment: 'LEM_7 Count of All Required Training Hours, LEMAS'
},
required_training_hours_recruits: {
type: DataTypes.INTEGER(4),
comment: 'LEM_8 Count of New Recruit Required Training Hours, LEMAS'
},
minimum_education_requirement: {
type: DataTypes.ENUM,
values: ['four-year-college-degree', 'two-year-college-degree', 'some-college-but-no-degree', 'high-school-diploma-or-equivalent', 'no-formal-education'],
comment: 'LEM_9 Minimum Education Requirement, LEMAS'
},
sworn_full_time_men: {
type: DataTypes.INTEGER(6),
comment: 'LEM_1 Count of Men FT Sworn, LEMAS'
},
sworn_full_time_men_percent: {
type: DataTypes.INTEGER(3),
comment: 'LEM_28 % Men FT Sworn, LEMAS'
},
sworn_full_time_women: {
type: DataTypes.INTEGER(6),
comment: 'LEM_2 Count of Women FT Sworn, LEMAS'
},
sworn_full_time_women_percent: {
type: DataTypes.INTEGER(3),
comment: 'LEM_27 % Women FT Sworn, LEMAS'
},
sworn_full_time_black: {
type: DataTypes.INTEGER(6),
comment: 'LEM_11 Count Black FT Sworn, LEMAS'
},
sworn_full_time_black_percent: {
type: DataTypes.INTEGER(3),
comment: 'LEM_20 % Black FT Sworn, LEMAS'
},
sworn_full_time_white: {
type: DataTypes.INTEGER(6),
comment: 'LEM_10 Count White FT Sworn, LEMAS'
},
sworn_full_time_white_percent: {
type: DataTypes.INTEGER(3),
comment: 'LEM_19 % White FT Sworn, LEMAS'
},
sworn_full_time_hispanic: {
type: DataTypes.INTEGER(6),
comment: 'LEM_12 Count Hispanic FT Sworn, LEMAS'
},
sworn_full_time_hispanic_percent: {
type: DataTypes.INTEGER(3),
comment: 'LEM_21 % Hispanic FT Sworn, LEMAS'
},
sworn_full_time_indian: {
type: DataTypes.INTEGER(6),
comment: 'LEM_13 Count American Indian FT Sworn, LEMAS'
},
sworn_full_time_indian_percent: {
type: DataTypes.INTEGER(3),
comment: 'LEM_22 % American Indian FT Sworn, LEMAS'
},
sworn_full_time_asian: {
type: DataTypes.INTEGER(6),
comment: 'LEM_14 Count Asian American FT Sworn, LEMAS'
},
sworn_full_time_asian_percent: {
type: DataTypes.INTEGER(3),
comment: 'LEM_23 % Asian American FT Sworn, LEMAS'
},
sworn_full_time_hawaiian: {
type: DataTypes.INTEGER(6),
comment: 'LEM_15 Count Native Hawaiian FT Sworn, LEMAS'
},
sworn_full_time_hawaiian_percent: {
type: DataTypes.INTEGER(3),
comment: 'LEM_24 % Native Hawaiian FT Sworn, LEMAS'
},
sworn_full_time_unreported: {
type: DataTypes.INTEGER(6),
comment: 'LEM_16 Count Unreported Race FT Sworn, LEMAS'
},
sworn_full_time_unreported_percent: {
type: DataTypes.INTEGER(3),
comment: 'LEM_26 % Unreported Race FT Sworn, LEMAS'
},
sworn_full_time_other: {
type: DataTypes.INTEGER(6),
comment: 'LEM_17 Count Other Race FT Sworn, LEMAS'
},
sworn_full_time_other_percent: {
type: DataTypes.INTEGER(3),
comment: 'LEM_25 % Other Race FT Sworn, LEMAS'
},
sworn_full_time_total: {
type: DataTypes.INTEGER(6),
comment: 'LEM_18 Count Total Pop FT Sworn, LEMAS'
},
has_lethal_force_policy: {
type: DataTypes.BOOLEAN,
comment: 'LEM_29 Written Lethal Force Policy, LEMAS'
},
has_less_than_lethal_force_policy: {
type: DataTypes.BOOLEAN,
comment: 'LEM_30 Written Less than Lethal Force Policy, LEMAS'
},
has_conduct_appearance_policy: {
type: DataTypes.BOOLEAN,
comment: 'LEM_31 Written Conduct/Appearance Policy, LEMAS'
},
has_off_duty_employee_policy: {
type: DataTypes.BOOLEAN,
comment: 'LEM_32 Written Off Duty Emp Policy, LEMAS'
},
has_off_max_hours_policy: {
type: DataTypes.BOOLEAN,
comment: 'LEM_33 Written Off Max Hours Policy, LEMAS'
},
has_domestic_dispute_policy: {
type: DataTypes.BOOLEAN,
comment: 'LEM_36 Domestic Dispute Policy, LEMAS'
},
has_civilian_board_for_excessive_force_complaints: {
type: DataTypes.BOOLEAN,
comment: 'LEM_37 Civilian Board for Excessive Force Complaints, LEMAS'
},
has_independent_investigative_authority_board: {
type: DataTypes.BOOLEAN,
comment: 'LEM_38 Independent Investigative Authority for Board, LEMAS'
},
pursuits_must_be_reviewed: {
type: DataTypes.BOOLEAN,
comment: 'LEM_35 Pursuits Must Be Reviewed, LEMAS'
},
policy_pursuit: {
type: DataTypes.INTEGER(1),
comment: 'LEM_34 Description of Written Pursuit Policy, LEMAS'
},
non_missing: {
type: DataTypes.INTEGER(1),
comment: 'LEM_39 Count of nonmissing LEMAS'
}
}, {
timestamps: true,
paranoid: true,
freezeTableName: true,
singular: 'characteristic',
plural: 'characteristics',
tableName: 'characteristics',
engine: 'InnoDB',
collate: 'utf8_unicode_ci',
charset: 'utf8mb4',
comment: 'Police Department Characteristics',
indexes: [
{
name: 'characteristics_agency_year_ix',
using: 'BTREE',
fields: ['agency_id', 'source_year']
},
{
name: 'characteristics_year_ix',
using: 'BTREE',
fields: ['source_year']
},
{
name: 'characteristics_imputed_ix',
using: 'BTREE',
fields: ['is_imputed']
},
{
name: 'characteristics_education_ix',
using: 'BTREE',
fields: ['incentives_education']
},
{
name: 'characteristics_tuition_ix',
using: 'BTREE',
fields: ['incentives_tuition']
},
{
name: 'characteristics_lethal_ix',
using: 'BTREE',
fields: ['has_lethal_force_policy']
},
{
name: 'characteristics_less_lethal_ix',
using: 'BTREE',
fields: ['has_less_than_lethal_force_policy']
},
{
name: 'characteristics_conduct_ix',
using: 'BTREE',
fields: ['has_conduct_appearance_policy']
},
{
name: 'characteristics_off_duty_ix',
using: 'BTREE',
fields: ['has_off_duty_employee_policy']
},
{
name: 'characteristics_off_max_ix',
using: 'BTREE',
fields: ['has_off_max_hours_policy']
},
{
name: 'characteristics_domestic_ix',
using: 'BTREE',
fields: ['has_domestic_dispute_policy']
},
{
name: 'characteristics_civilian_ix',
using: 'BTREE',
fields: ['has_civilian_board_for_excessive_force_complaints']
},
{
name: 'characteristics_independent_ix',
using: 'BTREE',
fields: ['has_independent_investigative_authority_board']
},
{
name: 'characteristics_pursuits_ix',
using: 'BTREE',
fields: ['pursuits_must_be_reviewed']
},
{
name: 'characteristics_minimum_edu_ix',
using: 'BTREE',
fields: ['minimum_education_requirement']
}
]
}
)
return Characteristics
}