erp_app 3.0.8 → 3.0.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,806 @@
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 => 20120429130430) do
15
+
16
+ create_table "app_containers", :force => true do |t|
17
+ t.integer "user_id"
18
+ t.string "description"
19
+ t.string "internal_identifier"
20
+ t.string "type"
21
+ t.datetime "created_at", :null => false
22
+ t.datetime "updated_at", :null => false
23
+ end
24
+
25
+ add_index "app_containers", ["type"], :name => "index_app_containers_on_type"
26
+ add_index "app_containers", ["user_id"], :name => "index_app_containers_on_user_id"
27
+
28
+ create_table "app_containers_applications", :id => false, :force => true do |t|
29
+ t.integer "app_container_id"
30
+ t.integer "application_id"
31
+ end
32
+
33
+ add_index "app_containers_applications", ["app_container_id"], :name => "index_app_containers_applications_on_app_container_id"
34
+ add_index "app_containers_applications", ["application_id"], :name => "index_app_containers_applications_on_application_id"
35
+
36
+ create_table "applications", :force => true do |t|
37
+ t.string "description"
38
+ t.string "icon"
39
+ t.string "internal_identifier"
40
+ t.string "javascript_class_name"
41
+ t.string "shortcut_id"
42
+ t.string "base_url"
43
+ t.string "type"
44
+ t.datetime "created_at", :null => false
45
+ t.datetime "updated_at", :null => false
46
+ end
47
+
48
+ create_table "applications_widgets", :id => false, :force => true do |t|
49
+ t.integer "application_id"
50
+ t.integer "widget_id"
51
+ end
52
+
53
+ add_index "applications_widgets", ["application_id"], :name => "index_applications_widgets_on_application_id"
54
+ add_index "applications_widgets", ["widget_id"], :name => "index_applications_widgets_on_widget_id"
55
+
56
+ create_table "attribute_types", :force => true do |t|
57
+ t.string "internal_identifier"
58
+ t.string "description"
59
+ t.string "data_type"
60
+ t.datetime "created_at", :null => false
61
+ t.datetime "updated_at", :null => false
62
+ end
63
+
64
+ add_index "attribute_types", ["internal_identifier"], :name => ":attribute_types_iid_idx"
65
+
66
+ create_table "attribute_values", :force => true do |t|
67
+ t.integer "attributed_record_id"
68
+ t.string "attributed_record_type"
69
+ t.integer "attribute_type_id"
70
+ t.string "value"
71
+ t.datetime "created_at", :null => false
72
+ t.datetime "updated_at", :null => false
73
+ end
74
+
75
+ add_index "attribute_values", ["attribute_type_id"], :name => "attribute_values_attributed_type_idx"
76
+ add_index "attribute_values", ["attributed_record_id", "attributed_record_type"], :name => "attribute_values_attributed_record_idx"
77
+ add_index "attribute_values", ["value"], :name => "attribute_values_value_idx"
78
+
79
+ create_table "audit_log_item_types", :force => true do |t|
80
+ t.string "internal_identifier"
81
+ t.string "external_identifier"
82
+ t.string "external_id_source"
83
+ t.string "description"
84
+ t.string "comments"
85
+ t.integer "parent_id"
86
+ t.integer "lft"
87
+ t.integer "rgt"
88
+ t.datetime "created_at", :null => false
89
+ t.datetime "updated_at", :null => false
90
+ end
91
+
92
+ create_table "audit_log_items", :force => true do |t|
93
+ t.integer "audit_log_id"
94
+ t.integer "audit_log_item_type_id"
95
+ t.string "audit_log_item_value"
96
+ t.string "description"
97
+ t.datetime "created_at", :null => false
98
+ t.datetime "updated_at", :null => false
99
+ end
100
+
101
+ create_table "audit_log_types", :force => true do |t|
102
+ t.string "description"
103
+ t.string "error_code"
104
+ t.string "comments"
105
+ t.string "internal_identifier"
106
+ t.string "external_identifier"
107
+ t.string "external_id_source"
108
+ t.integer "parent_id"
109
+ t.integer "lft"
110
+ t.integer "rgt"
111
+ t.datetime "created_at", :null => false
112
+ t.datetime "updated_at", :null => false
113
+ end
114
+
115
+ create_table "audit_logs", :force => true do |t|
116
+ t.string "application"
117
+ t.string "description"
118
+ t.integer "party_id"
119
+ t.text "additional_info"
120
+ t.integer "audit_log_type_id"
121
+ t.integer "event_record_id"
122
+ t.string "event_record_type"
123
+ t.datetime "created_at", :null => false
124
+ t.datetime "updated_at", :null => false
125
+ end
126
+
127
+ add_index "audit_logs", ["event_record_id", "event_record_type"], :name => "event_record_index"
128
+ add_index "audit_logs", ["party_id"], :name => "index_audit_logs_on_party_id"
129
+
130
+ create_table "capabilities", :force => true do |t|
131
+ t.string "resource"
132
+ t.integer "capability_type_id"
133
+ t.datetime "created_at", :null => false
134
+ t.datetime "updated_at", :null => false
135
+ end
136
+
137
+ add_index "capabilities", ["capability_type_id"], :name => "index_capabilities_on_capability_type_id"
138
+
139
+ create_table "capabilities_capable_models", :id => false, :force => true do |t|
140
+ t.integer "capable_model_id"
141
+ t.integer "capability_id"
142
+ end
143
+
144
+ add_index "capabilities_capable_models", ["capability_id"], :name => "index_capabilities_capable_models_on_capability_id"
145
+ add_index "capabilities_capable_models", ["capable_model_id"], :name => "index_capabilities_capable_models_on_capable_model_id"
146
+
147
+ create_table "capability_types", :force => true do |t|
148
+ t.string "internal_identifier"
149
+ t.string "description"
150
+ t.datetime "created_at", :null => false
151
+ t.datetime "updated_at", :null => false
152
+ end
153
+
154
+ create_table "capable_models", :force => true do |t|
155
+ t.integer "capable_model_record_id"
156
+ t.string "capable_model_record_type"
157
+ t.datetime "created_at", :null => false
158
+ t.datetime "updated_at", :null => false
159
+ end
160
+
161
+ add_index "capable_models", ["capable_model_record_id", "capable_model_record_type"], :name => "capable_model_record_idx"
162
+
163
+ create_table "categories", :force => true do |t|
164
+ t.string "description"
165
+ t.string "external_identifier"
166
+ t.datetime "from_date"
167
+ t.datetime "to_date"
168
+ t.string "internal_identifier"
169
+ t.integer "category_record_id"
170
+ t.string "category_record_type"
171
+ t.integer "parent_id"
172
+ t.integer "lft"
173
+ t.integer "rgt"
174
+ t.datetime "created_at", :null => false
175
+ t.datetime "updated_at", :null => false
176
+ end
177
+
178
+ add_index "categories", ["category_record_id", "category_record_type"], :name => "category_polymorphic"
179
+
180
+ create_table "category_classifications", :force => true do |t|
181
+ t.integer "category_id"
182
+ t.string "classification_type"
183
+ t.integer "classification_id"
184
+ t.datetime "from_date"
185
+ t.datetime "to_date"
186
+ t.datetime "created_at", :null => false
187
+ t.datetime "updated_at", :null => false
188
+ end
189
+
190
+ add_index "category_classifications", ["classification_id", "classification_type"], :name => "classification_polymorphic"
191
+
192
+ create_table "compass_ae_instances", :force => true do |t|
193
+ t.decimal "version"
194
+ t.datetime "created_at", :null => false
195
+ t.datetime "updated_at", :null => false
196
+ end
197
+
198
+ create_table "configuration_item_types", :force => true do |t|
199
+ t.integer "parent_id"
200
+ t.integer "lft"
201
+ t.integer "rgt"
202
+ t.string "description"
203
+ t.string "internal_identifier"
204
+ t.boolean "allow_user_defined_options", :default => false
205
+ t.boolean "is_multi_optional", :default => false
206
+ t.datetime "created_at", :null => false
207
+ t.datetime "updated_at", :null => false
208
+ end
209
+
210
+ create_table "configuration_item_types_configuration_options", :force => true do |t|
211
+ t.integer "configuration_item_type_id"
212
+ t.integer "configuration_option_id"
213
+ t.boolean "is_default", :default => false
214
+ t.datetime "created_at", :null => false
215
+ t.datetime "updated_at", :null => false
216
+ end
217
+
218
+ add_index "configuration_item_types_configuration_options", ["configuration_item_type_id"], :name => "conf_item_type_conf_opt_id_item_idx"
219
+ add_index "configuration_item_types_configuration_options", ["configuration_option_id"], :name => "conf_item_type_conf_opt_id_opt_idx"
220
+
221
+ create_table "configuration_item_types_configurations", :id => false, :force => true do |t|
222
+ t.integer "configuration_item_type_id"
223
+ t.integer "configuration_id"
224
+ end
225
+
226
+ add_index "configuration_item_types_configurations", ["configuration_id"], :name => "conf_id_idx"
227
+ add_index "configuration_item_types_configurations", ["configuration_item_type_id", "configuration_id"], :name => "conf_config_type_uniq_idx", :unique => true
228
+ add_index "configuration_item_types_configurations", ["configuration_item_type_id"], :name => "conf_conf_type_id_item_idx"
229
+
230
+ create_table "configuration_items", :force => true do |t|
231
+ t.integer "configuration_id"
232
+ t.integer "configuration_item_type_id"
233
+ t.integer "configuration_option_id"
234
+ t.datetime "created_at", :null => false
235
+ t.datetime "updated_at", :null => false
236
+ end
237
+
238
+ add_index "configuration_items", ["configuration_id"], :name => "index_configuration_items_on_configuration_id"
239
+ add_index "configuration_items", ["configuration_item_type_id"], :name => "index_configuration_items_on_configuration_item_type_id"
240
+ add_index "configuration_items", ["configuration_option_id"], :name => "index_configuration_items_on_configuration_option_id"
241
+
242
+ create_table "configuration_items_configuration_options", :id => false, :force => true do |t|
243
+ t.integer "configuration_item_id"
244
+ t.integer "configuration_option_id"
245
+ end
246
+
247
+ add_index "configuration_items_configuration_options", ["configuration_item_id"], :name => "conf_item_conf_opt_id_item_idx"
248
+ add_index "configuration_items_configuration_options", ["configuration_option_id"], :name => "conf_item_conf_opt_id_opt_idx"
249
+
250
+ create_table "configuration_options", :force => true do |t|
251
+ t.string "description"
252
+ t.string "internal_identifier"
253
+ t.string "value"
254
+ t.text "comment"
255
+ t.boolean "user_defined", :default => false
256
+ t.datetime "created_at", :null => false
257
+ t.datetime "updated_at", :null => false
258
+ end
259
+
260
+ add_index "configuration_options", ["internal_identifier"], :name => "index_configuration_options_on_internal_identifier"
261
+ add_index "configuration_options", ["user_defined"], :name => "index_configuration_options_on_user_defined"
262
+ add_index "configuration_options", ["value"], :name => "index_configuration_options_on_value"
263
+
264
+ create_table "configurations", :force => true do |t|
265
+ t.string "description"
266
+ t.string "internal_identifier"
267
+ t.boolean "active"
268
+ t.datetime "created_at", :null => false
269
+ t.datetime "updated_at", :null => false
270
+ t.boolean "is_template", :default => false
271
+ end
272
+
273
+ create_table "contact_purposes", :force => true do |t|
274
+ t.integer "parent_id"
275
+ t.integer "lft"
276
+ t.integer "rgt"
277
+ t.string "description"
278
+ t.string "comments"
279
+ t.string "internal_identifier"
280
+ t.string "external_identifier"
281
+ t.string "external_id_source"
282
+ t.datetime "created_at", :null => false
283
+ t.datetime "updated_at", :null => false
284
+ end
285
+
286
+ add_index "contact_purposes", ["parent_id"], :name => "index_contact_purposes_on_parent_id"
287
+
288
+ create_table "contact_purposes_contacts", :id => false, :force => true do |t|
289
+ t.integer "contact_id"
290
+ t.integer "contact_purpose_id"
291
+ end
292
+
293
+ add_index "contact_purposes_contacts", ["contact_id", "contact_purpose_id"], :name => "contact_purposes_contacts_index"
294
+
295
+ create_table "contact_types", :force => true do |t|
296
+ t.integer "parent_id"
297
+ t.integer "lft"
298
+ t.integer "rgt"
299
+ t.string "description"
300
+ t.string "comments"
301
+ t.string "internal_identifier"
302
+ t.string "external_identifier"
303
+ t.string "external_id_source"
304
+ t.datetime "created_at", :null => false
305
+ t.datetime "updated_at", :null => false
306
+ end
307
+
308
+ add_index "contact_types", ["parent_id"], :name => "index_contact_types_on_parent_id"
309
+
310
+ create_table "contacts", :force => true do |t|
311
+ t.integer "party_id"
312
+ t.integer "contact_mechanism_id"
313
+ t.string "contact_mechanism_type"
314
+ t.string "external_identifier"
315
+ t.string "external_id_source"
316
+ t.datetime "created_at", :null => false
317
+ t.datetime "updated_at", :null => false
318
+ end
319
+
320
+ add_index "contacts", ["contact_mechanism_id", "contact_mechanism_type"], :name => "besi_2"
321
+ add_index "contacts", ["party_id"], :name => "index_contacts_on_party_id"
322
+
323
+ create_table "currencies", :force => true do |t|
324
+ t.string "name"
325
+ t.string "definition"
326
+ t.string "internal_identifier"
327
+ t.string "numeric_code"
328
+ t.string "major_unit_symbol"
329
+ t.string "minor_unit_symbol"
330
+ t.string "ratio_of_minor_unit_to_major_unit"
331
+ t.string "postfix_label"
332
+ t.datetime "introduction_date"
333
+ t.datetime "expiration_date"
334
+ t.datetime "created_at", :null => false
335
+ t.datetime "updated_at", :null => false
336
+ end
337
+
338
+ add_index "currencies", ["internal_identifier"], :name => "index_currencies_on_internal_identifier"
339
+
340
+ create_table "delayed_jobs", :force => true do |t|
341
+ t.integer "priority", :default => 0
342
+ t.integer "attempts", :default => 0
343
+ t.text "handler"
344
+ t.text "last_error"
345
+ t.datetime "run_at"
346
+ t.datetime "locked_at"
347
+ t.datetime "failed_at"
348
+ t.string "locked_by"
349
+ t.string "queue"
350
+ t.datetime "created_at", :null => false
351
+ t.datetime "updated_at", :null => false
352
+ end
353
+
354
+ add_index "delayed_jobs", ["priority", "run_at"], :name => "delayed_jobs_priority"
355
+
356
+ create_table "descriptive_assets", :force => true do |t|
357
+ t.integer "view_type_id"
358
+ t.string "internal_identifier"
359
+ t.text "description"
360
+ t.string "external_identifier"
361
+ t.string "external_id_source"
362
+ t.integer "described_record_id"
363
+ t.string "described_record_type"
364
+ t.datetime "created_at", :null => false
365
+ t.datetime "updated_at", :null => false
366
+ end
367
+
368
+ add_index "descriptive_assets", ["described_record_id", "described_record_type"], :name => "described_record_idx"
369
+ add_index "descriptive_assets", ["view_type_id"], :name => "index_descriptive_assets_on_view_type_id"
370
+
371
+ create_table "email_addresses", :force => true do |t|
372
+ t.string "email_address"
373
+ t.string "description"
374
+ t.datetime "created_at", :null => false
375
+ t.datetime "updated_at", :null => false
376
+ end
377
+
378
+ create_table "file_assets", :force => true do |t|
379
+ t.integer "file_asset_holder_id"
380
+ t.string "file_asset_holder_type"
381
+ t.string "type"
382
+ t.string "name"
383
+ t.string "directory"
384
+ t.string "data_file_name"
385
+ t.string "data_content_type"
386
+ t.integer "data_file_size"
387
+ t.datetime "data_updated_at"
388
+ t.string "width"
389
+ t.string "height"
390
+ t.datetime "created_at", :null => false
391
+ t.datetime "updated_at", :null => false
392
+ end
393
+
394
+ add_index "file_assets", ["directory"], :name => "index_file_assets_on_directory"
395
+ add_index "file_assets", ["file_asset_holder_id", "file_asset_holder_type"], :name => "file_asset_holder_idx"
396
+ add_index "file_assets", ["name"], :name => "index_file_assets_on_name"
397
+ add_index "file_assets", ["type"], :name => "index_file_assets_on_type"
398
+
399
+ create_table "geo_countries", :force => true do |t|
400
+ t.string "name"
401
+ t.string "iso_code_2"
402
+ t.string "iso_code_3"
403
+ t.boolean "display", :default => true
404
+ t.integer "external_id"
405
+ t.datetime "created_at"
406
+ end
407
+
408
+ add_index "geo_countries", ["iso_code_2"], :name => "index_geo_countries_on_iso_code_2"
409
+ add_index "geo_countries", ["name"], :name => "index_geo_countries_on_name"
410
+
411
+ create_table "geo_zones", :force => true do |t|
412
+ t.integer "geo_country_id"
413
+ t.string "zone_code", :default => "2"
414
+ t.string "zone_name"
415
+ t.datetime "created_at"
416
+ end
417
+
418
+ add_index "geo_zones", ["geo_country_id"], :name => "index_geo_zones_on_geo_country_id"
419
+ add_index "geo_zones", ["zone_code"], :name => "index_geo_zones_on_zone_code"
420
+ add_index "geo_zones", ["zone_name"], :name => "index_geo_zones_on_zone_name"
421
+
422
+ create_table "individuals", :force => true do |t|
423
+ t.integer "party_id"
424
+ t.string "current_last_name"
425
+ t.string "current_first_name"
426
+ t.string "current_middle_name"
427
+ t.string "current_personal_title"
428
+ t.string "current_suffix"
429
+ t.string "current_nickname"
430
+ t.string "gender", :limit => 1
431
+ t.date "birth_date"
432
+ t.decimal "height", :precision => 5, :scale => 2
433
+ t.integer "weight"
434
+ t.string "mothers_maiden_name"
435
+ t.string "marital_status", :limit => 1
436
+ t.string "social_security_number"
437
+ t.integer "current_passport_number"
438
+ t.date "current_passport_expire_date"
439
+ t.integer "total_years_work_experience"
440
+ t.string "comments"
441
+ t.string "encrypted_ssn"
442
+ t.string "temp_ssn"
443
+ t.string "salt"
444
+ t.string "ssn_last_four"
445
+ t.datetime "created_at", :null => false
446
+ t.datetime "updated_at", :null => false
447
+ end
448
+
449
+ add_index "individuals", ["party_id"], :name => "index_individuals_on_party_id"
450
+
451
+ create_table "money", :force => true do |t|
452
+ t.string "description"
453
+ t.decimal "amount", :precision => 8, :scale => 2
454
+ t.integer "currency_id"
455
+ t.datetime "created_at", :null => false
456
+ t.datetime "updated_at", :null => false
457
+ end
458
+
459
+ add_index "money", ["currency_id"], :name => "index_money_on_currency_id"
460
+
461
+ create_table "note_types", :force => true do |t|
462
+ t.integer "parent_id"
463
+ t.integer "lft"
464
+ t.integer "rgt"
465
+ t.string "description"
466
+ t.string "internal_identifier"
467
+ t.string "external_identifier"
468
+ t.integer "note_type_record_id"
469
+ t.string "note_type_record_type"
470
+ t.datetime "created_at", :null => false
471
+ t.datetime "updated_at", :null => false
472
+ end
473
+
474
+ add_index "note_types", ["note_type_record_id", "note_type_record_type"], :name => "note_type_record_idx"
475
+
476
+ create_table "notes", :force => true do |t|
477
+ t.integer "created_by_id"
478
+ t.text "content"
479
+ t.integer "noted_record_id"
480
+ t.string "noted_record_type"
481
+ t.integer "note_type_id"
482
+ t.datetime "created_at", :null => false
483
+ t.datetime "updated_at", :null => false
484
+ end
485
+
486
+ add_index "notes", ["created_by_id"], :name => "index_notes_on_created_by_id"
487
+ add_index "notes", ["note_type_id"], :name => "index_notes_on_note_type_id"
488
+ add_index "notes", ["noted_record_id", "noted_record_type"], :name => "index_notes_on_noted_record_id_and_noted_record_type"
489
+
490
+ create_table "organizations", :force => true do |t|
491
+ t.string "description"
492
+ t.string "tax_id_number"
493
+ t.datetime "created_at", :null => false
494
+ t.datetime "updated_at", :null => false
495
+ end
496
+
497
+ create_table "parties", :force => true do |t|
498
+ t.string "description"
499
+ t.integer "business_party_id"
500
+ t.string "business_party_type"
501
+ t.integer "list_view_image_id"
502
+ t.string "enterprise_identifier"
503
+ t.datetime "created_at", :null => false
504
+ t.datetime "updated_at", :null => false
505
+ end
506
+
507
+ add_index "parties", ["business_party_id", "business_party_type"], :name => "besi_1"
508
+
509
+ create_table "party_relationships", :force => true do |t|
510
+ t.string "description"
511
+ t.integer "party_id_from"
512
+ t.integer "party_id_to"
513
+ t.integer "role_type_id_from"
514
+ t.integer "role_type_id_to"
515
+ t.integer "status_type_id"
516
+ t.integer "priority_type_id"
517
+ t.integer "relationship_type_id"
518
+ t.date "from_date"
519
+ t.date "thru_date"
520
+ t.string "external_identifier"
521
+ t.string "external_id_source"
522
+ t.datetime "created_at", :null => false
523
+ t.datetime "updated_at", :null => false
524
+ end
525
+
526
+ add_index "party_relationships", ["priority_type_id"], :name => "index_party_relationships_on_priority_type_id"
527
+ add_index "party_relationships", ["relationship_type_id"], :name => "index_party_relationships_on_relationship_type_id"
528
+ add_index "party_relationships", ["status_type_id"], :name => "index_party_relationships_on_status_type_id"
529
+
530
+ create_table "party_roles", :force => true do |t|
531
+ t.string "type"
532
+ t.integer "party_id"
533
+ t.integer "role_type_id"
534
+ t.datetime "created_at", :null => false
535
+ t.datetime "updated_at", :null => false
536
+ end
537
+
538
+ add_index "party_roles", ["party_id"], :name => "index_party_roles_on_party_id"
539
+ add_index "party_roles", ["role_type_id"], :name => "index_party_roles_on_role_type_id"
540
+
541
+ create_table "party_search_facts", :force => true do |t|
542
+ t.integer "party_id"
543
+ t.string "eid"
544
+ t.string "type"
545
+ t.text "roles"
546
+ t.string "party_description"
547
+ t.string "party_business_party_type"
548
+ t.string "user_login"
549
+ t.string "individual_current_last_name"
550
+ t.string "individual_current_first_name"
551
+ t.string "individual_current_middle_name"
552
+ t.string "individual_birth_date"
553
+ t.string "individual_ssn"
554
+ t.string "party_phone_number"
555
+ t.string "party_email_address"
556
+ t.string "party_address_1"
557
+ t.string "party_address_2"
558
+ t.string "party_primary_address_city"
559
+ t.string "party_primary_address_state"
560
+ t.string "party_primary_address_zip"
561
+ t.string "party_primary_address_country"
562
+ t.boolean "user_enabled"
563
+ t.string "user_type"
564
+ t.boolean "reindex"
565
+ t.datetime "created_at", :null => false
566
+ t.datetime "updated_at", :null => false
567
+ end
568
+
569
+ create_table "phone_numbers", :force => true do |t|
570
+ t.string "phone_number"
571
+ t.string "description"
572
+ t.datetime "created_at", :null => false
573
+ t.datetime "updated_at", :null => false
574
+ end
575
+
576
+ create_table "postal_addresses", :force => true do |t|
577
+ t.string "address_line_1"
578
+ t.string "address_line_2"
579
+ t.string "city"
580
+ t.string "state"
581
+ t.string "zip"
582
+ t.string "country"
583
+ t.string "description"
584
+ t.integer "geo_country_id"
585
+ t.integer "geo_zone_id"
586
+ t.datetime "created_at", :null => false
587
+ t.datetime "updated_at", :null => false
588
+ end
589
+
590
+ add_index "postal_addresses", ["geo_country_id"], :name => "index_postal_addresses_on_geo_country_id"
591
+ add_index "postal_addresses", ["geo_zone_id"], :name => "index_postal_addresses_on_geo_zone_id"
592
+
593
+ create_table "preference_options", :force => true do |t|
594
+ t.string "description"
595
+ t.string "internal_identifier"
596
+ t.string "value"
597
+ t.datetime "created_at", :null => false
598
+ t.datetime "updated_at", :null => false
599
+ end
600
+
601
+ create_table "preference_options_preference_types", :id => false, :force => true do |t|
602
+ t.integer "preference_type_id"
603
+ t.integer "preference_option_id"
604
+ end
605
+
606
+ add_index "preference_options_preference_types", ["preference_option_id"], :name => "pref_opt_pref_type_pref_opt_id_idx"
607
+ add_index "preference_options_preference_types", ["preference_type_id"], :name => "pref_opt_pref_type_pref_type_id_idx"
608
+
609
+ create_table "preference_types", :force => true do |t|
610
+ t.string "description"
611
+ t.string "internal_identifier"
612
+ t.integer "default_pref_option_id"
613
+ t.datetime "created_at", :null => false
614
+ t.datetime "updated_at", :null => false
615
+ end
616
+
617
+ add_index "preference_types", ["default_pref_option_id"], :name => "index_preference_types_on_default_pref_option_id"
618
+
619
+ create_table "preferences", :force => true do |t|
620
+ t.integer "preference_option_id"
621
+ t.integer "preference_type_id"
622
+ t.datetime "created_at", :null => false
623
+ t.datetime "updated_at", :null => false
624
+ end
625
+
626
+ add_index "preferences", ["preference_option_id"], :name => "index_preferences_on_preference_option_id"
627
+ add_index "preferences", ["preference_type_id"], :name => "index_preferences_on_preference_type_id"
628
+
629
+ create_table "relationship_types", :force => true do |t|
630
+ t.integer "parent_id"
631
+ t.integer "lft"
632
+ t.integer "rgt"
633
+ t.integer "valid_from_role_type_id"
634
+ t.integer "valid_to_role_type_id"
635
+ t.string "name"
636
+ t.string "description"
637
+ t.string "internal_identifier"
638
+ t.string "external_identifier"
639
+ t.string "external_id_source"
640
+ t.datetime "created_at", :null => false
641
+ t.datetime "updated_at", :null => false
642
+ end
643
+
644
+ add_index "relationship_types", ["valid_from_role_type_id"], :name => "index_relationship_types_on_valid_from_role_type_id"
645
+ add_index "relationship_types", ["valid_to_role_type_id"], :name => "index_relationship_types_on_valid_to_role_type_id"
646
+
647
+ create_table "role_types", :force => true do |t|
648
+ t.integer "parent_id"
649
+ t.integer "lft"
650
+ t.integer "rgt"
651
+ t.string "description"
652
+ t.string "comments"
653
+ t.string "internal_identifier"
654
+ t.string "external_identifier"
655
+ t.string "external_id_source"
656
+ t.datetime "created_at", :null => false
657
+ t.datetime "updated_at", :null => false
658
+ end
659
+
660
+ create_table "roles", :force => true do |t|
661
+ t.string "description"
662
+ t.string "internal_identifier"
663
+ t.string "external_identifier"
664
+ t.string "external_id_source"
665
+ t.datetime "created_at", :null => false
666
+ t.datetime "updated_at", :null => false
667
+ end
668
+
669
+ create_table "roles_secured_models", :id => false, :force => true do |t|
670
+ t.integer "secured_model_id"
671
+ t.integer "role_id"
672
+ end
673
+
674
+ add_index "roles_secured_models", ["role_id"], :name => "index_roles_secured_models_on_role_id"
675
+ add_index "roles_secured_models", ["secured_model_id"], :name => "index_roles_secured_models_on_secured_model_id"
676
+
677
+ create_table "secured_models", :force => true do |t|
678
+ t.integer "secured_record_id"
679
+ t.string "secured_record_type"
680
+ t.datetime "created_at", :null => false
681
+ t.datetime "updated_at", :null => false
682
+ end
683
+
684
+ add_index "secured_models", ["secured_record_id", "secured_record_type"], :name => "secured_record_idx"
685
+
686
+ create_table "sessions", :force => true do |t|
687
+ t.string "session_id", :null => false
688
+ t.text "data"
689
+ t.datetime "created_at", :null => false
690
+ t.datetime "updated_at", :null => false
691
+ end
692
+
693
+ add_index "sessions", ["session_id"], :name => "index_sessions_on_session_id"
694
+ add_index "sessions", ["updated_at"], :name => "index_sessions_on_updated_at"
695
+
696
+ create_table "tree_menu_node_defs", :force => true do |t|
697
+ t.string "node_type"
698
+ t.integer "parent_id"
699
+ t.integer "lft"
700
+ t.integer "rgt"
701
+ t.string "menu_short_name"
702
+ t.string "menu_description"
703
+ t.string "text"
704
+ t.string "icon_url"
705
+ t.string "target_url"
706
+ t.string "resource_class"
707
+ t.datetime "created_at", :null => false
708
+ t.datetime "updated_at", :null => false
709
+ end
710
+
711
+ add_index "tree_menu_node_defs", ["parent_id"], :name => "index_tree_menu_node_defs_on_parent_id"
712
+
713
+ create_table "user_preferences", :force => true do |t|
714
+ t.integer "user_id"
715
+ t.integer "preference_id"
716
+ t.integer "preferenced_record_id"
717
+ t.string "preferenced_record_type"
718
+ t.datetime "created_at", :null => false
719
+ t.datetime "updated_at", :null => false
720
+ end
721
+
722
+ add_index "user_preferences", ["preference_id"], :name => "index_user_preferences_on_preference_id"
723
+ add_index "user_preferences", ["preferenced_record_id"], :name => "index_user_preferences_on_preferenced_record_id"
724
+ add_index "user_preferences", ["preferenced_record_type"], :name => "index_user_preferences_on_preferenced_record_type"
725
+ add_index "user_preferences", ["user_id"], :name => "index_user_preferences_on_user_id"
726
+
727
+ create_table "users", :force => true do |t|
728
+ t.string "username"
729
+ t.string "email"
730
+ t.integer "party_id"
731
+ t.string "type"
732
+ t.string "salt"
733
+ t.string "crypted_password"
734
+ t.datetime "last_login_at"
735
+ t.datetime "last_logout_at"
736
+ t.datetime "last_activity_at"
737
+ t.integer "failed_logins_count", :default => 0
738
+ t.datetime "lock_expires_at"
739
+ t.string "remember_me_token"
740
+ t.datetime "remember_me_token_expires_at"
741
+ t.string "reset_password_token"
742
+ t.datetime "reset_password_token_expires_at"
743
+ t.datetime "reset_password_email_sent_at"
744
+ t.string "activation_state"
745
+ t.string "activation_token"
746
+ t.datetime "activation_token_expires_at"
747
+ t.string "security_question_1"
748
+ t.string "security_answer_1"
749
+ t.string "security_question_2"
750
+ t.string "security_answer_2"
751
+ t.datetime "created_at", :null => false
752
+ t.datetime "updated_at", :null => false
753
+ end
754
+
755
+ add_index "users", ["activation_token"], :name => "index_users_on_activation_token"
756
+ add_index "users", ["email"], :name => "index_users_on_email", :unique => true
757
+ add_index "users", ["last_logout_at", "last_activity_at"], :name => "activity_idx"
758
+ add_index "users", ["remember_me_token"], :name => "index_users_on_remember_me_token"
759
+ add_index "users", ["reset_password_token"], :name => "index_users_on_reset_password_token"
760
+ add_index "users", ["username"], :name => "index_users_on_username", :unique => true
761
+
762
+ create_table "valid_configurations", :force => true do |t|
763
+ t.integer "configured_item_id"
764
+ t.string "configured_item_type"
765
+ t.integer "configuration_id"
766
+ t.datetime "created_at", :null => false
767
+ t.datetime "updated_at", :null => false
768
+ end
769
+
770
+ add_index "valid_configurations", ["configuration_id"], :name => "index_valid_configurations_on_configuration_id"
771
+ add_index "valid_configurations", ["configured_item_id", "configured_item_type"], :name => "configured_item_poly_idx"
772
+
773
+ create_table "valid_note_types", :force => true do |t|
774
+ t.integer "valid_note_type_record_id"
775
+ t.string "valid_note_type_record_type"
776
+ t.integer "note_type_id"
777
+ t.datetime "created_at", :null => false
778
+ t.datetime "updated_at", :null => false
779
+ end
780
+
781
+ add_index "valid_note_types", ["note_type_id"], :name => "index_valid_note_types_on_note_type_id"
782
+ add_index "valid_note_types", ["valid_note_type_record_id", "valid_note_type_record_type"], :name => "valid_note_type_record_idx"
783
+
784
+ create_table "valid_preference_types", :force => true do |t|
785
+ t.integer "preference_type_id"
786
+ t.integer "preferenced_record_id"
787
+ t.string "preferenced_record_type"
788
+ end
789
+
790
+ create_table "view_types", :force => true do |t|
791
+ t.string "internal_identifier"
792
+ t.string "description"
793
+ t.datetime "created_at", :null => false
794
+ t.datetime "updated_at", :null => false
795
+ end
796
+
797
+ create_table "widgets", :force => true do |t|
798
+ t.string "description"
799
+ t.string "internal_identifier"
800
+ t.string "icon"
801
+ t.string "xtype"
802
+ t.datetime "created_at", :null => false
803
+ t.datetime "updated_at", :null => false
804
+ end
805
+
806
+ end