erp_work_effort 3.0.4 → 3.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (37) hide show
  1. data/app/models/cost.rb +2 -0
  2. data/app/models/party_resource_availability.rb +2 -0
  3. data/app/models/party_resource_availability_type.rb +2 -0
  4. data/app/models/valid_work_assignment.rb +2 -0
  5. data/app/models/valid_work_assignment_attribute.rb +2 -0
  6. data/app/models/work_effort.rb +2 -0
  7. data/app/models/work_effort_assignment.rb +2 -0
  8. data/app/models/work_effort_status.rb +2 -0
  9. data/app/models/work_effort_status_type.rb +2 -0
  10. data/app/models/work_requirement.rb +2 -0
  11. data/app/models/work_requirement_work_effort_status_type.rb +2 -0
  12. data/lib/erp_work_effort.rb +2 -0
  13. data/lib/erp_work_effort/version.rb +2 -2
  14. data/spec/dummy/config/application.rb +6 -0
  15. data/spec/dummy/config/environments/spec.rb +3 -0
  16. data/spec/dummy/db/data_migrations/20110109173616_create_capability_scope_types.erp_tech_svcs.rb +15 -0
  17. data/spec/dummy/db/data_migrations/20110525001935_add_usd_currency.erp_base_erp_svcs.rb +12 -0
  18. data/spec/dummy/db/data_migrations/20110609150135_add_iso_codes.erp_base_erp_svcs.rb +19 -0
  19. data/spec/dummy/db/data_migrations/20110802200222_schedule_delete_expired_sessions_job.erp_tech_svcs.rb +16 -0
  20. data/spec/dummy/db/data_migrations/20110913145838_setup_compass_ae_instance.erp_base_erp_svcs.rb +12 -0
  21. data/spec/dummy/db/data_migrations/20111111144706_setup_audit_log_types.erp_tech_svcs.rb +22 -0
  22. data/spec/dummy/db/data_migrations/20120109173616_create_download_capability_type.erp_tech_svcs.rb +14 -0
  23. data/spec/dummy/db/data_migrations/20121116155018_create_group_relationship_and_role_types.erp_tech_svcs.rb +20 -0
  24. data/spec/dummy/db/data_migrations/20121130212146_note_capabilities.erp_tech_svcs.rb +24 -0
  25. data/spec/dummy/db/migrate/20121219191143_base_erp_services.erp_base_erp_svcs.rb +461 -0
  26. data/spec/dummy/db/migrate/20121219191144_base_work_efforts.erp_work_effort.rb +211 -0
  27. data/spec/dummy/db/migrate/20121219191145_base_tech_services.erp_tech_svcs.rb +255 -0
  28. data/spec/dummy/db/migrate/20121219191146_create_has_attribute_tables.erp_tech_svcs.rb +39 -0
  29. data/spec/dummy/db/migrate/20130107180754_create_groups.erp_tech_svcs.rb +19 -0
  30. data/spec/dummy/db/migrate/20130107180755_upgrade_security.erp_tech_svcs.rb +54 -0
  31. data/spec/dummy/db/migrate/20130107180756_upgrade_security2.erp_tech_svcs.rb +270 -0
  32. data/spec/dummy/db/schema.rb +735 -0
  33. data/spec/dummy/db/spec.sqlite3 +0 -0
  34. data/spec/dummy/log/spec.log +6311 -0
  35. data/spec/spec_helper.rb +11 -3
  36. metadata +63 -10
  37. data/db/migrate/upgrade/20111216190747_add_work_effort_to_work_effort_assignment.rb +0 -13
