erp_work_effort 4.0.0 → 4.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/api/v1/projects_controller.rb +25 -0
- data/app/controllers/api/v1/time_entries_controller.rb +313 -0
- data/app/controllers/api/v1/transportation_routes_controller.rb +9 -0
- data/app/controllers/api/v1/work_effort_associations_controller.rb +102 -0
- data/app/controllers/api/v1/work_effort_party_assignments_controller.rb +136 -0
- data/app/controllers/api/v1/work_effort_types_controller.rb +120 -0
- data/app/controllers/api/v1/work_efforts_controller.rb +284 -0
- data/app/models/associated_transportation_route.rb +8 -5
- data/app/models/cal_evt_party_role.rb +9 -0
- data/app/models/calendar_event.rb +46 -0
- data/app/models/calendar_invite.rb +10 -0
- data/app/models/candidate_submission.rb +37 -0
- data/app/models/experience.rb +11 -0
- data/app/models/extensions/biz_txn_events.rb +35 -0
- data/app/models/extensions/finacial_txns.rb +27 -0
- data/app/models/extensions/order_line_item.rb +12 -0
- data/app/models/extensions/party.rb +204 -0
- data/app/models/party_skill.rb +2 -0
- data/app/models/pay_period.rb +59 -0
- data/app/models/position.rb +8 -0
- data/app/models/position_fulfillment.rb +8 -0
- data/app/models/position_type.rb +12 -0
- data/app/models/project.rb +59 -0
- data/app/models/requirement.rb +2 -0
- data/app/models/resume.rb +11 -0
- data/app/models/shift.rb +22 -0
- data/app/models/skill_type.rb +8 -0
- data/app/models/staffing_position.rb +9 -0
- data/app/models/time_entry.rb +260 -0
- data/app/models/timesheet.rb +194 -0
- data/app/models/timesheet_party_role.rb +21 -0
- data/app/models/transportation_route.rb +103 -18
- data/app/models/transportation_route_segment.rb +44 -0
- data/app/models/transportation_route_stop.rb +19 -0
- data/app/models/wc_code.rb +7 -0
- data/app/models/work_effort.rb +512 -30
- data/app/models/work_effort_association.rb +7 -0
- data/app/models/work_effort_association_type.rb +5 -0
- data/app/models/work_effort_biz_txn_event.rb +22 -0
- data/app/models/work_effort_party_assignment.rb +140 -3
- data/app/models/work_effort_type.rb +5 -0
- data/config/routes.rb +54 -11
- data/db/data_migrations/20150709053041_add_skill_types.rb +27 -0
- data/db/data_migrations/20150709055922_add_position_types.rb +27 -0
- data/db/data_migrations/20150711220000_add_task_tracked_statuses.rb +25 -0
- data/db/data_migrations/20150712081804_add_work_effort_types.rb +23 -0
- data/db/data_migrations/20150718052204_add_project_tracked_statuses.rb +24 -0
- data/db/data_migrations/20150718054404_add_project_party_role_types.rb +14 -0
- data/db/data_migrations/20150812150320_add_work_effort_dependency_types.rb +35 -0
- data/db/migrate/20100220000000_base_work_efforts.rb +310 -89
- data/db/migrate/20150227174108_create_staffing_positions.rb +11 -0
- data/db/migrate/20150305194158_create_wc_codes.rb +24 -0
- data/db/migrate/20150313134411_create_shifts.rb +28 -0
- data/db/migrate/20150325195749_create_candidate_submissions.rb +22 -0
- data/db/migrate/20150327115910_resumes.rb +15 -0
- data/db/migrate/20150401060938_add_resume_parser_statuses.rb +14 -0
- data/db/migrate/20150607181734_create_calendar_events.rb +24 -0
- data/db/migrate/20150616174228_create_cal_evt_party_roles.rb +19 -0
- data/db/migrate/20150707164520_create_calendar_invites.rb +21 -0
- data/db/migrate/20150718052404_create_projects.rb +20 -0
- data/db/migrate/20150812191812_update_work_efforts.rb +59 -0
- data/db/migrate/20150824152639_add_sequence_to_work_effort.rb +9 -0
- data/db/migrate/20150830133951_add_work_effort_biz_txn_events.rb +21 -0
- data/db/migrate/20150908200612_update_time_entries.rb +70 -0
- data/db/migrate/20151115180427_add_defaults_for_work_effort.rb +36 -0
- data/db/migrate/20151218195330_update_transportation_routes.rb +72 -0
- data/db/migrate/20160310163052_add_created_by_updated_by_to_erp_work_effort.rb +63 -0
- data/db/migrate/20160418115227_add_created_by_updated_by_to_skill_type.rb +34 -0
- data/lib/erp_work_effort.rb +3 -0
- data/lib/erp_work_effort/config.rb +33 -0
- data/lib/erp_work_effort/engine.rb +0 -4
- data/lib/erp_work_effort/services/unit_converter.rb +284 -0
- data/lib/erp_work_effort/version.rb +1 -1
- data/lib/tasks/populate_model_data.rake +19 -0
- data/lib/tasks/resume_parser.rake +18 -0
- metadata +80 -16
- data/app/controllers/erp_work_effort/erp_app/organizer/tasks/base_controller.rb +0 -13
- data/app/controllers/erp_work_effort/erp_app/organizer/tasks/work_efforts_controller.rb +0 -128
- data/db/data_migrations/20131213151309_create_tasks_organizer_application.rb +0 -14
- data/db/migrate/20130829153419_base_routes.rb +0 -93
- data/db/migrate/20131213140617_add_work_effort_role_assignments.rb +0 -16
- data/db/migrate/20131213144223_add_work_item_to_work_effort.rb +0 -8
- data/db/migrate/20140106184615_update_work_effort_item_id_to_int.rb +0 -27
@@ -0,0 +1,35 @@
|
|
1
|
+
class AddWorkEffortDependencyTypes
|
2
|
+
|
3
|
+
def self.up
|
4
|
+
dependency = WorkEffortAssociationType.create(description: 'Dependency', internal_identifier: 'dependency')
|
5
|
+
|
6
|
+
start_to_start = WorkEffortAssociationType.create(description: 'StartToStart',
|
7
|
+
internal_identifier: 'start_to_start',
|
8
|
+
external_identifier: 0)
|
9
|
+
|
10
|
+
start_to_start.move_to_child_of(dependency)
|
11
|
+
|
12
|
+
start_to_end = WorkEffortAssociationType.create(description: 'StartToEnd',
|
13
|
+
internal_identifier: 'start_to_end',
|
14
|
+
external_identifier: 1)
|
15
|
+
|
16
|
+
start_to_end.move_to_child_of(dependency)
|
17
|
+
|
18
|
+
end_to_start = WorkEffortAssociationType.create(description: 'EndToStart',
|
19
|
+
internal_identifier: 'end_to_start',
|
20
|
+
external_identifier: 2)
|
21
|
+
|
22
|
+
end_to_start.move_to_child_of(dependency)
|
23
|
+
|
24
|
+
end_to_end = WorkEffortAssociationType.create(description: 'EndToEnd',
|
25
|
+
internal_identifier: 'end_to_end',
|
26
|
+
external_identifier: 3)
|
27
|
+
|
28
|
+
end_to_end.move_to_child_of(dependency)
|
29
|
+
end
|
30
|
+
|
31
|
+
def self.down
|
32
|
+
WorkEffortAssociationType.iid('dependency').destroy
|
33
|
+
end
|
34
|
+
|
35
|
+
end
|
@@ -1,22 +1,22 @@
|
|
1
1
|
class BaseWorkEfforts < ActiveRecord::Migration
|
2
|
-
|
3
|
-
def self.up
|
2
|
+
|
3
|
+
def self.up
|
4
4
|
|
5
5
|
##********************************************************************************************
|
6
6
|
## Human resource (Party) skill types
|
7
7
|
##********************************************************************************************
|
8
8
|
unless table_exists?(:skill_types)
|
9
9
|
create_table :skill_types do |t|
|
10
|
-
t.integer
|
11
|
-
t.integer
|
12
|
-
t.integer
|
10
|
+
t.integer :parent_id
|
11
|
+
t.integer :lft
|
12
|
+
t.integer :rgt
|
13
13
|
|
14
14
|
#custom columns go here
|
15
|
-
t.string
|
16
|
-
t.string
|
17
|
-
t.string
|
18
|
-
t.string
|
19
|
-
t.string
|
15
|
+
t.string :description
|
16
|
+
t.string :comments
|
17
|
+
t.string :internal_identifier
|
18
|
+
t.string :external_identifier
|
19
|
+
t.string :external_id_source
|
20
20
|
|
21
21
|
t.timestamps
|
22
22
|
end
|
@@ -25,12 +25,12 @@ def self.up
|
|
25
25
|
## party skills
|
26
26
|
unless table_exists?(:party_skills)
|
27
27
|
create_table :party_skills do |t|
|
28
|
-
t.integer
|
29
|
-
t.integer
|
28
|
+
t.integer :party_id
|
29
|
+
t.integer :skill_type_id
|
30
30
|
|
31
31
|
t.timestamps
|
32
32
|
end
|
33
|
-
add_index :party_skills,
|
33
|
+
add_index :party_skills, [:party_id, :skill_type_id], :name => "party_skills_idx"
|
34
34
|
end
|
35
35
|
|
36
36
|
##********************************************************************************************
|
@@ -69,7 +69,7 @@ def self.up
|
|
69
69
|
t.string :external_id_source
|
70
70
|
|
71
71
|
#polymorphic columns
|
72
|
-
t.string
|
72
|
+
t.string :deliverable_record_type
|
73
73
|
t.integer :deliverable_record_id
|
74
74
|
|
75
75
|
t.timestamps
|
@@ -115,15 +115,15 @@ def self.up
|
|
115
115
|
t.integer :requirement_type_id
|
116
116
|
#polymorphic columns
|
117
117
|
t.integer :requirement_record_id
|
118
|
-
t.string
|
118
|
+
t.string :requirement_record_type
|
119
119
|
|
120
120
|
#These columns represent optional relationships to the items used by and
|
121
121
|
#produced via fulfillment of the requirement
|
122
122
|
#TODO if we do separate requirement from work requirement, some of these relationships
|
123
123
|
#would get moved to work_requirement or another subtype. See DMRB V1 p187
|
124
|
-
t.integer
|
125
|
-
t.integer
|
126
|
-
t.integer
|
124
|
+
t.integer :fixed_asset_id
|
125
|
+
t.integer :product_id
|
126
|
+
t.integer :deliverable_id
|
127
127
|
|
128
128
|
t.timestamps
|
129
129
|
end
|
@@ -151,21 +151,21 @@ def self.up
|
|
151
151
|
# Create requirement_party_roles
|
152
152
|
unless table_exists?(:requirement_party_roles)
|
153
153
|
create_table :requirement_party_roles do |t|
|
154
|
-
t.string
|
154
|
+
t.string :description
|
155
155
|
|
156
|
-
t.integer
|
157
|
-
t.integer
|
158
|
-
t.integer
|
156
|
+
t.integer :requirement_id
|
157
|
+
t.integer :party_id
|
158
|
+
t.integer :role_type_id
|
159
159
|
|
160
|
-
t.string
|
161
|
-
t.string
|
160
|
+
t.string :external_identifier
|
161
|
+
t.string :external_id_source
|
162
162
|
|
163
163
|
t.datetime :valid_from
|
164
164
|
t.datetime :valid_to
|
165
165
|
|
166
166
|
t.timestamps
|
167
167
|
end
|
168
|
-
add_index :requirement_party_roles,
|
168
|
+
add_index :requirement_party_roles, [:requirement_id, :party_id, :role_type_id], :name => "requirement_party_roles_idx"
|
169
169
|
end
|
170
170
|
|
171
171
|
##********************************************************************************************
|
@@ -179,27 +179,30 @@ def self.up
|
|
179
179
|
t.integer :rgt
|
180
180
|
|
181
181
|
#foreign keys
|
182
|
-
t.integer
|
183
|
-
t.integer
|
184
|
-
t.integer
|
185
|
-
t.references
|
186
|
-
t.references
|
187
|
-
t.references
|
188
|
-
|
189
|
-
t.string
|
190
|
-
t.string
|
182
|
+
t.integer :facility_id
|
183
|
+
t.integer :projected_cost_money_id
|
184
|
+
t.integer :actual_cost_money_id
|
185
|
+
t.references :fixed_asset
|
186
|
+
t.references :work_effort_purpose_type
|
187
|
+
t.references :work_effort_type
|
188
|
+
|
189
|
+
t.string :description
|
190
|
+
t.string :type
|
191
191
|
t.datetime :started_at
|
192
192
|
t.datetime :finished_at
|
193
|
-
t.integer
|
194
|
-
t.integer
|
193
|
+
t.integer :projected_completion_time
|
194
|
+
t.integer :actual_completion_time
|
195
195
|
|
196
196
|
#polymorphic columns
|
197
|
-
t.integer
|
198
|
-
t.string
|
197
|
+
t.integer :work_effort_record_id
|
198
|
+
t.string :work_effort_record_type
|
199
|
+
|
200
|
+
t.references :work_effort_item, :polymorphic => true
|
199
201
|
|
200
202
|
t.timestamps
|
201
203
|
end
|
202
204
|
add_index :work_efforts, [:work_effort_record_id, :work_effort_record_type], :name => "work_effort_record_id_type_idx"
|
205
|
+
add_index :work_efforts, [:work_effort_item_type, :work_effort_item_id], :name => 'work_item_idx'
|
203
206
|
add_index :work_efforts, :fixed_asset_id
|
204
207
|
add_index :work_efforts, :finished_at
|
205
208
|
end
|
@@ -207,11 +210,11 @@ def self.up
|
|
207
210
|
unless table_exists?(:associated_work_efforts)
|
208
211
|
create_table :associated_work_efforts do |t|
|
209
212
|
#foreign keys
|
210
|
-
t.integer
|
213
|
+
t.integer :work_effort_id
|
211
214
|
|
212
215
|
#polymorphic columns
|
213
|
-
t.integer
|
214
|
-
t.string
|
216
|
+
t.integer :associated_record_id
|
217
|
+
t.string :associated_record_type
|
215
218
|
end
|
216
219
|
add_index :associated_work_efforts, [:associated_record_id, :associated_record_type], :name => "associated_record_id_type_idx"
|
217
220
|
add_index :associated_work_efforts, :work_effort_id
|
@@ -290,14 +293,14 @@ def self.up
|
|
290
293
|
#foreign key references
|
291
294
|
t.references :work_effort_association_type
|
292
295
|
|
293
|
-
t.string
|
294
|
-
t.integer
|
295
|
-
t.integer
|
296
|
-
t.integer
|
297
|
-
t.integer
|
298
|
-
t.integer
|
299
|
-
t.datetime
|
300
|
-
t.datetime
|
296
|
+
t.string :description
|
297
|
+
t.integer :work_effort_id_from
|
298
|
+
t.integer :work_effort_id_to
|
299
|
+
t.integer :role_type_id_from
|
300
|
+
t.integer :role_type_id_to
|
301
|
+
t.integer :relationship_type_id
|
302
|
+
t.datetime :effective_from
|
303
|
+
t.datetime :effective_thru
|
301
304
|
|
302
305
|
t.timestamps
|
303
306
|
end
|
@@ -315,14 +318,14 @@ def self.up
|
|
315
318
|
unless table_exists?(:work_order_item_fulfillments)
|
316
319
|
create_table :work_order_item_fulfillments do |t|
|
317
320
|
#foreign key references
|
318
|
-
t.references
|
319
|
-
t.references
|
321
|
+
t.references :work_effort
|
322
|
+
t.references :order_line_item
|
320
323
|
|
321
|
-
t.string
|
324
|
+
t.string :description
|
322
325
|
|
323
326
|
t.timestamps
|
324
327
|
end
|
325
|
-
add_index :work_order_item_fulfillments,
|
328
|
+
add_index :work_order_item_fulfillments, [:work_effort_id, :order_line_item_id], :name => "work_order_item_fulfillments_idx"
|
326
329
|
end
|
327
330
|
|
328
331
|
unless table_exists?(:work_order_items)
|
@@ -336,28 +339,28 @@ def self.up
|
|
336
339
|
unless table_exists?(:order_requirement_commitments)
|
337
340
|
create_table :order_requirement_commitments do |t|
|
338
341
|
#foreign key references
|
339
|
-
t.references
|
340
|
-
t.references
|
342
|
+
t.references :order_line_item
|
343
|
+
t.references :requirement
|
341
344
|
|
342
|
-
t.string
|
343
|
-
t.integer
|
345
|
+
t.string :description
|
346
|
+
t.integer :quantity
|
344
347
|
|
345
348
|
t.timestamps
|
346
349
|
end
|
347
|
-
add_index :order_requirement_commitments,
|
350
|
+
add_index :order_requirement_commitments, [:order_line_item_id, :requirement_id], :name => "order_item_req_fulfillment_idx"
|
348
351
|
end
|
349
352
|
|
350
353
|
## relationship to track the relationship between requirements and the work_efforts to fulfill them
|
351
354
|
unless table_exists?(:work_requirement_fulfillment)
|
352
355
|
create_table :work_requirement_fulfillment do |t|
|
353
|
-
t.string
|
356
|
+
t.string :description
|
354
357
|
|
355
|
-
t.integer
|
356
|
-
t.integer
|
358
|
+
t.integer :work_effort_id
|
359
|
+
t.integer :requirement_id
|
357
360
|
|
358
361
|
t.timestamps
|
359
362
|
end
|
360
|
-
add_index :work_requirement_fulfillment,
|
363
|
+
add_index :work_requirement_fulfillment, [:work_effort_id, :requirement_id], :name => "work_order_req_fulfillment_idx"
|
361
364
|
end
|
362
365
|
|
363
366
|
##********************************************************************************************
|
@@ -376,7 +379,7 @@ def self.up
|
|
376
379
|
t.datetime :assigned_from
|
377
380
|
t.datetime :assigned_thru
|
378
381
|
|
379
|
-
t.text
|
382
|
+
t.text :comments
|
380
383
|
|
381
384
|
t.timestamps
|
382
385
|
end
|
@@ -394,7 +397,7 @@ def self.up
|
|
394
397
|
|
395
398
|
t.timestamps
|
396
399
|
end
|
397
|
-
add_index :work_effort_inventory_assignments,
|
400
|
+
add_index :work_effort_inventory_assignments, [:work_effort_id, :inventory_entry_id], :name => "work_effort_inv_assignment_idx"
|
398
401
|
end
|
399
402
|
|
400
403
|
unless table_exists?(:work_effort_fixed_asset_assignments)
|
@@ -405,7 +408,7 @@ def self.up
|
|
405
408
|
|
406
409
|
t.timestamps
|
407
410
|
end
|
408
|
-
add_index :work_effort_fixed_asset_assignments,
|
411
|
+
add_index :work_effort_fixed_asset_assignments, [:work_effort_id, :fixed_asset_id], :name => "work_effort_fixed_asset_assign_idx"
|
409
412
|
end
|
410
413
|
|
411
414
|
##********************************************************************************************
|
@@ -418,11 +421,11 @@ def self.up
|
|
418
421
|
|
419
422
|
#this type field is NOT REDUNDANT. It is here to distinguish between work breakdown type associations and
|
420
423
|
#dependency type associations
|
421
|
-
t.integer
|
424
|
+
t.integer :work_effort_type_assoc_type
|
422
425
|
|
423
426
|
#the two work effort types involved in the association
|
424
|
-
t.integer
|
425
|
-
t.integer
|
427
|
+
t.integer :work_effort_type_id_from
|
428
|
+
t.integer :work_effort_type_id_to
|
426
429
|
|
427
430
|
#custom columns go here
|
428
431
|
t.string :description
|
@@ -438,12 +441,12 @@ def self.up
|
|
438
441
|
unless table_exists?(:work_effort_fixed_asset_standards)
|
439
442
|
create_table :work_effort_fixed_asset_standards do |t|
|
440
443
|
#foreign key references
|
441
|
-
t.references
|
442
|
-
t.references
|
444
|
+
t.references :work_effort
|
445
|
+
t.references :fixed_asset_type
|
443
446
|
|
444
|
-
t.decimal
|
445
|
-
t.decimal
|
446
|
-
t.integer
|
447
|
+
t.decimal :estimated_quantity
|
448
|
+
t.decimal :estimated_duration
|
449
|
+
t.integer :estimated_cost_money_id
|
447
450
|
|
448
451
|
t.timestamps
|
449
452
|
end
|
@@ -454,12 +457,12 @@ def self.up
|
|
454
457
|
unless table_exists?(:work_effort_skill_standards)
|
455
458
|
create_table :work_effort_skill_standards do |t|
|
456
459
|
#foreign key references
|
457
|
-
t.references
|
458
|
-
t.references
|
460
|
+
t.references :work_effort
|
461
|
+
t.references :skill_type
|
459
462
|
|
460
|
-
t.decimal
|
461
|
-
t.decimal
|
462
|
-
t.integer
|
463
|
+
t.decimal :estimated_num_people
|
464
|
+
t.decimal :estimated_duration
|
465
|
+
t.integer :estimated_cost_money_id
|
463
466
|
|
464
467
|
t.timestamps
|
465
468
|
end
|
@@ -470,11 +473,11 @@ def self.up
|
|
470
473
|
unless table_exists?(:work_effort_good_standards)
|
471
474
|
create_table :work_effort_good_standards do |t|
|
472
475
|
#foreign key references
|
473
|
-
t.references
|
474
|
-
t.references
|
476
|
+
t.references :work_effort
|
477
|
+
t.references :good_type
|
475
478
|
|
476
|
-
t.decimal
|
477
|
-
t.integer
|
479
|
+
t.decimal :estimated_quantity
|
480
|
+
t.integer :estimated_cost_money_id
|
478
481
|
|
479
482
|
t.timestamps
|
480
483
|
end
|
@@ -487,8 +490,8 @@ def self.up
|
|
487
490
|
unless table_exists?(:work_effort_inventory_produced)
|
488
491
|
create_table :work_effort_inventory_produced do |t|
|
489
492
|
#foreign key references
|
490
|
-
t.references
|
491
|
-
t.references
|
493
|
+
t.references :work_effort
|
494
|
+
t.references :inventory_entry
|
492
495
|
|
493
496
|
t.timestamps
|
494
497
|
end
|
@@ -499,8 +502,8 @@ def self.up
|
|
499
502
|
unless table_exists?(:work_effort_deliverable_produced)
|
500
503
|
create_table :work_effort_deliverable_produced do |t|
|
501
504
|
#foreign key references
|
502
|
-
t.references
|
503
|
-
t.references
|
505
|
+
t.references :work_effort
|
506
|
+
t.references :deliverable
|
504
507
|
|
505
508
|
t.timestamps
|
506
509
|
end
|
@@ -511,8 +514,8 @@ def self.up
|
|
511
514
|
unless table_exists?(:work_effort_fixed_asset_serviced)
|
512
515
|
create_table :work_effort_fixed_asset_serviced do |t|
|
513
516
|
#foreign key references
|
514
|
-
t.references
|
515
|
-
t.references
|
517
|
+
t.references :work_effort
|
518
|
+
t.references :fixed_asset
|
516
519
|
|
517
520
|
t.timestamps
|
518
521
|
end
|
@@ -550,6 +553,210 @@ def self.up
|
|
550
553
|
add_index :party_resource_availability_types, :description
|
551
554
|
end
|
552
555
|
|
556
|
+
# transportation_routes
|
557
|
+
unless table_exists?(:transportation_routes)
|
558
|
+
create_table :transportation_routes do |t|
|
559
|
+
|
560
|
+
t.string :internal_identifier
|
561
|
+
t.string :description
|
562
|
+
t.string :comments
|
563
|
+
|
564
|
+
#connection to external system
|
565
|
+
t.string :external_identifier
|
566
|
+
t.string :external_id_source
|
567
|
+
|
568
|
+
t.timestamps
|
569
|
+
end
|
570
|
+
end
|
571
|
+
|
572
|
+
# transportation_route_segments
|
573
|
+
unless table_exists?(:transportation_route_segments)
|
574
|
+
create_table :transportation_route_segments do |t|
|
575
|
+
|
576
|
+
t.string :internal_identifier
|
577
|
+
t.string :description
|
578
|
+
t.string :comments
|
579
|
+
|
580
|
+
#connection to external system
|
581
|
+
t.string :external_identifier
|
582
|
+
t.string :external_id_source
|
583
|
+
|
584
|
+
t.integer :sequence
|
585
|
+
t.datetime :estimated_start
|
586
|
+
t.datetime :estmated_arrival
|
587
|
+
t.datetime :actual_start
|
588
|
+
t.datetime :actual_arrival
|
589
|
+
t.integer :start_mileage
|
590
|
+
t.integer :end_milage
|
591
|
+
t.integer :fuel_used
|
592
|
+
|
593
|
+
#foreign keys
|
594
|
+
t.integer :transportation_route_id
|
595
|
+
t.integer :from_transportation_route_stop_id
|
596
|
+
t.integer :to_transportation_route_stop_id
|
597
|
+
|
598
|
+
t.timestamps
|
599
|
+
end
|
600
|
+
end
|
601
|
+
|
602
|
+
# transportation_route_stops
|
603
|
+
unless table_exists?(:transportation_route_stops)
|
604
|
+
create_table :transportation_route_stops do |t|
|
605
|
+
|
606
|
+
t.string :internal_identifier
|
607
|
+
t.string :description
|
608
|
+
|
609
|
+
t.integer :postal_address_id
|
610
|
+
t.string :geoloc
|
611
|
+
t.integer :sequence
|
612
|
+
|
613
|
+
#connection to external system
|
614
|
+
t.string :external_identifier
|
615
|
+
t.string :external_id_source
|
616
|
+
|
617
|
+
#foreign keys
|
618
|
+
t.integer :transportation_route_id
|
619
|
+
|
620
|
+
t.timestamps
|
621
|
+
end
|
622
|
+
end
|
623
|
+
|
624
|
+
# associated_transportation_routes
|
625
|
+
unless table_exists?(:associated_transportation_routes)
|
626
|
+
create_table :associated_transportation_routes do |t|
|
627
|
+
#foreign keys
|
628
|
+
t.integer :transportation_route_id
|
629
|
+
|
630
|
+
#polymorphic columns
|
631
|
+
t.integer :associated_record_id
|
632
|
+
t.string :associated_record_type
|
633
|
+
end
|
634
|
+
add_index :associated_transportation_routes, [:associated_record_id, :associated_record_type], :name => "associated_route_record_id_type_idx"
|
635
|
+
add_index :associated_transportation_routes, :transportation_route_id, :name => "associated_route_transportation_route_id_idx"
|
636
|
+
end
|
637
|
+
|
638
|
+
unless table_exists?(:role_types_work_efforts)
|
639
|
+
create_table :role_types_work_efforts do |t|
|
640
|
+
t.references :role_type
|
641
|
+
t.references :work_effort
|
642
|
+
end
|
643
|
+
|
644
|
+
add_index :role_types_work_efforts, [:role_type_id, :work_effort_id], :name => 'role_type_work_effort_idx'
|
645
|
+
end
|
646
|
+
|
647
|
+
##********************************************************************************************
|
648
|
+
## Positions
|
649
|
+
##********************************************************************************************
|
650
|
+
unless table_exists?(:position_types)
|
651
|
+
create_table :position_types do |t|
|
652
|
+
|
653
|
+
t.string :description
|
654
|
+
t.string :internal_identifier
|
655
|
+
t.string :external_identifier
|
656
|
+
t.string :external_identifer_source
|
657
|
+
|
658
|
+
#these columns are required to support the behavior of the plugin 'awesome_nested_set'
|
659
|
+
t.integer :parent_id
|
660
|
+
t.integer :lft
|
661
|
+
t.integer :rgt
|
662
|
+
|
663
|
+
t.string :title
|
664
|
+
t.decimal :benefit_percent, :precision => 8, :scale => 2
|
665
|
+
|
666
|
+
t.timestamps
|
667
|
+
|
668
|
+
end
|
669
|
+
|
670
|
+
add_index :position_types, :parent_id
|
671
|
+
add_index :position_types, :lft
|
672
|
+
add_index :position_types, :rgt
|
673
|
+
end
|
674
|
+
|
675
|
+
unless table_exists?(:positions)
|
676
|
+
create_table :positions do |t|
|
677
|
+
|
678
|
+
t.references :party
|
679
|
+
t.references :position_type
|
680
|
+
t.date :estimated_from_date
|
681
|
+
t.date :estimated_thru_date
|
682
|
+
t.boolean :salary_flag
|
683
|
+
t.boolean :exempt_flag
|
684
|
+
t.boolean :full_time_flag
|
685
|
+
t.boolean :temporary_flag
|
686
|
+
t.date :actual_from_date
|
687
|
+
t.date :actual_thru_date
|
688
|
+
|
689
|
+
t.timestamps
|
690
|
+
|
691
|
+
end
|
692
|
+
|
693
|
+
add_index :positions, :position_type_id
|
694
|
+
add_index :positions, :party_id
|
695
|
+
end
|
696
|
+
|
697
|
+
unless table_exists?(:position_fulfillments)
|
698
|
+
create_table :position_fulfillments do |t|
|
699
|
+
t.string :description
|
700
|
+
t.integer :held_by_party_id
|
701
|
+
t.references :position
|
702
|
+
t.date :from_date
|
703
|
+
t.date :thru_date
|
704
|
+
t.timestamps
|
705
|
+
end
|
706
|
+
|
707
|
+
add_index :position_fulfillments, :position_id
|
708
|
+
add_index :position_fulfillments, :held_by_party_id
|
709
|
+
end
|
710
|
+
|
711
|
+
##********************************************************************************************
|
712
|
+
## Time Entry
|
713
|
+
##********************************************************************************************
|
714
|
+
unless table_exists?(:time_sheet_entries)
|
715
|
+
create_table :time_sheet_entries do |t|
|
716
|
+
|
717
|
+
t.references :work_effort
|
718
|
+
t.string :description
|
719
|
+
t.date :worked_date
|
720
|
+
t.datetime :entered_date
|
721
|
+
t.decimal :regular_hours_worked, :precision => 5, :scale => 2
|
722
|
+
t.decimal :overtime_hours_worked, :precision => 5, :scale => 2
|
723
|
+
t.datetime :start_time
|
724
|
+
t.datetime :end_time
|
725
|
+
t.text :comments
|
726
|
+
|
727
|
+
t.timestamps
|
728
|
+
end
|
729
|
+
|
730
|
+
add_index :time_sheet_entries, :work_effort_id
|
731
|
+
end
|
732
|
+
|
733
|
+
unless table_exists?(:time_sheet_entry_party_roles)
|
734
|
+
create_table :time_sheet_entry_party_roles do |t|
|
735
|
+
|
736
|
+
t.references :time_sheet_entry
|
737
|
+
t.references :party
|
738
|
+
t.references :role_type
|
739
|
+
|
740
|
+
t.date :from_date
|
741
|
+
t.date :thru_date
|
742
|
+
|
743
|
+
t.timestamps
|
744
|
+
end
|
745
|
+
|
746
|
+
add_index :time_sheet_entry_party_roles, :time_sheet_entry_id
|
747
|
+
add_index :time_sheet_entry_party_roles, :party_id
|
748
|
+
add_index :time_sheet_entry_party_roles, :role_type_id
|
749
|
+
end
|
750
|
+
|
751
|
+
unless table_exists?(:experiences)
|
752
|
+
create_table :experiences do |t|
|
753
|
+
|
754
|
+
t.string :description
|
755
|
+
|
756
|
+
t.timestamps
|
757
|
+
end
|
758
|
+
end
|
759
|
+
|
553
760
|
end
|
554
761
|
|
555
762
|
def self.down
|
@@ -601,7 +808,21 @@ def self.up
|
|
601
808
|
|
602
809
|
##obsolete??
|
603
810
|
:party_resource_availabilities,
|
604
|
-
:party_resource_availability_types
|
811
|
+
:party_resource_availability_types,
|
812
|
+
|
813
|
+
## routing
|
814
|
+
:transportation_routes,
|
815
|
+
:transportation_route_segments,
|
816
|
+
:transportation_route_stops,
|
817
|
+
:associated_transportation_routes,
|
818
|
+
|
819
|
+
:role_types_work_efforts,
|
820
|
+
|
821
|
+
:position_types, :positions,
|
822
|
+
:position_fulfillments,
|
823
|
+
:time_sheet_entries,
|
824
|
+
:time_sheet_entry_party_roles,
|
825
|
+
:experiences
|
605
826
|
|
606
827
|
].each do |tbl|
|
607
828
|
if table_exists?(tbl)
|