@@ -0,0 +1,39 @@
1
+ # This migration comes from erp_tech_svcs (originally 20111117183144)
2
+ class CreateHasAttributeTables < ActiveRecord::Migration
3
+ def up
4
+ unless table_exists?(:attribute_types)
5
+ create_table :attribute_types do |t|
6
+ t.string :internal_identifier
7
+ t.string :description
8
+ t.string :data_type
9
+
10
+ t.timestamps
11
+ end
12
+
13
+ add_index :attribute_types, :internal_identifier, :name => ':attribute_types_iid_idx'
14
+ end
15
+ unless table_exists?(:attribute_values)
16
+ create_table :attribute_values do |t|
17
+ t.integer :attributed_record_id
18
+ t.string :attributed_record_type
19
+ t.references :attribute_type
20
+ t.string :value
21
+
22
+ t.timestamps
23
+ end
24
+
25
+ add_index :attribute_values, [:attributed_record_id, :attributed_record_type], :name => 'attribute_values_attributed_record_idx'
26
+ add_index :attribute_values, :attribute_type_id, :name => 'attribute_values_attributed_type_idx'
27
+ add_index :attribute_values, :value, :name => 'attribute_values_value_idx'
28
+ end
29
+ end
30
+
31
+ def down
32
+ if table_exists?(:attribute_types)
33
+ drop_table :attribute_types
34
+ end
35
+ if table_exists?(:attribute_values)
36
+ drop_table :attribute_values
37
+ end
38
+ end
39
+ end
@@ -0,0 +1,19 @@
1
+ # This migration comes from erp_tech_svcs (originally 20121116151510)
2
+ class CreateGroups < ActiveRecord::Migration
3
+ def self.up
4
+ unless table_exists?(:groups)
5
+ create_table :groups do |t|
6
+ t.column :description, :string
7
+ t.timestamps
8
+ end
9
+ end
10
+ end
11
+
12
+ def self.down
13
+ [ :groups ].each do |tbl|
14
+ if table_exists?(tbl)
15
+ drop_table tbl
16
+ end
17
+ end
18
+ end
19
+ end
@@ -0,0 +1,54 @@
1
+ # This migration comes from erp_tech_svcs (originally 20121126171612)
2
+ class UpgradeSecurity < ActiveRecord::Migration
3
+
4
+ def self.up
5
+ unless table_exists?(:capability_accessors)
6
+ create_table :capability_accessors do |t|
7
+ t.string :capability_accessor_record_type
8
+ t.integer :capability_accessor_record_id
9
+ t.integer :capability_id
10
+ t.timestamps
11
+ end
12
+
13
+ add_index :capability_accessors, :capability_id
14
+ add_index :capability_accessors, [:capability_accessor_record_id, :capability_accessor_record_type], :name => 'capability_accessor_record_index'
15
+ end
16
+
17
+ unless columns(:capabilities).collect {|c| c.name}.include?('scope_query')
18
+ add_column :capabilities, :description, :string
19
+ add_column :capabilities, :capability_resource_type, :string
20
+ add_column :capabilities, :capability_resource_id, :integer
21
+ add_column :capabilities, :scope_type_id, :integer
22
+ add_column :capabilities, :scope_query, :text
23
+
24
+ add_index :capabilities, :scope_type_id
25
+ add_index :capabilities, [:capability_resource_id, :capability_resource_type], :name => 'capability_resource_index'
26
+ end
27
+
28
+ unless table_exists?(:scope_types)
29
+ create_table :scope_types do |t|
30
+ t.string :description
31
+ t.string :internal_identifier
32
+ t.timestamps
33
+ end
34
+
35
+ add_index :scope_types, :internal_identifier
36
+ end
37
+
38
+ unless table_exists?(:parties_security_roles)
39
+ create_table :parties_security_roles, :id => false do |t|
40
+ t.integer :party_id
41
+ t.integer :security_role_id
42
+ end
43
+
44
+ add_index :parties_security_roles, :party_id
45
+ add_index :parties_security_roles, :security_role_id
46
+ end
47
+
48
+ rename_table :roles, :security_roles unless table_exists?(:security_roles)
49
+
50
+ end
51
+
52
+ def self.down
53
+ end
54
+ end
@@ -0,0 +1,270 @@
1
+ # This migration comes from erp_tech_svcs (originally 20121126173506)
2
+ class UpgradeSecurity2 < ActiveRecord::Migration
3
+ def self.up
4
+ if table_exists?(:secured_models)
5
+ Website.all.each do |w|
6
+ old_role_iid = "website_#{w.name.underscore.gsub("'","").gsub(",","")}_access"
7
+
8
+ r = SecurityRole.find_by_internal_identifier(old_role_iid)
9
+ unless r.nil?
10
+ r.internal_identifier = w.website_role_iid
11
+ r.save
12
+ end
13
+ end
14
+ instance = ScopeType.create(:description => 'Instance', :internal_identifier => 'instance')
15
+ class_scope_type = ScopeType.create(:description => 'Class', :internal_identifier => 'class')
16
+ ScopeType.create(:description => 'Query', :internal_identifier => 'query')
17
+
18
+ execute('BEGIN TRANSACTION')
19
+ puts "populating parties_security_roles"
20
+ sql =
21
+ "INSERT INTO parties_security_roles (
22
+ party_id,
23
+ security_role_id
24
+ )
25
+ SELECT
26
+ u.party_id AS party_id,
27
+ rsm.role_id AS security_role_id
28
+ FROM secured_models sm
29
+ JOIN roles_secured_models rsm ON sm.id=rsm.secured_model_id
30
+ JOIN users u ON sm.secured_record_id=u.id
31
+ WHERE sm.secured_record_type='User'"
32
+
33
+ execute(sql)
34
+ execute('COMMIT')
35
+
36
+ execute('BEGIN TRANSACTION')
37
+ puts "populating capabilities with secure File Assets"
38
+ sql =
39
+ "INSERT INTO capabilities (
40
+ capability_type_id,
41
+ capability_resource_type,
42
+ capability_resource_id,
43
+ scope_type_id
44
+ )
45
+ SELECT
46
+ c.capability_type_id AS capability_type_id,
47
+ 'FileAsset' AS capability_resource_type,
48
+ cm.capable_model_record_id AS capability_resource_id,
49
+ #{instance.id} AS scope_type_id
50
+ FROM capable_models AS cm
51
+ JOIN capabilities_capable_models AS ccm ON ccm.capable_model_id = cm.id
52
+ JOIN capabilities AS c ON ccm.capability_id = c.id
53
+ JOIN secured_models AS sm ON sm.secured_record_id = c.id AND sm.secured_record_type = 'Capability'
54
+ JOIN roles_secured_models AS rsm ON rsm.secured_model_id = sm.id
55
+ JOIN security_roles AS r ON r.id = rsm.role_id
56
+ WHERE cm.capable_model_record_type = 'FileAsset'"
57
+
58
+ execute(sql)
59
+ execute('COMMIT')
60
+
61
+ view = CapabilityType.find_by_internal_identifier('view')
62
+
63
+ execute('BEGIN TRANSACTION')
64
+ puts "populating capabilities with secure Website Sections"
65
+ sql =
66
+ "INSERT INTO capabilities (
67
+ capability_type_id,
68
+ capability_resource_type,
69
+ capability_resource_id,
70
+ scope_type_id
71
+ )
72
+ SELECT
73
+ #{view.id} AS capability_type_id,
74
+ 'WebsiteSection' AS capability_resource_type,
75
+ ws.id AS capability_resource_id,
76
+ #{instance.id} AS scope_type_id
77
+ FROM secured_models sm
78
+ JOIN roles_secured_models rsm ON sm.id=rsm.secured_model_id
79
+ JOIN website_sections ws ON sm.secured_record_id=ws.id
80
+ WHERE sm.secured_record_type='WebsiteSection'"
81
+
82
+ execute(sql)
83
+ execute('COMMIT')
84
+
85
+ execute('BEGIN TRANSACTION')
86
+ puts "populating capabilities with secure Website Nav Items"
87
+ sql =
88
+ "INSERT INTO capabilities (
89
+ capability_type_id,
90
+ capability_resource_type,
91
+ capability_resource_id,
92
+ scope_type_id
93
+ )
94
+ SELECT
95
+ #{view.id} AS capability_type_id,
96
+ 'WebsiteNavItem' AS capability_resource_type,
97
+ ws.id AS capability_resource_id,
98
+ #{instance.id} AS scope_type_id
99
+ FROM secured_models sm
100
+ JOIN roles_secured_models rsm ON sm.id=rsm.secured_model_id
101
+ JOIN website_sections ws ON sm.secured_record_id=ws.id
102
+ WHERE sm.secured_record_type='WebsiteNavItem'"
103
+
104
+ execute(sql)
105
+ execute('COMMIT')
106
+
107
+ # delete obsolete records: Application, Widget, dupes?
108
+ Capability.where("capability_resource_type IS NULL").delete_all
109
+
110
+ admin = SecurityRole.find_by_internal_identifier('admin')
111
+ website_author = SecurityRole.find_by_internal_identifier('website_author')
112
+ layout_author = SecurityRole.find_by_internal_identifier('layout_author')
113
+ content_author = SecurityRole.find_by_internal_identifier('content_author')
114
+ designer = SecurityRole.find_by_internal_identifier('designer')
115
+ publisher = SecurityRole.find_by_internal_identifier('publisher')
116
+
117
+ # add instance capabilities to roles
118
+ instance_capabilities = Capability.where(:scope_type_id => instance.id).all
119
+ instance_capabilities.each do |c|
120
+ case c.capability_resource_type
121
+ when 'FileAsset'
122
+ admin.add_capability(c)
123
+ website_author.add_capability(c)
124
+ content_author.add_capability(c)
125
+ if c.capability_resource.file_asset_holder_type == 'Website'
126
+ website_role = c.capability_resource.file_asset_holder.role
127
+ website_role.add_capability(c)
128
+ end
129
+ when 'WebsiteSection'
130
+ admin.add_capability(c)
131
+ website_author.add_capability(c)
132
+ website_role = c.capability_resource.website.role
133
+ website_role.add_capability(c)
134
+ when 'WebsiteNavItem'
135
+ admin.add_capability(c)
136
+ website_author.add_capability(c)
137
+ website_role = c.capability_resource.website_nav.website.role
138
+ website_role.add_capability(c)
139
+ end
140
+ end
141
+
142
+ # add knitkit class capabilities to roles
143
+ admin.add_capability('create', 'WebsiteNav')
144
+ admin.add_capability('delete', 'WebsiteNav')
145
+ admin.add_capability('edit', 'WebsiteNav')
146
+
147
+ website_author.add_capability('create', 'WebsiteNav')
148
+ website_author.add_capability('delete', 'WebsiteNav')
149
+ website_author.add_capability('edit', 'WebsiteNav')
150
+
151
+ admin.add_capability('create', 'Website')
152
+ admin.add_capability('delete', 'Website')
153
+ admin.add_capability('edit', 'Website')
154
+ admin.add_capability('import', 'Website')
155
+ admin.add_capability('publish', 'Website')
156
+ admin.add_capability('activate', 'Website')
157
+
158
+ website_author.add_capability('create', 'Website')
159
+ website_author.add_capability('delete', 'Website')
160
+ website_author.add_capability('edit', 'Website')
161
+ website_author.add_capability('import', 'Website')
162
+ publisher.add_capability('publish', 'Website')
163
+ publisher.add_capability('activate', 'Website')
164
+
165
+ admin.add_capability('create', 'WebsiteHost')
166
+ admin.add_capability('delete', 'WebsiteHost')
167
+ admin.add_capability('edit', 'WebsiteHost')
168
+
169
+ website_author.add_capability('create', 'WebsiteHost')
170
+ website_author.add_capability('delete', 'WebsiteHost')
171
+ website_author.add_capability('edit', 'WebsiteHost')
172
+
173
+ admin.add_capability('create', 'WebsiteSection')
174
+ admin.add_capability('delete', 'WebsiteSection')
175
+ admin.add_capability('edit', 'WebsiteSection')
176
+ admin.add_capability('secure', 'WebsiteSection')
177
+ admin.add_capability('unsecure', 'WebsiteSection')
178
+
179
+ website_author.add_capability('create', 'WebsiteSection')
180
+ website_author.add_capability('delete', 'WebsiteSection')
181
+ website_author.add_capability('edit', 'WebsiteSection')
182
+ website_author.add_capability('secure', 'WebsiteSection')
183
+ website_author.add_capability('unsecure', 'WebsiteSection')
184
+
185
+ admin.add_capability('create', 'WebsiteSectionLayout')
186
+ admin.add_capability('edit', 'WebsiteSectionLayout')
187
+
188
+ layout_author.add_capability('create', 'WebsiteSectionLayout')
189
+ layout_author.add_capability('edit', 'WebsiteSectionLayout')
190
+
191
+ admin.add_capability('create', 'Content')
192
+ admin.add_capability('delete', 'Content')
193
+ admin.add_capability('edit', 'Content')
194
+ admin.add_capability('publish', 'Content')
195
+ admin.add_capability('revert_version', 'Content')
196
+ admin.add_capability('add_existing', 'Content')
197
+ admin.add_capability('edit_html', 'Content')
198
+ admin.add_capability('edit_excerpt', 'Content')
199
+
200
+ content_author.add_capability('create', 'Content')
201
+ content_author.add_capability('delete', 'Content')
202
+ content_author.add_capability('edit', 'Content')
203
+ content_author.add_capability('publish', 'Content')
204
+ content_author.add_capability('revert_version', 'Content')
205
+ content_author.add_capability('add_existing', 'Content')
206
+ content_author.add_capability('edit_html', 'Content')
207
+ content_author.add_capability('edit_excerpt', 'Content')
208
+
209
+ admin.add_capability('create', 'WebsiteNavItem')
210
+ admin.add_capability('delete', 'WebsiteNavItem')
211
+ admin.add_capability('edit', 'WebsiteNavItem')
212
+ admin.add_capability('secure', 'WebsiteNavItem')
213
+ admin.add_capability('unsecure', 'WebsiteNavItem')
214
+
215
+ website_author.add_capability('create', 'WebsiteNavItem')
216
+ website_author.add_capability('delete', 'WebsiteNavItem')
217
+ website_author.add_capability('edit', 'WebsiteNavItem')
218
+ website_author.add_capability('secure', 'WebsiteNavItem')
219
+ website_author.add_capability('unsecure', 'WebsiteNavItem')
220
+
221
+ admin.add_capability('view', 'Theme')
222
+ designer.add_capability('view', 'Theme')
223
+
224
+ admin.add_capability('view', 'SiteImageAsset')
225
+ website_author.add_capability('view', 'SiteImageAsset')
226
+ content_author.add_capability('view', 'SiteImageAsset')
227
+
228
+ content_author.add_capability('view', 'GlobalImageAsset')
229
+
230
+ admin.add_capability('view', 'GlobalImageAsset')
231
+ admin.add_capability('upload', 'GlobalImageAsset')
232
+ admin.add_capability('delete', 'GlobalImageAsset')
233
+
234
+ website_author.add_capability('view', 'GlobalImageAsset')
235
+ website_author.add_capability('upload', 'GlobalImageAsset')
236
+ website_author.add_capability('delete', 'GlobalImageAsset')
237
+
238
+ admin.add_capability('view', 'SiteFileAsset')
239
+ website_author.add_capability('view', 'SiteFileAsset')
240
+ content_author.add_capability('view', 'SiteFileAsset')
241
+
242
+ content_author.add_capability('view', 'GlobalFileAsset')
243
+
244
+ admin.add_capability('view', 'GlobalFileAsset')
245
+ admin.add_capability('upload', 'GlobalFileAsset')
246
+ admin.add_capability('delete', 'GlobalFileAsset')
247
+
248
+ website_author.add_capability('view', 'GlobalFileAsset')
249
+ website_author.add_capability('upload', 'GlobalFileAsset')
250
+ website_author.add_capability('delete', 'GlobalFileAsset')
251
+
252
+ admin.add_capability('drag_item', 'WebsiteTree')
253
+ website_author.add_capability('drag_item', 'WebsiteTree')
254
+
255
+ # update capability descriptions
256
+ Capability.all.each do |c|
257
+ c.update_description
258
+ end
259
+
260
+ drop_table :capable_models
261
+ drop_table :capabilities_capable_models
262
+ drop_table :secured_models
263
+ drop_table :roles_secured_models
264
+ remove_column :capabilities, :resource
265
+ end
266
+ end
267
+
268
+ def self.down
269
+ end
270
+ end
@@ -0,0 +1,735 @@
1
+ # encoding: UTF-8
2
+ # This file is auto-generated from the current state of the database. Instead
3
+ # of editing this file, please use the migrations feature of Active Record to
4
+ # incrementally modify your database, and then regenerate this schema definition.
5
+ #
6
+ # Note that this schema.rb definition is the authoritative source for your
7
+ # database schema. If you need to create the application database on another
8
+ # system, you should be using db:schema:load, not running all the migrations
9
+ # from scratch. The latter is a flawed and unsustainable approach (the more migrations
10
+ # you'll amass, the slower it'll run and the greater likelihood for issues).
11
+ #
12
+ # It's strongly recommended to check this file into your version control system.
13
+
14
+ ActiveRecord::Schema.define(:version => 20121219191146) do
15
+
16
+ create_table "attribute_types", :force => true do |t|
17
+ t.string "internal_identifier"
18
+ t.string "description"
19
+ t.string "data_type"
20
+ t.datetime "created_at", :null => false
21
+ t.datetime "updated_at", :null => false
22
+ end
23
+
24
+ add_index "attribute_types", ["internal_identifier"], :name => ":attribute_types_iid_idx"
25
+
26
+ create_table "attribute_values", :force => true do |t|
27
+ t.integer "attributed_record_id"
28
+ t.string "attributed_record_type"
29
+ t.integer "attribute_type_id"
30
+ t.string "value"
31
+ t.datetime "created_at", :null => false
32
+ t.datetime "updated_at", :null => false
33
+ end
34
+
35
+ add_index "attribute_values", ["attribute_type_id"], :name => "attribute_values_attributed_type_idx"
36
+ add_index "attribute_values", ["attributed_record_id", "attributed_record_type"], :name => "attribute_values_attributed_record_idx"
37
+ add_index "attribute_values", ["value"], :name => "attribute_values_value_idx"
38
+
39
+ create_table "audit_log_item_types", :force => true do |t|
40
+ t.string "internal_identifier"
41
+ t.string "external_identifier"
42
+ t.string "external_id_source"
43
+ t.string "description"
44
+ t.string "comments"
45
+ t.integer "parent_id"
46
+ t.integer "lft"
47
+ t.integer "rgt"
48
+ t.datetime "created_at", :null => false
49
+ t.datetime "updated_at", :null => false
50
+ end
51
+
52
+ create_table "audit_log_items", :force => true do |t|
53
+ t.integer "audit_log_id"
54
+ t.integer "audit_log_item_type_id"
55
+ t.string "audit_log_item_value"
56
+ t.string "description"
57
+ t.datetime "created_at", :null => false
58
+ t.datetime "updated_at", :null => false
59
+ end
60
+
61
+ create_table "audit_log_types", :force => true do |t|
62
+ t.string "description"
63
+ t.string "error_code"
64
+ t.string "comments"
65
+ t.string "internal_identifier"
66
+ t.string "external_identifier"
67
+ t.string "external_id_source"
68
+ t.integer "parent_id"
69
+ t.integer "lft"
70
+ t.integer "rgt"
71
+ t.datetime "created_at", :null => false
72
+ t.datetime "updated_at", :null => false
73
+ end
74
+
75
+ create_table "audit_logs", :force => true do |t|
76
+ t.string "application"
77
+ t.string "description"
78
+ t.integer "party_id"
79
+ t.text "additional_info"
80
+ t.integer "audit_log_type_id"
81
+ t.integer "event_record_id"
82
+ t.string "event_record_type"
83
+ t.datetime "created_at", :null => false
84
+ t.datetime "updated_at", :null => false
85
+ end
86
+
87
+ add_index "audit_logs", ["event_record_id", "event_record_type"], :name => "event_record_index"
88
+ add_index "audit_logs", ["party_id"], :name => "index_audit_logs_on_party_id"
89
+
90
+ create_table "capabilities", :force => true do |t|
91
+ t.string "resource"
92
+ t.integer "capability_type_id"
93
+ t.datetime "created_at", :null => false
94
+ t.datetime "updated_at", :null => false
95
+ end
96
+
97
+ add_index "capabilities", ["capability_type_id"], :name => "index_capabilities_on_capability_type_id"
98
+
99
+ create_table "capabilities_capable_models", :id => false, :force => true do |t|
100
+ t.integer "capable_model_id"
101
+ t.integer "capability_id"
102
+ end
103
+
104
+ add_index "capabilities_capable_models", ["capability_id"], :name => "index_capabilities_capable_models_on_capability_id"
105
+ add_index "capabilities_capable_models", ["capable_model_id"], :name => "index_capabilities_capable_models_on_capable_model_id"
106
+
107
+ create_table "capability_types", :force => true do |t|
108
+ t.string "internal_identifier"
109
+ t.string "description"
110
+ t.datetime "created_at", :null => false
111
+ t.datetime "updated_at", :null => false
112
+ end
113
+
114
+ create_table "capable_models", :force => true do |t|
115
+ t.integer "capable_model_record_id"
116
+ t.string "capable_model_record_type"
117
+ t.datetime "created_at", :null => false
118
+ t.datetime "updated_at", :null => false
119
+ end
120
+
121
+ add_index "capable_models", ["capable_model_record_id", "capable_model_record_type"], :name => "capable_model_record_idx"
122
+
123
+ create_table "categories", :force => true do |t|
124
+ t.string "description"
125
+ t.string "external_identifier"
126
+ t.datetime "from_date"
127
+ t.datetime "to_date"
128
+ t.string "internal_identifier"
129
+ t.integer "category_record_id"
130
+ t.string "category_record_type"
131
+ t.integer "parent_id"
132
+ t.integer "lft"
133
+ t.integer "rgt"
134
+ t.datetime "created_at", :null => false
135
+ t.datetime "updated_at", :null => false
136
+ end
137
+
138
+ add_index "categories", ["category_record_id", "category_record_type"], :name => "category_polymorphic"
139
+
140
+ create_table "category_classifications", :force => true do |t|
141
+ t.integer "category_id"
142
+ t.string "classification_type"
143
+ t.integer "classification_id"
144
+ t.datetime "from_date"
145
+ t.datetime "to_date"
146
+ t.datetime "created_at", :null => false
147
+ t.datetime "updated_at", :null => false
148
+ end
149
+
150
+ add_index "category_classifications", ["classification_id", "classification_type"], :name => "classification_polymorphic"
151
+
152
+ create_table "compass_ae_instances", :force => true do |t|
153
+ t.decimal "version", :precision => 3, :scale => 8
154
+ t.datetime "created_at", :null => false
155
+ t.datetime "updated_at", :null => false
156
+ end
157
+
158
+ create_table "contact_purposes", :force => true do |t|
159
+ t.integer "parent_id"
160
+ t.integer "lft"
161
+ t.integer "rgt"
162
+ t.string "description"
163
+ t.string "comments"
164
+ t.string "internal_identifier"
165
+ t.string "external_identifier"
166
+ t.string "external_id_source"
167
+ t.datetime "created_at", :null => false
168
+ t.datetime "updated_at", :null => false
169
+ end
170
+
171
+ add_index "contact_purposes", ["parent_id"], :name => "index_contact_purposes_on_parent_id"
172
+
173
+ create_table "contact_purposes_contacts", :id => false, :force => true do |t|
174
+ t.integer "contact_id"
175
+ t.integer "contact_purpose_id"
176
+ end
177
+
178
+ add_index "contact_purposes_contacts", ["contact_id", "contact_purpose_id"], :name => "contact_purposes_contacts_index"
179
+
180
+ create_table "contact_types", :force => true do |t|
181
+ t.integer "parent_id"
182
+ t.integer "lft"
183
+ t.integer "rgt"
184
+ t.string "description"
185
+ t.string "comments"
186
+ t.string "internal_identifier"
187
+ t.string "external_identifier"
188
+ t.string "external_id_source"
189
+ t.datetime "created_at", :null => false
190
+ t.datetime "updated_at", :null => false
191
+ end
192
+
193
+ add_index "contact_types", ["parent_id"], :name => "index_contact_types_on_parent_id"
194
+
195
+ create_table "contacts", :force => true do |t|
196
+ t.integer "party_id"
197
+ t.integer "contact_mechanism_id"
198
+ t.string "contact_mechanism_type"
199
+ t.string "external_identifier"
200
+ t.string "external_id_source"
201
+ t.datetime "created_at", :null => false
202
+ t.datetime "updated_at", :null => false
203
+ end
204
+
205
+ add_index "contacts", ["contact_mechanism_id", "contact_mechanism_type"], :name => "besi_2"
206
+ add_index "contacts", ["party_id"], :name => "index_contacts_on_party_id"
207
+
208
+ create_table "costs", :force => true do |t|
209
+ t.integer "money_id"
210
+ t.datetime "created_at", :null => false
211
+ t.datetime "updated_at", :null => false
212
+ end
213
+
214
+ create_table "currencies", :force => true do |t|
215
+ t.string "name"
216
+ t.string "definition"
217
+ t.string "internal_identifier"
218
+ t.string "numeric_code"
219
+ t.string "major_unit_symbol"
220
+ t.string "minor_unit_symbol"
221
+ t.string "ratio_of_minor_unit_to_major_unit"
222
+ t.string "postfix_label"
223
+ t.datetime "introduction_date"
224
+ t.datetime "expiration_date"
225
+ t.datetime "created_at", :null => false
226
+ t.datetime "updated_at", :null => false
227
+ end
228
+
229
+ add_index "currencies", ["internal_identifier"], :name => "index_currencies_on_internal_identifier"
230
+
231
+ create_table "delayed_jobs", :force => true do |t|
232
+ t.integer "priority", :default => 0
233
+ t.integer "attempts", :default => 0
234
+ t.text "handler"
235
+ t.text "last_error"
236
+ t.datetime "run_at"
237
+ t.datetime "locked_at"
238
+ t.datetime "failed_at"
239
+ t.string "locked_by"
240
+ t.string "queue"
241
+ t.datetime "created_at", :null => false
242
+ t.datetime "updated_at", :null => false
243
+ end
244
+
245
+ add_index "delayed_jobs", ["priority", "run_at"], :name => "delayed_jobs_priority"
246
+
247
+ create_table "descriptive_assets", :force => true do |t|
248
+ t.integer "view_type_id"
249
+ t.string "internal_identifier"
250
+ t.text "description"
251
+ t.string "external_identifier"
252
+ t.string "external_id_source"
253
+ t.integer "described_record_id"
254
+ t.string "described_record_type"
255
+ t.datetime "created_at", :null => false
256
+ t.datetime "updated_at", :null => false
257
+ end
258
+
259
+ add_index "descriptive_assets", ["described_record_id", "described_record_type"], :name => "described_record_idx"
260
+ add_index "descriptive_assets", ["view_type_id"], :name => "index_descriptive_assets_on_view_type_id"
261
+
262
+ create_table "email_addresses", :force => true do |t|
263
+ t.string "email_address"
264
+ t.string "description"
265
+ t.datetime "created_at", :null => false
266
+ t.datetime "updated_at", :null => false
267
+ end
268
+
269
+ create_table "file_assets", :force => true do |t|
270
+ t.integer "file_asset_holder_id"
271
+ t.string "file_asset_holder_type"
272
+ t.string "type"
273
+ t.string "name"
274
+ t.string "directory"
275
+ t.string "data_file_name"
276
+ t.string "data_content_type"
277
+ t.integer "data_file_size"
278
+ t.datetime "data_updated_at"
279
+ t.string "width"
280
+ t.string "height"
281
+ t.datetime "created_at", :null => false
282
+ t.datetime "updated_at", :null => false
283
+ end
284
+
285
+ add_index "file_assets", ["directory"], :name => "index_file_assets_on_directory"
286
+ add_index "file_assets", ["file_asset_holder_id", "file_asset_holder_type"], :name => "file_asset_holder_idx"
287
+ add_index "file_assets", ["name"], :name => "index_file_assets_on_name"
288
+ add_index "file_assets", ["type"], :name => "index_file_assets_on_type"
289
+
290
+ create_table "geo_countries", :force => true do |t|
291
+ t.string "name"
292
+ t.string "iso_code_2"
293
+ t.string "iso_code_3"
294
+ t.boolean "display", :default => true
295
+ t.integer "external_id"
296
+ t.datetime "created_at"
297
+ end
298
+
299
+ add_index "geo_countries", ["iso_code_2"], :name => "index_geo_countries_on_iso_code_2"
300
+ add_index "geo_countries", ["name"], :name => "index_geo_countries_on_name"
301
+
302
+ create_table "geo_zones", :force => true do |t|
303
+ t.integer "geo_country_id"
304
+ t.string "zone_code", :default => "2"
305
+ t.string "zone_name"
306
+ t.datetime "created_at"
307
+ end
308
+
309
+ add_index "geo_zones", ["geo_country_id"], :name => "index_geo_zones_on_geo_country_id"
310
+ add_index "geo_zones", ["zone_code"], :name => "index_geo_zones_on_zone_code"
311
+ add_index "geo_zones", ["zone_name"], :name => "index_geo_zones_on_zone_name"
312
+
313
+ create_table "individuals", :force => true do |t|
314
+ t.integer "party_id"
315
+ t.string "current_last_name"
316
+ t.string "current_first_name"
317
+ t.string "current_middle_name"
318
+ t.string "current_personal_title"
319
+ t.string "current_suffix"
320
+ t.string "current_nickname"
321
+ t.string "gender", :limit => 1
322
+ t.date "birth_date"
323
+ t.decimal "height", :precision => 5, :scale => 2
324
+ t.integer "weight"
325
+ t.string "mothers_maiden_name"
326
+ t.string "marital_status", :limit => 1
327
+ t.string "social_security_number"
328
+ t.integer "current_passport_number"
329
+ t.date "current_passport_expire_date"
330
+ t.integer "total_years_work_experience"
331
+ t.string "comments"
332
+ t.string "encrypted_ssn"
333
+ t.string "temp_ssn"
334
+ t.string "salt"
335
+ t.string "ssn_last_four"
336
+ t.datetime "created_at", :null => false
337
+ t.datetime "updated_at", :null => false
338
+ end
339
+
340
+ add_index "individuals", ["party_id"], :name => "index_individuals_on_party_id"
341
+
342
+ create_table "money", :force => true do |t|
343
+ t.string "description"
344
+ t.decimal "amount", :precision => 8, :scale => 2
345
+ t.integer "currency_id"
346
+ t.datetime "created_at", :null => false
347
+ t.datetime "updated_at", :null => false
348
+ end
349
+
350
+ add_index "money", ["currency_id"], :name => "index_money_on_currency_id"
351
+
352
+ create_table "note_types", :force => true do |t|
353
+ t.integer "parent_id"
354
+ t.integer "lft"
355
+ t.integer "rgt"
356
+ t.string "description"
357
+ t.string "internal_identifier"
358
+ t.string "external_identifier"
359
+ t.integer "note_type_record_id"
360
+ t.string "note_type_record_type"
361
+ t.datetime "created_at", :null => false
362
+ t.datetime "updated_at", :null => false
363
+ end
364
+
365
+ add_index "note_types", ["note_type_record_id", "note_type_record_type"], :name => "note_type_record_idx"
366
+
367
+ create_table "notes", :force => true do |t|
368
+ t.integer "created_by_id"
369
+ t.text "content"
370
+ t.integer "noted_record_id"
371
+ t.string "noted_record_type"
372
+ t.integer "note_type_id"
373
+ t.datetime "created_at", :null => false
374
+ t.datetime "updated_at", :null => false
375
+ end
376
+
377
+ add_index "notes", ["created_by_id"], :name => "index_notes_on_created_by_id"
378
+ add_index "notes", ["note_type_id"], :name => "index_notes_on_note_type_id"
379
+ add_index "notes", ["noted_record_id", "noted_record_type"], :name => "index_notes_on_noted_record_id_and_noted_record_type"
380
+
381
+ create_table "organizations", :force => true do |t|
382
+ t.string "description"
383
+ t.string "tax_id_number"
384
+ t.datetime "created_at", :null => false
385
+ t.datetime "updated_at", :null => false
386
+ end
387
+
388
+ create_table "parties", :force => true do |t|
389
+ t.string "description"
390
+ t.integer "business_party_id"
391
+ t.string "business_party_type"
392
+ t.integer "list_view_image_id"
393
+ t.string "enterprise_identifier"
394
+ t.datetime "created_at", :null => false
395
+ t.datetime "updated_at", :null => false
396
+ end
397
+
398
+ add_index "parties", ["business_party_id", "business_party_type"], :name => "besi_1"
399
+
400
+ create_table "party_relationships", :force => true do |t|
401
+ t.string "description"
402
+ t.integer "party_id_from"
403
+ t.integer "party_id_to"
404
+ t.integer "role_type_id_from"
405
+ t.integer "role_type_id_to"
406
+ t.integer "status_type_id"
407
+ t.integer "priority_type_id"
408
+ t.integer "relationship_type_id"
409
+ t.date "from_date"
410
+ t.date "thru_date"
411
+ t.string "external_identifier"
412
+ t.string "external_id_source"
413
+ t.datetime "created_at", :null => false
414
+ t.datetime "updated_at", :null => false
415
+ end
416
+
417
+ add_index "party_relationships", ["priority_type_id"], :name => "index_party_relationships_on_priority_type_id"
418
+ add_index "party_relationships", ["relationship_type_id"], :name => "index_party_relationships_on_relationship_type_id"
419
+ add_index "party_relationships", ["status_type_id"], :name => "index_party_relationships_on_status_type_id"
420
+
421
+ create_table "party_resource_availabilities", :force => true do |t|
422
+ t.datetime "from_date"
423
+ t.datetime "to_date"
424
+ t.integer "party_id"
425
+ t.integer "pra_type_id"
426
+ t.datetime "created_at", :null => false
427
+ t.datetime "updated_at", :null => false
428
+ end
429
+
430
+ add_index "party_resource_availabilities", ["from_date"], :name => "index_party_resource_availabilities_on_from_date"
431
+ add_index "party_resource_availabilities", ["party_id"], :name => "index_party_resource_availabilities_on_party_id"
432
+ add_index "party_resource_availabilities", ["pra_type_id"], :name => "index_party_resource_availabilities_on_pra_type_id"
433
+ add_index "party_resource_availabilities", ["to_date"], :name => "index_party_resource_availabilities_on_to_date"
434
+
435
+ create_table "party_resource_availability_types", :force => true do |t|
436
+ t.string "description"
437
+ t.string "internal_identifier"
438
+ t.datetime "created_at", :null => false
439
+ t.datetime "updated_at", :null => false
440
+ end
441
+
442
+ add_index "party_resource_availability_types", ["description"], :name => "index_party_resource_availability_types_on_description"
443
+ add_index "party_resource_availability_types", ["internal_identifier"], :name => "index_party_resource_availability_types_on_internal_identifier"
444
+
445
+ create_table "party_roles", :force => true do |t|
446
+ t.string "type"
447
+ t.integer "party_id"
448
+ t.integer "role_type_id"
449
+ t.datetime "created_at", :null => false
450
+ t.datetime "updated_at", :null => false
451
+ end
452
+
453
+ add_index "party_roles", ["party_id"], :name => "index_party_roles_on_party_id"
454
+ add_index "party_roles", ["role_type_id"], :name => "index_party_roles_on_role_type_id"
455
+
456
+ create_table "party_search_facts", :force => true do |t|
457
+ t.integer "party_id"
458
+ t.string "eid"
459
+ t.string "type"
460
+ t.text "roles"
461
+ t.string "party_description"
462
+ t.string "party_business_party_type"
463
+ t.string "user_login"
464
+ t.string "individual_current_last_name"
465
+ t.string "individual_current_first_name"
466
+ t.string "individual_current_middle_name"
467
+ t.string "individual_birth_date"
468
+ t.string "individual_ssn"
469
+ t.string "party_phone_number"
470
+ t.string "party_email_address"
471
+ t.string "party_address_1"
472
+ t.string "party_address_2"
473
+ t.string "party_primary_address_city"
474
+ t.string "party_primary_address_state"
475
+ t.string "party_primary_address_zip"
476
+ t.string "party_primary_address_country"
477
+ t.boolean "user_enabled"
478
+ t.string "user_type"
479
+ t.boolean "reindex"
480
+ t.datetime "created_at", :null => false
481
+ t.datetime "updated_at", :null => false
482
+ end
483
+
484
+ create_table "phone_numbers", :force => true do |t|
485
+ t.string "phone_number"
486
+ t.string "description"
487
+ t.datetime "created_at", :null => false
488
+ t.datetime "updated_at", :null => false
489
+ end
490
+
491
+ create_table "postal_addresses", :force => true do |t|
492
+ t.string "address_line_1"
493
+ t.string "address_line_2"
494
+ t.string "city"
495
+ t.string "state"
496
+ t.string "zip"
497
+ t.string "country"
498
+ t.string "description"
499
+ t.integer "geo_country_id"
500
+ t.integer "geo_zone_id"
501
+ t.datetime "created_at", :null => false
502
+ t.datetime "updated_at", :null => false
503
+ end
504
+
505
+ add_index "postal_addresses", ["geo_country_id"], :name => "index_postal_addresses_on_geo_country_id"
506
+ add_index "postal_addresses", ["geo_zone_id"], :name => "index_postal_addresses_on_geo_zone_id"
507
+
508
+ create_table "relationship_types", :force => true do |t|
509
+ t.integer "parent_id"
510
+ t.integer "lft"
511
+ t.integer "rgt"
512
+ t.integer "valid_from_role_type_id"
513
+ t.integer "valid_to_role_type_id"
514
+ t.string "name"
515
+ t.string "description"
516
+ t.string "internal_identifier"
517
+ t.string "external_identifier"
518
+ t.string "external_id_source"
519
+ t.datetime "created_at", :null => false
520
+ t.datetime "updated_at", :null => false
521
+ end
522
+
523
+ add_index "relationship_types", ["valid_from_role_type_id"], :name => "index_relationship_types_on_valid_from_role_type_id"
524
+ add_index "relationship_types", ["valid_to_role_type_id"], :name => "index_relationship_types_on_valid_to_role_type_id"
525
+
526
+ create_table "role_types", :force => true do |t|
527
+ t.integer "parent_id"
528
+ t.integer "lft"
529
+ t.integer "rgt"
530
+ t.string "description"
531
+ t.string "comments"
532
+ t.string "internal_identifier"
533
+ t.string "external_identifier"
534
+ t.string "external_id_source"
535
+ t.datetime "created_at", :null => false
536
+ t.datetime "updated_at", :null => false
537
+ end
538
+
539
+ create_table "roles", :force => true do |t|
540
+ t.string "description"
541
+ t.string "internal_identifier"
542
+ t.string "external_identifier"
543
+ t.string "external_id_source"
544
+ t.datetime "created_at", :null => false
545
+ t.datetime "updated_at", :null => false
546
+ end
547
+
548
+ create_table "roles_secured_models", :id => false, :force => true do |t|
549
+ t.integer "secured_model_id"
550
+ t.integer "role_id"
551
+ end
552
+
553
+ add_index "roles_secured_models", ["role_id"], :name => "index_roles_secured_models_on_role_id"
554
+ add_index "roles_secured_models", ["secured_model_id"], :name => "index_roles_secured_models_on_secured_model_id"
555
+
556
+ create_table "secured_models", :force => true do |t|
557
+ t.integer "secured_record_id"
558
+ t.string "secured_record_type"
559
+ t.datetime "created_at", :null => false
560
+ t.datetime "updated_at", :null => false
561
+ end
562
+
563
+ add_index "secured_models", ["secured_record_id", "secured_record_type"], :name => "secured_record_idx"
564
+
565
+ create_table "sessions", :force => true do |t|
566
+ t.string "session_id", :null => false
567
+ t.text "data"
568
+ t.datetime "created_at", :null => false
569
+ t.datetime "updated_at", :null => false
570
+ end
571
+
572
+ add_index "sessions", ["session_id"], :name => "index_sessions_on_session_id"
573
+ add_index "sessions", ["updated_at"], :name => "index_sessions_on_updated_at"
574
+
575
+ create_table "users", :force => true do |t|
576
+ t.string "username"
577
+ t.string "email"
578
+ t.integer "party_id"
579
+ t.string "type"
580
+ t.string "salt"
581
+ t.string "crypted_password"
582
+ t.datetime "last_login_at"
583
+ t.datetime "last_logout_at"
584
+ t.datetime "last_activity_at"
585
+ t.integer "failed_logins_count", :default => 0
586
+ t.datetime "lock_expires_at"
587
+ t.string "remember_me_token"
588
+ t.datetime "remember_me_token_expires_at"
589
+ t.string "reset_password_token"
590
+ t.datetime "reset_password_token_expires_at"
591
+ t.datetime "reset_password_email_sent_at"
592
+ t.string "activation_state"
593
+ t.string "activation_token"
594
+ t.datetime "activation_token_expires_at"
595
+ t.string "security_question_1"
596
+ t.string "security_answer_1"
597
+ t.string "security_question_2"
598
+ t.string "security_answer_2"
599
+ t.datetime "created_at", :null => false
600
+ t.datetime "updated_at", :null => false
601
+ end
602
+
603
+ add_index "users", ["activation_token"], :name => "index_users_on_activation_token"
604
+ add_index "users", ["email"], :name => "index_users_on_email", :unique => true
605
+ add_index "users", ["last_logout_at", "last_activity_at"], :name => "activity_idx"
606
+ add_index "users", ["remember_me_token"], :name => "index_users_on_remember_me_token"
607
+ add_index "users", ["reset_password_token"], :name => "index_users_on_reset_password_token"
608
+ add_index "users", ["username"], :name => "index_users_on_username", :unique => true
609
+
610
+ create_table "valid_note_types", :force => true do |t|
611
+ t.integer "valid_note_type_record_id"
612
+ t.string "valid_note_type_record_type"
613
+ t.integer "note_type_id"
614
+ t.datetime "created_at", :null => false
615
+ t.datetime "updated_at", :null => false
616
+ end
617
+
618
+ add_index "valid_note_types", ["note_type_id"], :name => "index_valid_note_types_on_note_type_id"
619
+ add_index "valid_note_types", ["valid_note_type_record_id", "valid_note_type_record_type"], :name => "valid_note_type_record_idx"
620
+
621
+ create_table "valid_work_assignment_attributes", :force => true do |t|
622
+ t.integer "valid_work_assignment_id"
623
+ t.string "name"
624
+ t.string "type"
625
+ t.string "value"
626
+ t.datetime "created_at", :null => false
627
+ t.datetime "updated_at", :null => false
628
+ end
629
+
630
+ create_table "valid_work_assignments", :force => true do |t|
631
+ t.integer "role_type_id"
632
+ t.integer "work_requirement_id"
633
+ t.datetime "created_at", :null => false
634
+ t.datetime "updated_at", :null => false
635
+ end
636
+
637
+ create_table "view_types", :force => true do |t|
638
+ t.string "internal_identifier"
639
+ t.string "description"
640
+ t.datetime "created_at", :null => false
641
+ t.datetime "updated_at", :null => false
642
+ end
643
+
644
+ create_table "work_effort_assignments", :force => true do |t|
645
+ t.integer "work_effort_id"
646
+ t.datetime "assigned_at"
647
+ t.datetime "assigned_from"
648
+ t.datetime "assigned_thru"
649
+ t.datetime "unassigned_at"
650
+ t.integer "assigned_to_id"
651
+ t.string "assigned_to_type"
652
+ t.integer "assigned_by_id"
653
+ t.string "assigned_by_type"
654
+ t.datetime "created_at", :null => false
655
+ t.datetime "updated_at", :null => false
656
+ end
657
+
658
+ add_index "work_effort_assignments", ["assigned_from"], :name => "index_work_effort_assignments_on_assigned_from"
659
+ add_index "work_effort_assignments", ["assigned_thru"], :name => "index_work_effort_assignments_on_assigned_thru"
660
+ add_index "work_effort_assignments", ["assigned_to_id", "assigned_to_type"], :name => "assigned_to"
661
+ add_index "work_effort_assignments", ["work_effort_id"], :name => "index_work_effort_assignments_on_work_effort_id"
662
+
663
+ create_table "work_effort_status_types", :force => true do |t|
664
+ t.string "internal_identifier"
665
+ t.string "description"
666
+ t.integer "next_status_id"
667
+ t.integer "previous_status_id"
668
+ t.datetime "created_at", :null => false
669
+ t.datetime "updated_at", :null => false
670
+ end
671
+
672
+ add_index "work_effort_status_types", ["description"], :name => "index_work_effort_status_types_on_description"
673
+ add_index "work_effort_status_types", ["internal_identifier"], :name => "index_work_effort_status_types_on_internal_identifier"
674
+
675
+ create_table "work_effort_statuses", :force => true do |t|
676
+ t.datetime "started_at"
677
+ t.datetime "finished_at"
678
+ t.integer "work_effort_id"
679
+ t.integer "work_effort_status_type_id"
680
+ t.datetime "created_at", :null => false
681
+ t.datetime "updated_at", :null => false
682
+ end
683
+
684
+ add_index "work_effort_statuses", ["work_effort_id"], :name => "index_work_effort_statuses_on_work_effort_id"
685
+ add_index "work_effort_statuses", ["work_effort_status_type_id"], :name => "index_work_effort_statuses_on_work_effort_status_type_id"
686
+
687
+ create_table "work_efforts", :force => true do |t|
688
+ t.string "description"
689
+ t.string "type"
690
+ t.datetime "started_at"
691
+ t.datetime "finished_at"
692
+ t.integer "projected_completion_time"
693
+ t.integer "actual_completion_time"
694
+ t.datetime "created_at", :null => false
695
+ t.datetime "updated_at", :null => false
696
+ t.integer "facility_id"
697
+ t.string "facility_type"
698
+ t.integer "work_effort_record_id"
699
+ t.string "work_effort_record_type"
700
+ t.integer "projected_cost_id"
701
+ t.integer "actual_cost_id"
702
+ t.integer "parent_id"
703
+ t.integer "lft"
704
+ t.integer "rgt"
705
+ end
706
+
707
+ add_index "work_efforts", ["facility_type", "facility_id"], :name => "facility"
708
+ add_index "work_efforts", ["finished_at"], :name => "index_work_efforts_on_finished_at"
709
+ add_index "work_efforts", ["work_effort_record_id", "work_effort_record_type"], :name => "work_effort_record_id_type"
710
+
711
+ create_table "work_requirement_work_effort_status_types", :force => true do |t|
712
+ t.datetime "created_at", :null => false
713
+ t.datetime "updated_at", :null => false
714
+ t.integer "work_requirement_id"
715
+ t.integer "work_effort_status_type_id"
716
+ t.boolean "is_initial_status"
717
+ end
718
+
719
+ create_table "work_requirements", :force => true do |t|
720
+ t.string "description"
721
+ t.string "type"
722
+ t.integer "projected_completion_time"
723
+ t.datetime "created_at", :null => false
724
+ t.datetime "updated_at", :null => false
725
+ t.integer "work_requirement_record_id"
726
+ t.string "work_requirement_record_type"
727
+ t.integer "facility_id"
728
+ t.string "facility_type"
729
+ t.integer "cost_id"
730
+ t.integer "parent_id"
731
+ t.integer "lft"
732
+ t.integer "rgt"
733
+ end
734
+
735
+ end