erp_rules 3.1.0 → 4.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (45) hide show
  1. checksums.yaml +7 -0
  2. data/lib/erp_rules/rules_engine/pricing_engine.rb +1 -1
  3. data/lib/erp_rules/search/search_base.rb +1 -1
  4. data/lib/erp_rules/version.rb +6 -2
  5. metadata +27 -115
  6. data/app/assets/javascripts/erp_rules/application.js +0 -9
  7. data/app/assets/stylesheets/erp_rules/application.css +0 -7
  8. data/app/controllers/erp_rules/application_controller.rb +0 -4
  9. data/app/helpers/erp_rules/application_helper.rb +0 -4
  10. data/app/views/layouts/erp_rules/application.html.erb +0 -14
  11. data/spec/dummy/db/data_migrations/20101014142230_financial_txn_types.erp_txns_and_accts.rb +0 -16
  12. data/spec/dummy/db/data_migrations/20110109173616_create_capability_scope_types.erp_tech_svcs.rb +0 -15
  13. data/spec/dummy/db/data_migrations/20110525001935_add_usd_currency.erp_base_erp_svcs.rb +0 -12
  14. data/spec/dummy/db/data_migrations/20110609150135_add_iso_codes.erp_base_erp_svcs.rb +0 -19
  15. data/spec/dummy/db/data_migrations/20110728201729_erp_app_setup.erp_app.rb +0 -252
  16. data/spec/dummy/db/data_migrations/20110728201733_update_preferences.erp_app.rb +0 -53
  17. data/spec/dummy/db/data_migrations/20110802200222_schedule_delete_expired_sessions_job.erp_tech_svcs.rb +0 -16
  18. data/spec/dummy/db/data_migrations/20110816161238_create_desktop_app_audit_log_viewer.erp_app.rb +0 -21
  19. data/spec/dummy/db/data_migrations/20110817160743_add_file_manager_application.erp_app.rb +0 -32
  20. data/spec/dummy/db/data_migrations/20110913145838_setup_compass_ae_instance.erp_base_erp_svcs.rb +0 -12
  21. data/spec/dummy/db/data_migrations/20111108183739_add_default_capabilities.erp_app.rb +0 -23
  22. data/spec/dummy/db/data_migrations/20111108183740_add_new_contact_widgets.erp_app.rb +0 -42
  23. data/spec/dummy/db/data_migrations/20111111144706_setup_audit_log_types.erp_tech_svcs.rb +0 -22
  24. data/spec/dummy/db/data_migrations/20120109173616_create_download_capability_type.erp_tech_svcs.rb +0 -14
  25. data/spec/dummy/db/data_migrations/20120229160222_add_userinfo_widget.erp_app.rb +0 -29
  26. data/spec/dummy/db/data_migrations/20120405193721_create_party_and_role_type_for_communication_events.erp_app.rb +0 -11
  27. data/spec/dummy/db/data_migrations/20120411180756_create_user_management_mobile_application.erp_app.rb +0 -19
  28. data/spec/dummy/db/data_migrations/20120418164215_create_configuration_management_desktop_application.erp_app.rb +0 -23
  29. data/spec/dummy/db/data_migrations/20121116155018_create_group_relationship_and_role_types.erp_tech_svcs.rb +0 -20
  30. data/spec/dummy/db/data_migrations/20121130201859_upgrade_remove_system_mgmt_app.erp_app.rb +0 -16
  31. data/spec/dummy/db/data_migrations/20121130212146_note_capabilities.erp_tech_svcs.rb +0 -24
  32. data/spec/dummy/db/data_migrations/20121218175028_create_security_management_desktop_application.erp_app.rb +0 -23
  33. data/spec/dummy/db/migrate/20121214005236_base_erp_services.erp_base_erp_svcs.rb +0 -461
  34. data/spec/dummy/db/migrate/20121214005237_base_tech_services.erp_tech_svcs.rb +0 -255
  35. data/spec/dummy/db/migrate/20121214005238_create_has_attribute_tables.erp_tech_svcs.rb +0 -39
  36. data/spec/dummy/db/migrate/20121214005239_base_txns_and_accts.erp_txns_and_accts.rb +0 -364
  37. data/spec/dummy/db/migrate/20121214005240_agreements_services.erp_agreements.rb +0 -160
  38. data/spec/dummy/db/migrate/20121214005241_agreements_services_indexes.erp_agreements.rb +0 -52
  39. data/spec/dummy/db/migrate/20121214005242_base_app_framework.erp_app.rb +0 -276
  40. data/spec/dummy/db/migrate/20130107181307_create_groups.erp_tech_svcs.rb +0 -19
  41. data/spec/dummy/db/migrate/20130107181308_upgrade_security.erp_tech_svcs.rb +0 -54
  42. data/spec/dummy/db/migrate/20130107181309_upgrade_security2.erp_tech_svcs.rb +0 -270
  43. data/spec/dummy/db/schema.rb +0 -1247
  44. data/spec/dummy/db/spec.sqlite3 +0 -0
  45. data/spec/dummy/log/spec.log +0 -10110
@@ -1,19 +0,0 @@
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
@@ -1,54 +0,0 @@
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
@@ -1,270 +0,0 @@
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
@@ -1,1247 +0,0 @@
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 => 20121214005242) do
15
-
16
- create_table "agreement_item_types", :force => true do |t|
17
- t.integer "parent_id"
18
- t.integer "lft"
19
- t.integer "rgt"
20
- t.string "description"
21
- t.string "comments"
22
- t.string "internal_identifier"
23
- t.string "external_identifier"
24
- t.string "external_id_source"
25
- t.datetime "created_at", :null => false
26
- t.datetime "updated_at", :null => false
27
- end
28
-
29
- add_index "agreement_item_types", ["parent_id"], :name => "index_agreement_item_types_on_parent_id"
30
-
31
- create_table "agreement_items", :force => true do |t|
32
- t.integer "agreement_id"
33
- t.integer "agreement_item_type_id"
34
- t.string "agreement_item_value"
35
- t.string "description"
36
- t.string "agreement_item_rule_string"
37
- t.datetime "created_at", :null => false
38
- t.datetime "updated_at", :null => false
39
- end
40
-
41
- add_index "agreement_items", ["agreement_id"], :name => "index_agreement_items_on_agreement_id"
42
- add_index "agreement_items", ["agreement_item_type_id"], :name => "index_agreement_items_on_agreement_item_type_id"
43
-
44
- create_table "agreement_party_roles", :force => true do |t|
45
- t.string "description"
46
- t.integer "agreement_id"
47
- t.integer "party_id"
48
- t.integer "role_type_id"
49
- t.string "external_identifier"
50
- t.string "external_id_source"
51
- t.datetime "created_at", :null => false
52
- t.datetime "updated_at", :null => false
53
- end
54
-
55
- add_index "agreement_party_roles", ["agreement_id"], :name => "index_agreement_party_roles_on_agreement_id"
56
- add_index "agreement_party_roles", ["party_id"], :name => "index_agreement_party_roles_on_party_id"
57
- add_index "agreement_party_roles", ["role_type_id"], :name => "index_agreement_party_roles_on_role_type_id"
58
-
59
- create_table "agreement_relationships", :force => true do |t|
60
- t.integer "agreement_reln_type_id"
61
- t.string "description"
62
- t.integer "agreement_id_from"
63
- t.integer "agreement_id_to"
64
- t.integer "role_type_id_from"
65
- t.integer "role_type_id_to"
66
- t.integer "status_type_id"
67
- t.date "from_date"
68
- t.date "thru_date"
69
- t.datetime "created_at", :null => false
70
- t.datetime "updated_at", :null => false
71
- end
72
-
73
- add_index "agreement_relationships", ["agreement_reln_type_id"], :name => "index_agreement_relationships_on_agreement_reln_type_id"
74
- add_index "agreement_relationships", ["status_type_id"], :name => "index_agreement_relationships_on_status_type_id"
75
-
76
- create_table "agreement_reln_types", :force => true do |t|
77
- t.integer "parent_id"
78
- t.integer "lft"
79
- t.integer "rgt"
80
- t.integer "valid_from_role_type_id"
81
- t.integer "valid_to_role_type_id"
82
- t.string "name"
83
- t.string "description"
84
- t.string "internal_identifier"
85
- t.string "external_identifier"
86
- t.string "external_id_source"
87
- t.datetime "created_at", :null => false
88
- t.datetime "updated_at", :null => false
89
- end
90
-
91
- add_index "agreement_reln_types", ["parent_id"], :name => "index_agreement_reln_types_on_parent_id"
92
- add_index "agreement_reln_types", ["valid_from_role_type_id"], :name => "index_agreement_reln_types_on_valid_from_role_type_id"
93
- add_index "agreement_reln_types", ["valid_to_role_type_id"], :name => "index_agreement_reln_types_on_valid_to_role_type_id"
94
-
95
- create_table "agreement_role_types", :force => true do |t|
96
- t.integer "parent_id"
97
- t.integer "lft"
98
- t.integer "rgt"
99
- t.string "description"
100
- t.string "comments"
101
- t.string "internal_identifier"
102
- t.string "external_identifier"
103
- t.string "external_id_source"
104
- t.datetime "created_at", :null => false
105
- t.datetime "updated_at", :null => false
106
- end
107
-
108
- add_index "agreement_role_types", ["parent_id"], :name => "index_agreement_role_types_on_parent_id"
109
-
110
- create_table "agreement_types", :force => true do |t|
111
- t.integer "parent_id"
112
- t.integer "lft"
113
- t.integer "rgt"
114
- t.string "description"
115
- t.string "comments"
116
- t.string "internal_identifier"
117
- t.string "external_identifier"
118
- t.string "external_id_source"
119
- t.datetime "created_at", :null => false
120
- t.datetime "updated_at", :null => false
121
- end
122
-
123
- add_index "agreement_types", ["parent_id"], :name => "index_agreement_types_on_parent_id"
124
-
125
- create_table "agreements", :force => true do |t|
126
- t.string "description"
127
- t.integer "agreement_type_id"
128
- t.string "agreement_status"
129
- t.integer "product_id"
130
- t.date "agreement_date"
131
- t.date "from_date"
132
- t.date "thru_date"
133
- t.string "external_identifier"
134
- t.string "external_id_source"
135
- t.datetime "created_at", :null => false
136
- t.datetime "updated_at", :null => false
137
- end
138
-
139
- add_index "agreements", ["agreement_type_id"], :name => "index_agreements_on_agreement_type_id"
140
- add_index "agreements", ["product_id"], :name => "index_agreements_on_product_id"
141
-
142
- create_table "app_containers", :force => true do |t|
143
- t.integer "user_id"
144
- t.string "description"
145
- t.string "internal_identifier"
146
- t.string "type"
147
- t.datetime "created_at", :null => false
148
- t.datetime "updated_at", :null => false
149
- end
150
-
151
- add_index "app_containers", ["type"], :name => "index_app_containers_on_type"
152
- add_index "app_containers", ["user_id"], :name => "index_app_containers_on_user_id"
153
-
154
- create_table "app_containers_applications", :id => false, :force => true do |t|
155
- t.integer "app_container_id"
156
- t.integer "application_id"
157
- end
158
-
159
- add_index "app_containers_applications", ["app_container_id"], :name => "index_app_containers_applications_on_app_container_id"
160
- add_index "app_containers_applications", ["application_id"], :name => "index_app_containers_applications_on_application_id"
161
-
162
- create_table "applications", :force => true do |t|
163
- t.string "description"
164
- t.string "icon"
165
- t.string "internal_identifier"
166
- t.string "javascript_class_name"
167
- t.string "shortcut_id"
168
- t.string "base_url"
169
- t.string "type"
170
- t.datetime "created_at", :null => false
171
- t.datetime "updated_at", :null => false
172
- end
173
-
174
- create_table "applications_widgets", :id => false, :force => true do |t|
175
- t.integer "application_id"
176
- t.integer "widget_id"
177
- end
178
-
179
- add_index "applications_widgets", ["application_id"], :name => "index_applications_widgets_on_application_id"
180
- add_index "applications_widgets", ["widget_id"], :name => "index_applications_widgets_on_widget_id"
181
-
182
- create_table "attribute_types", :force => true do |t|
183
- t.string "internal_identifier"
184
- t.string "description"
185
- t.string "data_type"
186
- t.datetime "created_at", :null => false
187
- t.datetime "updated_at", :null => false
188
- end
189
-
190
- add_index "attribute_types", ["internal_identifier"], :name => ":attribute_types_iid_idx"
191
-
192
- create_table "attribute_values", :force => true do |t|
193
- t.integer "attributed_record_id"
194
- t.string "attributed_record_type"
195
- t.integer "attribute_type_id"
196
- t.string "value"
197
- t.datetime "created_at", :null => false
198
- t.datetime "updated_at", :null => false
199
- end
200
-
201
- add_index "attribute_values", ["attribute_type_id"], :name => "attribute_values_attributed_type_idx"
202
- add_index "attribute_values", ["attributed_record_id", "attributed_record_type"], :name => "attribute_values_attributed_record_idx"
203
- add_index "attribute_values", ["value"], :name => "attribute_values_value_idx"
204
-
205
- create_table "audit_log_item_types", :force => true do |t|
206
- t.string "internal_identifier"
207
- t.string "external_identifier"
208
- t.string "external_id_source"
209
- t.string "description"
210
- t.string "comments"
211
- t.integer "parent_id"
212
- t.integer "lft"
213
- t.integer "rgt"
214
- t.datetime "created_at", :null => false
215
- t.datetime "updated_at", :null => false
216
- end
217
-
218
- create_table "audit_log_items", :force => true do |t|
219
- t.integer "audit_log_id"
220
- t.integer "audit_log_item_type_id"
221
- t.string "audit_log_item_value"
222
- t.string "description"
223
- t.datetime "created_at", :null => false
224
- t.datetime "updated_at", :null => false
225
- end
226
-
227
- create_table "audit_log_types", :force => true do |t|
228
- t.string "description"
229
- t.string "error_code"
230
- t.string "comments"
231
- t.string "internal_identifier"
232
- t.string "external_identifier"
233
- t.string "external_id_source"
234
- t.integer "parent_id"
235
- t.integer "lft"
236
- t.integer "rgt"
237
- t.datetime "created_at", :null => false
238
- t.datetime "updated_at", :null => false
239
- end
240
-
241
- create_table "audit_logs", :force => true do |t|
242
- t.string "application"
243
- t.string "description"
244
- t.integer "party_id"
245
- t.text "additional_info"
246
- t.integer "audit_log_type_id"
247
- t.integer "event_record_id"
248
- t.string "event_record_type"
249
- t.datetime "created_at", :null => false
250
- t.datetime "updated_at", :null => false
251
- end
252
-
253
- add_index "audit_logs", ["event_record_id", "event_record_type"], :name => "event_record_index"
254
- add_index "audit_logs", ["party_id"], :name => "index_audit_logs_on_party_id"
255
-
256
- create_table "base_txn_contexts", :force => true do |t|
257
- t.integer "biz_txn_event_id"
258
- t.integer "txn_context_record_id"
259
- t.string "txn_context_record_type"
260
- t.datetime "created_at", :null => false
261
- t.datetime "updated_at", :null => false
262
- end
263
-
264
- add_index "base_txn_contexts", ["txn_context_record_id", "txn_context_record_type"], :name => "txn_context_record_idx"
265
-
266
- create_table "biz_acct_txn_tasks", :force => true do |t|
267
- t.integer "biz_txn_task_id"
268
- t.integer "biz_txn_account_id"
269
- t.string "description"
270
- t.string "comments"
271
- t.datetime "entered_date"
272
- t.datetime "requested_date"
273
- t.datetime "created_at", :null => false
274
- t.datetime "updated_at", :null => false
275
- end
276
-
277
- add_index "biz_acct_txn_tasks", ["biz_txn_account_id"], :name => "index_biz_acct_txn_tasks_on_biz_txn_account_id"
278
- add_index "biz_acct_txn_tasks", ["biz_txn_task_id"], :name => "index_biz_acct_txn_tasks_on_biz_txn_task_id"
279
-
280
- create_table "biz_txn_acct_party_roles", :force => true do |t|
281
- t.string "description"
282
- t.integer "biz_txn_acct_root_id"
283
- t.integer "party_id"
284
- t.integer "biz_txn_acct_pty_rtype_id"
285
- t.integer "is_default_billing_acct_flag"
286
- t.datetime "created_at", :null => false
287
- t.datetime "updated_at", :null => false
288
- end
289
-
290
- add_index "biz_txn_acct_party_roles", ["biz_txn_acct_pty_rtype_id"], :name => "index_biz_txn_acct_party_roles_on_biz_txn_acct_pty_rtype_id"
291
- add_index "biz_txn_acct_party_roles", ["biz_txn_acct_root_id"], :name => "index_biz_txn_acct_party_roles_on_biz_txn_acct_root_id"
292
- add_index "biz_txn_acct_party_roles", ["party_id"], :name => "index_biz_txn_acct_party_roles_on_party_id"
293
-
294
- create_table "biz_txn_acct_pty_rtypes", :force => true do |t|
295
- t.integer "parent_id"
296
- t.integer "lft"
297
- t.integer "rgt"
298
- t.string "description"
299
- t.string "comments"
300
- t.string "internal_identifier"
301
- t.string "external_identifier"
302
- t.string "external_id_source"
303
- t.datetime "created_at", :null => false
304
- t.datetime "updated_at", :null => false
305
- end
306
-
307
- add_index "biz_txn_acct_pty_rtypes", ["parent_id"], :name => "index_biz_txn_acct_pty_rtypes_on_parent_id"
308
-
309
- create_table "biz_txn_acct_rel_types", :force => true do |t|
310
- t.integer "parent_id"
311
- t.integer "lft"
312
- t.integer "rgt"
313
- t.string "description"
314
- t.string "comments"
315
- t.string "internal_identifier"
316
- t.string "external_identifier"
317
- t.string "external_id_source"
318
- t.datetime "created_at", :null => false
319
- t.datetime "updated_at", :null => false
320
- end
321
-
322
- add_index "biz_txn_acct_rel_types", ["parent_id"], :name => "index_biz_txn_acct_rel_types_on_parent_id"
323
-
324
- create_table "biz_txn_acct_relationships", :force => true do |t|
325
- t.integer "biz_txn_acct_rel_type_id"
326
- t.string "description"
327
- t.integer "biz_txn_acct_root_id_from"
328
- t.integer "biz_txn_acct_root_id_to"
329
- t.integer "status_type_id"
330
- t.date "from_date"
331
- t.date "thru_date"
332
- t.datetime "created_at", :null => false
333
- t.datetime "updated_at", :null => false
334
- end
335
-
336
- add_index "biz_txn_acct_relationships", ["biz_txn_acct_rel_type_id"], :name => "index_biz_txn_acct_relationships_on_biz_txn_acct_rel_type_id"
337
- add_index "biz_txn_acct_relationships", ["status_type_id"], :name => "index_biz_txn_acct_relationships_on_status_type_id"
338
-
339
- create_table "biz_txn_acct_roots", :force => true do |t|
340
- t.string "description"
341
- t.integer "status"
342
- t.integer "biz_txn_acct_id"
343
- t.string "biz_txn_acct_type"
344
- t.string "external_identifier"
345
- t.string "external_id_source"
346
- t.string "type"
347
- t.datetime "created_at", :null => false
348
- t.datetime "updated_at", :null => false
349
- end
350
-
351
- add_index "biz_txn_acct_roots", ["biz_txn_acct_id", "biz_txn_acct_type"], :name => "btai_2"
352
-
353
- create_table "biz_txn_acct_status_types", :force => true do |t|
354
- t.datetime "created_at", :null => false
355
- t.datetime "updated_at", :null => false
356
- end
357
-
358
- create_table "biz_txn_acct_statuses", :force => true do |t|
359
- t.datetime "created_at", :null => false
360
- t.datetime "updated_at", :null => false
361
- end
362
-
363
- create_table "biz_txn_acct_types", :force => true do |t|
364
- t.integer "parent_id"
365
- t.integer "lft"
366
- t.integer "rgt"
367
- t.string "description"
368
- t.string "comments"
369
- t.string "internal_identifier"
370
- t.string "external_identifier"
371
- t.string "external_id_source"
372
- t.datetime "created_at", :null => false
373
- t.datetime "updated_at", :null => false
374
- end
375
-
376
- add_index "biz_txn_acct_types", ["parent_id"], :name => "index_biz_txn_acct_types_on_parent_id"
377
-
378
- create_table "biz_txn_agreement_role_types", :force => true do |t|
379
- t.integer "parent_id"
380
- t.integer "lft"
381
- t.integer "rgt"
382
- t.string "description"
383
- t.string "comments"
384
- t.string "internal_identifier"
385
- t.datetime "created_at", :null => false
386
- t.datetime "updated_at", :null => false
387
- end
388
-
389
- add_index "biz_txn_agreement_role_types", ["parent_id"], :name => "index_biz_txn_agreement_role_types_on_parent_id"
390
-
391
- create_table "biz_txn_agreement_roles", :force => true do |t|
392
- t.integer "biz_txn_event_id"
393
- t.string "biz_txn_event_type"
394
- t.integer "agreement_id"
395
- t.integer "biz_txn_agreement_role_type_id"
396
- t.datetime "created_at", :null => false
397
- t.datetime "updated_at", :null => false
398
- end
399
-
400
- add_index "biz_txn_agreement_roles", ["agreement_id"], :name => "index_biz_txn_agreement_roles_on_agreement_id"
401
- add_index "biz_txn_agreement_roles", ["biz_txn_agreement_role_type_id"], :name => "index_biz_txn_agreement_roles_on_biz_txn_agreement_role_type_id"
402
-
403
- create_table "biz_txn_event_descs", :force => true do |t|
404
- t.integer "biz_txn_event_id"
405
- t.integer "language_id"
406
- t.integer "locale_id"
407
- t.integer "priority"
408
- t.integer "sequence"
409
- t.string "short_description"
410
- t.string "long_description"
411
- t.datetime "created_at", :null => false
412
- t.datetime "updated_at", :null => false
413
- end
414
-
415
- add_index "biz_txn_event_descs", ["biz_txn_event_id"], :name => "index_biz_txn_event_descs_on_biz_txn_event_id"
416
- add_index "biz_txn_event_descs", ["language_id"], :name => "index_biz_txn_event_descs_on_language_id"
417
- add_index "biz_txn_event_descs", ["locale_id"], :name => "index_biz_txn_event_descs_on_locale_id"
418
-
419
- create_table "biz_txn_events", :force => true do |t|
420
- t.string "description"
421
- t.integer "biz_txn_acct_root_id"
422
- t.integer "biz_txn_type_id"
423
- t.datetime "entered_date"
424
- t.datetime "post_date"
425
- t.integer "biz_txn_record_id"
426
- t.string "biz_txn_record_type"
427
- t.string "external_identifier"
428
- t.string "external_id_source"
429
- t.datetime "created_at", :null => false
430
- t.datetime "updated_at", :null => false
431
- end
432
-
433
- add_index "biz_txn_events", ["biz_txn_acct_root_id"], :name => "index_biz_txn_events_on_biz_txn_acct_root_id"
434
- add_index "biz_txn_events", ["biz_txn_record_id", "biz_txn_record_type"], :name => "btai_1"
435
- add_index "biz_txn_events", ["biz_txn_type_id"], :name => "index_biz_txn_events_on_biz_txn_type_id"
436
-
437
- create_table "biz_txn_party_role_types", :force => true do |t|
438
- t.integer "parent_id"
439
- t.integer "lft"
440
- t.integer "rgt"
441
- t.string "description"
442
- t.string "comments"
443
- t.string "internal_identifier"
444
- t.datetime "created_at", :null => false
445
- t.datetime "updated_at", :null => false
446
- end
447
-
448
- add_index "biz_txn_party_role_types", ["parent_id"], :name => "index_biz_txn_party_role_types_on_parent_id"
449
-
450
- create_table "biz_txn_party_roles", :force => true do |t|
451
- t.integer "biz_txn_event_id"
452
- t.integer "party_id"
453
- t.integer "biz_txn_party_role_type_id"
454
- t.datetime "created_at", :null => false
455
- t.datetime "updated_at", :null => false
456
- end
457
-
458
- add_index "biz_txn_party_roles", ["biz_txn_event_id"], :name => "index_biz_txn_party_roles_on_biz_txn_event_id"
459
- add_index "biz_txn_party_roles", ["biz_txn_party_role_type_id"], :name => "index_biz_txn_party_roles_on_biz_txn_party_role_type_id"
460
- add_index "biz_txn_party_roles", ["party_id"], :name => "index_biz_txn_party_roles_on_party_id"
461
-
462
- create_table "biz_txn_rel_types", :force => true do |t|
463
- t.integer "parent_id"
464
- t.integer "lft"
465
- t.integer "rgt"
466
- t.string "description"
467
- t.string "comments"
468
- t.string "internal_identifier"
469
- t.string "external_identifier"
470
- t.string "external_id_source"
471
- t.datetime "created_at", :null => false
472
- t.datetime "updated_at", :null => false
473
- end
474
-
475
- add_index "biz_txn_rel_types", ["parent_id"], :name => "index_biz_txn_rel_types_on_parent_id"
476
-
477
- create_table "biz_txn_relationships", :force => true do |t|
478
- t.integer "biz_txn_rel_type_id"
479
- t.string "description"
480
- t.integer "txn_event_id_from"
481
- t.integer "txn_event_id_to"
482
- t.integer "status_type_id"
483
- t.date "from_date"
484
- t.date "thru_date"
485
- t.datetime "created_at", :null => false
486
- t.datetime "updated_at", :null => false
487
- end
488
-
489
- add_index "biz_txn_relationships", ["biz_txn_rel_type_id"], :name => "index_biz_txn_relationships_on_biz_txn_rel_type_id"
490
- add_index "biz_txn_relationships", ["status_type_id"], :name => "index_biz_txn_relationships_on_status_type_id"
491
-
492
- create_table "biz_txn_statuses", :force => true do |t|
493
- t.string "description"
494
- t.string "comments"
495
- t.datetime "created_at", :null => false
496
- t.datetime "updated_at", :null => false
497
- end
498
-
499
- create_table "biz_txn_task_types", :force => true do |t|
500
- t.integer "parent_id"
501
- t.integer "lft"
502
- t.integer "rgt"
503
- t.string "description"
504
- t.string "comments"
505
- t.datetime "created_at", :null => false
506
- t.datetime "updated_at", :null => false
507
- end
508
-
509
- add_index "biz_txn_task_types", ["parent_id"], :name => "index_biz_txn_task_types_on_parent_id"
510
-
511
- create_table "biz_txn_tasks", :force => true do |t|
512
- t.string "description"
513
- t.datetime "created_at", :null => false
514
- t.datetime "updated_at", :null => false
515
- end
516
-
517
- create_table "biz_txn_types", :force => true do |t|
518
- t.integer "parent_id"
519
- t.integer "lft"
520
- t.integer "rgt"
521
- t.string "description"
522
- t.string "comments"
523
- t.string "internal_identifier"
524
- t.string "external_identifier"
525
- t.string "external_id_source"
526
- t.datetime "created_at", :null => false
527
- t.datetime "updated_at", :null => false
528
- end
529
-
530
- add_index "biz_txn_types", ["parent_id", "lft", "rgt"], :name => "biz_txn_type_nested_set_idx"
531
-
532
- create_table "capabilities", :force => true do |t|
533
- t.string "resource"
534
- t.integer "capability_type_id"
535
- t.datetime "created_at", :null => false
536
- t.datetime "updated_at", :null => false
537
- end
538
-
539
- add_index "capabilities", ["capability_type_id"], :name => "index_capabilities_on_capability_type_id"
540
-
541
- create_table "capabilities_capable_models", :id => false, :force => true do |t|
542
- t.integer "capable_model_id"
543
- t.integer "capability_id"
544
- end
545
-
546
- add_index "capabilities_capable_models", ["capability_id"], :name => "index_capabilities_capable_models_on_capability_id"
547
- add_index "capabilities_capable_models", ["capable_model_id"], :name => "index_capabilities_capable_models_on_capable_model_id"
548
-
549
- create_table "capability_types", :force => true do |t|
550
- t.string "internal_identifier"
551
- t.string "description"
552
- t.datetime "created_at", :null => false
553
- t.datetime "updated_at", :null => false
554
- end
555
-
556
- create_table "capable_models", :force => true do |t|
557
- t.integer "capable_model_record_id"
558
- t.string "capable_model_record_type"
559
- t.datetime "created_at", :null => false
560
- t.datetime "updated_at", :null => false
561
- end
562
-
563
- add_index "capable_models", ["capable_model_record_id", "capable_model_record_type"], :name => "capable_model_record_idx"
564
-
565
- create_table "categories", :force => true do |t|
566
- t.string "description"
567
- t.string "external_identifier"
568
- t.datetime "from_date"
569
- t.datetime "to_date"
570
- t.string "internal_identifier"
571
- t.integer "category_record_id"
572
- t.string "category_record_type"
573
- t.integer "parent_id"
574
- t.integer "lft"
575
- t.integer "rgt"
576
- t.datetime "created_at", :null => false
577
- t.datetime "updated_at", :null => false
578
- end
579
-
580
- add_index "categories", ["category_record_id", "category_record_type"], :name => "category_polymorphic"
581
-
582
- create_table "category_classifications", :force => true do |t|
583
- t.integer "category_id"
584
- t.string "classification_type"
585
- t.integer "classification_id"
586
- t.datetime "from_date"
587
- t.datetime "to_date"
588
- t.datetime "created_at", :null => false
589
- t.datetime "updated_at", :null => false
590
- end
591
-
592
- add_index "category_classifications", ["classification_id", "classification_type"], :name => "classification_polymorphic"
593
-
594
- create_table "compass_ae_instances", :force => true do |t|
595
- t.decimal "version", :precision => 3, :scale => 8
596
- t.datetime "created_at", :null => false
597
- t.datetime "updated_at", :null => false
598
- end
599
-
600
- create_table "configuration_item_types", :force => true do |t|
601
- t.integer "parent_id"
602
- t.integer "lft"
603
- t.integer "rgt"
604
- t.string "description"
605
- t.string "internal_identifier"
606
- t.boolean "allow_user_defined_options", :default => false
607
- t.boolean "is_multi_optional", :default => false
608
- t.datetime "created_at", :null => false
609
- t.datetime "updated_at", :null => false
610
- end
611
-
612
- create_table "configuration_item_types_configuration_options", :force => true do |t|
613
- t.integer "configuration_item_type_id"
614
- t.integer "configuration_option_id"
615
- t.boolean "is_default", :default => false
616
- t.datetime "created_at", :null => false
617
- t.datetime "updated_at", :null => false
618
- end
619
-
620
- add_index "configuration_item_types_configuration_options", ["configuration_item_type_id"], :name => "conf_item_type_conf_opt_id_item_idx"
621
- add_index "configuration_item_types_configuration_options", ["configuration_option_id"], :name => "conf_item_type_conf_opt_id_opt_idx"
622
-
623
- create_table "configuration_item_types_configurations", :id => false, :force => true do |t|
624
- t.integer "configuration_item_type_id"
625
- t.integer "configuration_id"
626
- end
627
-
628
- add_index "configuration_item_types_configurations", ["configuration_id"], :name => "conf_id_idx"
629
- add_index "configuration_item_types_configurations", ["configuration_item_type_id", "configuration_id"], :name => "conf_config_type_uniq_idx", :unique => true
630
- add_index "configuration_item_types_configurations", ["configuration_item_type_id"], :name => "conf_conf_type_id_item_idx"
631
-
632
- create_table "configuration_items", :force => true do |t|
633
- t.integer "configuration_id"
634
- t.integer "configuration_item_type_id"
635
- t.integer "configuration_option_id"
636
- t.datetime "created_at", :null => false
637
- t.datetime "updated_at", :null => false
638
- end
639
-
640
- add_index "configuration_items", ["configuration_id"], :name => "index_configuration_items_on_configuration_id"
641
- add_index "configuration_items", ["configuration_item_type_id"], :name => "index_configuration_items_on_configuration_item_type_id"
642
- add_index "configuration_items", ["configuration_option_id"], :name => "index_configuration_items_on_configuration_option_id"
643
-
644
- create_table "configuration_items_configuration_options", :id => false, :force => true do |t|
645
- t.integer "configuration_item_id"
646
- t.integer "configuration_option_id"
647
- end
648
-
649
- add_index "configuration_items_configuration_options", ["configuration_item_id"], :name => "conf_item_conf_opt_id_item_idx"
650
- add_index "configuration_items_configuration_options", ["configuration_option_id"], :name => "conf_item_conf_opt_id_opt_idx"
651
-
652
- create_table "configuration_options", :force => true do |t|
653
- t.string "description"
654
- t.string "internal_identifier"
655
- t.string "value"
656
- t.text "comment"
657
- t.boolean "user_defined", :default => false
658
- t.datetime "created_at", :null => false
659
- t.datetime "updated_at", :null => false
660
- end
661
-
662
- add_index "configuration_options", ["internal_identifier"], :name => "index_configuration_options_on_internal_identifier"
663
- add_index "configuration_options", ["user_defined"], :name => "index_configuration_options_on_user_defined"
664
- add_index "configuration_options", ["value"], :name => "index_configuration_options_on_value"
665
-
666
- create_table "configurations", :force => true do |t|
667
- t.string "description"
668
- t.string "internal_identifier"
669
- t.boolean "active"
670
- t.boolean "is_template", :default => false
671
- t.datetime "created_at", :null => false
672
- t.datetime "updated_at", :null => false
673
- end
674
-
675
- add_index "configurations", ["is_template"], :name => "index_configurations_on_is_template"
676
-
677
- create_table "contact_purposes", :force => true do |t|
678
- t.integer "parent_id"
679
- t.integer "lft"
680
- t.integer "rgt"
681
- t.string "description"
682
- t.string "comments"
683
- t.string "internal_identifier"
684
- t.string "external_identifier"
685
- t.string "external_id_source"
686
- t.datetime "created_at", :null => false
687
- t.datetime "updated_at", :null => false
688
- end
689
-
690
- add_index "contact_purposes", ["parent_id"], :name => "index_contact_purposes_on_parent_id"
691
-
692
- create_table "contact_purposes_contacts", :id => false, :force => true do |t|
693
- t.integer "contact_id"
694
- t.integer "contact_purpose_id"
695
- end
696
-
697
- add_index "contact_purposes_contacts", ["contact_id", "contact_purpose_id"], :name => "contact_purposes_contacts_index"
698
-
699
- create_table "contact_types", :force => true do |t|
700
- t.integer "parent_id"
701
- t.integer "lft"
702
- t.integer "rgt"
703
- t.string "description"
704
- t.string "comments"
705
- t.string "internal_identifier"
706
- t.string "external_identifier"
707
- t.string "external_id_source"
708
- t.datetime "created_at", :null => false
709
- t.datetime "updated_at", :null => false
710
- end
711
-
712
- add_index "contact_types", ["parent_id"], :name => "index_contact_types_on_parent_id"
713
-
714
- create_table "contacts", :force => true do |t|
715
- t.integer "party_id"
716
- t.integer "contact_mechanism_id"
717
- t.string "contact_mechanism_type"
718
- t.string "external_identifier"
719
- t.string "external_id_source"
720
- t.datetime "created_at", :null => false
721
- t.datetime "updated_at", :null => false
722
- end
723
-
724
- add_index "contacts", ["contact_mechanism_id", "contact_mechanism_type"], :name => "besi_2"
725
- add_index "contacts", ["party_id"], :name => "index_contacts_on_party_id"
726
-
727
- create_table "currencies", :force => true do |t|
728
- t.string "name"
729
- t.string "definition"
730
- t.string "internal_identifier"
731
- t.string "numeric_code"
732
- t.string "major_unit_symbol"
733
- t.string "minor_unit_symbol"
734
- t.string "ratio_of_minor_unit_to_major_unit"
735
- t.string "postfix_label"
736
- t.datetime "introduction_date"
737
- t.datetime "expiration_date"
738
- t.datetime "created_at", :null => false
739
- t.datetime "updated_at", :null => false
740
- end
741
-
742
- add_index "currencies", ["internal_identifier"], :name => "index_currencies_on_internal_identifier"
743
-
744
- create_table "delayed_jobs", :force => true do |t|
745
- t.integer "priority", :default => 0
746
- t.integer "attempts", :default => 0
747
- t.text "handler"
748
- t.text "last_error"
749
- t.datetime "run_at"
750
- t.datetime "locked_at"
751
- t.datetime "failed_at"
752
- t.string "locked_by"
753
- t.string "queue"
754
- t.datetime "created_at", :null => false
755
- t.datetime "updated_at", :null => false
756
- end
757
-
758
- add_index "delayed_jobs", ["priority", "run_at"], :name => "delayed_jobs_priority"
759
-
760
- create_table "descriptive_assets", :force => true do |t|
761
- t.integer "view_type_id"
762
- t.string "internal_identifier"
763
- t.text "description"
764
- t.string "external_identifier"
765
- t.string "external_id_source"
766
- t.integer "described_record_id"
767
- t.string "described_record_type"
768
- t.datetime "created_at", :null => false
769
- t.datetime "updated_at", :null => false
770
- end
771
-
772
- add_index "descriptive_assets", ["described_record_id", "described_record_type"], :name => "described_record_idx"
773
- add_index "descriptive_assets", ["view_type_id"], :name => "index_descriptive_assets_on_view_type_id"
774
-
775
- create_table "email_addresses", :force => true do |t|
776
- t.string "email_address"
777
- t.string "description"
778
- t.datetime "created_at", :null => false
779
- t.datetime "updated_at", :null => false
780
- end
781
-
782
- create_table "file_assets", :force => true do |t|
783
- t.integer "file_asset_holder_id"
784
- t.string "file_asset_holder_type"
785
- t.string "type"
786
- t.string "name"
787
- t.string "directory"
788
- t.string "data_file_name"
789
- t.string "data_content_type"
790
- t.integer "data_file_size"
791
- t.datetime "data_updated_at"
792
- t.string "width"
793
- t.string "height"
794
- t.datetime "created_at", :null => false
795
- t.datetime "updated_at", :null => false
796
- end
797
-
798
- add_index "file_assets", ["directory"], :name => "index_file_assets_on_directory"
799
- add_index "file_assets", ["file_asset_holder_id", "file_asset_holder_type"], :name => "file_asset_holder_idx"
800
- add_index "file_assets", ["name"], :name => "index_file_assets_on_name"
801
- add_index "file_assets", ["type"], :name => "index_file_assets_on_type"
802
-
803
- create_table "financial_txn_accounts", :force => true do |t|
804
- t.string "account_number"
805
- t.integer "agreement_id"
806
- t.integer "balance_id"
807
- t.date "balance_date"
808
- t.boolean "calculate_balance"
809
- t.integer "payment_due_id"
810
- t.date "due_date"
811
- t.integer "financial_account_id"
812
- t.string "financial_account_type"
813
- t.datetime "created_at", :null => false
814
- t.datetime "updated_at", :null => false
815
- end
816
-
817
- create_table "financial_txn_assns", :force => true do |t|
818
- t.integer "financial_txn_id"
819
- t.integer "financial_txn_record_id"
820
- t.string "financial_txn_record_type"
821
- t.datetime "created_at", :null => false
822
- t.datetime "updated_at", :null => false
823
- end
824
-
825
- create_table "financial_txns", :force => true do |t|
826
- t.integer "money_id"
827
- t.date "apply_date"
828
- t.datetime "created_at", :null => false
829
- t.datetime "updated_at", :null => false
830
- end
831
-
832
- create_table "geo_countries", :force => true do |t|
833
- t.string "name"
834
- t.string "iso_code_2"
835
- t.string "iso_code_3"
836
- t.boolean "display", :default => true
837
- t.integer "external_id"
838
- t.datetime "created_at"
839
- end
840
-
841
- add_index "geo_countries", ["iso_code_2"], :name => "index_geo_countries_on_iso_code_2"
842
- add_index "geo_countries", ["name"], :name => "index_geo_countries_on_name"
843
-
844
- create_table "geo_zones", :force => true do |t|
845
- t.integer "geo_country_id"
846
- t.string "zone_code", :default => "2"
847
- t.string "zone_name"
848
- t.datetime "created_at"
849
- end
850
-
851
- add_index "geo_zones", ["geo_country_id"], :name => "index_geo_zones_on_geo_country_id"
852
- add_index "geo_zones", ["zone_code"], :name => "index_geo_zones_on_zone_code"
853
- add_index "geo_zones", ["zone_name"], :name => "index_geo_zones_on_zone_name"
854
-
855
- create_table "individuals", :force => true do |t|
856
- t.integer "party_id"
857
- t.string "current_last_name"
858
- t.string "current_first_name"
859
- t.string "current_middle_name"
860
- t.string "current_personal_title"
861
- t.string "current_suffix"
862
- t.string "current_nickname"
863
- t.string "gender", :limit => 1
864
- t.date "birth_date"
865
- t.decimal "height", :precision => 5, :scale => 2
866
- t.integer "weight"
867
- t.string "mothers_maiden_name"
868
- t.string "marital_status", :limit => 1
869
- t.string "social_security_number"
870
- t.integer "current_passport_number"
871
- t.date "current_passport_expire_date"
872
- t.integer "total_years_work_experience"
873
- t.string "comments"
874
- t.string "encrypted_ssn"
875
- t.string "temp_ssn"
876
- t.string "salt"
877
- t.string "ssn_last_four"
878
- t.datetime "created_at", :null => false
879
- t.datetime "updated_at", :null => false
880
- end
881
-
882
- add_index "individuals", ["party_id"], :name => "index_individuals_on_party_id"
883
-
884
- create_table "loyalty_program_codes", :force => true do |t|
885
- t.string "identifier"
886
- t.string "name"
887
- t.string "description"
888
- t.datetime "created_at", :null => false
889
- t.datetime "updated_at", :null => false
890
- end
891
-
892
- create_table "money", :force => true do |t|
893
- t.string "description"
894
- t.decimal "amount", :precision => 8, :scale => 2
895
- t.integer "currency_id"
896
- t.datetime "created_at", :null => false
897
- t.datetime "updated_at", :null => false
898
- end
899
-
900
- add_index "money", ["currency_id"], :name => "index_money_on_currency_id"
901
-
902
- create_table "note_types", :force => true do |t|
903
- t.integer "parent_id"
904
- t.integer "lft"
905
- t.integer "rgt"
906
- t.string "description"
907
- t.string "internal_identifier"
908
- t.string "external_identifier"
909
- t.integer "note_type_record_id"
910
- t.string "note_type_record_type"
911
- t.datetime "created_at", :null => false
912
- t.datetime "updated_at", :null => false
913
- end
914
-
915
- add_index "note_types", ["note_type_record_id", "note_type_record_type"], :name => "note_type_record_idx"
916
-
917
- create_table "notes", :force => true do |t|
918
- t.integer "created_by_id"
919
- t.text "content"
920
- t.integer "noted_record_id"
921
- t.string "noted_record_type"
922
- t.integer "note_type_id"
923
- t.datetime "created_at", :null => false
924
- t.datetime "updated_at", :null => false
925
- end
926
-
927
- add_index "notes", ["created_by_id"], :name => "index_notes_on_created_by_id"
928
- add_index "notes", ["note_type_id"], :name => "index_notes_on_note_type_id"
929
- add_index "notes", ["noted_record_id", "noted_record_type"], :name => "index_notes_on_noted_record_id_and_noted_record_type"
930
-
931
- create_table "organizations", :force => true do |t|
932
- t.string "description"
933
- t.string "tax_id_number"
934
- t.datetime "created_at", :null => false
935
- t.datetime "updated_at", :null => false
936
- end
937
-
938
- create_table "parties", :force => true do |t|
939
- t.string "description"
940
- t.integer "business_party_id"
941
- t.string "business_party_type"
942
- t.integer "list_view_image_id"
943
- t.string "enterprise_identifier"
944
- t.datetime "created_at", :null => false
945
- t.datetime "updated_at", :null => false
946
- end
947
-
948
- add_index "parties", ["business_party_id", "business_party_type"], :name => "besi_1"
949
-
950
- create_table "party_relationships", :force => true do |t|
951
- t.string "description"
952
- t.integer "party_id_from"
953
- t.integer "party_id_to"
954
- t.integer "role_type_id_from"
955
- t.integer "role_type_id_to"
956
- t.integer "status_type_id"
957
- t.integer "priority_type_id"
958
- t.integer "relationship_type_id"
959
- t.date "from_date"
960
- t.date "thru_date"
961
- t.string "external_identifier"
962
- t.string "external_id_source"
963
- t.datetime "created_at", :null => false
964
- t.datetime "updated_at", :null => false
965
- end
966
-
967
- add_index "party_relationships", ["priority_type_id"], :name => "index_party_relationships_on_priority_type_id"
968
- add_index "party_relationships", ["relationship_type_id"], :name => "index_party_relationships_on_relationship_type_id"
969
- add_index "party_relationships", ["status_type_id"], :name => "index_party_relationships_on_status_type_id"
970
-
971
- create_table "party_roles", :force => true do |t|
972
- t.string "type"
973
- t.integer "party_id"
974
- t.integer "role_type_id"
975
- t.datetime "created_at", :null => false
976
- t.datetime "updated_at", :null => false
977
- end
978
-
979
- add_index "party_roles", ["party_id"], :name => "index_party_roles_on_party_id"
980
- add_index "party_roles", ["role_type_id"], :name => "index_party_roles_on_role_type_id"
981
-
982
- create_table "party_search_facts", :force => true do |t|
983
- t.integer "party_id"
984
- t.string "eid"
985
- t.string "type"
986
- t.text "roles"
987
- t.string "party_description"
988
- t.string "party_business_party_type"
989
- t.string "user_login"
990
- t.string "individual_current_last_name"
991
- t.string "individual_current_first_name"
992
- t.string "individual_current_middle_name"
993
- t.string "individual_birth_date"
994
- t.string "individual_ssn"
995
- t.string "party_phone_number"
996
- t.string "party_email_address"
997
- t.string "party_address_1"
998
- t.string "party_address_2"
999
- t.string "party_primary_address_city"
1000
- t.string "party_primary_address_state"
1001
- t.string "party_primary_address_zip"
1002
- t.string "party_primary_address_country"
1003
- t.boolean "user_enabled"
1004
- t.string "user_type"
1005
- t.boolean "reindex"
1006
- t.datetime "created_at", :null => false
1007
- t.datetime "updated_at", :null => false
1008
- end
1009
-
1010
- create_table "phone_numbers", :force => true do |t|
1011
- t.string "phone_number"
1012
- t.string "description"
1013
- t.datetime "created_at", :null => false
1014
- t.datetime "updated_at", :null => false
1015
- end
1016
-
1017
- create_table "postal_addresses", :force => true do |t|
1018
- t.string "address_line_1"
1019
- t.string "address_line_2"
1020
- t.string "city"
1021
- t.string "state"
1022
- t.string "zip"
1023
- t.string "country"
1024
- t.string "description"
1025
- t.integer "geo_country_id"
1026
- t.integer "geo_zone_id"
1027
- t.datetime "created_at", :null => false
1028
- t.datetime "updated_at", :null => false
1029
- end
1030
-
1031
- add_index "postal_addresses", ["geo_country_id"], :name => "index_postal_addresses_on_geo_country_id"
1032
- add_index "postal_addresses", ["geo_zone_id"], :name => "index_postal_addresses_on_geo_zone_id"
1033
-
1034
- create_table "preference_options", :force => true do |t|
1035
- t.string "description"
1036
- t.string "internal_identifier"
1037
- t.string "value"
1038
- t.datetime "created_at", :null => false
1039
- t.datetime "updated_at", :null => false
1040
- end
1041
-
1042
- create_table "preference_options_preference_types", :id => false, :force => true do |t|
1043
- t.integer "preference_type_id"
1044
- t.integer "preference_option_id"
1045
- end
1046
-
1047
- add_index "preference_options_preference_types", ["preference_option_id"], :name => "pref_opt_pref_type_pref_opt_id_idx"
1048
- add_index "preference_options_preference_types", ["preference_type_id"], :name => "pref_opt_pref_type_pref_type_id_idx"
1049
-
1050
- create_table "preference_types", :force => true do |t|
1051
- t.string "description"
1052
- t.string "internal_identifier"
1053
- t.integer "default_pref_option_id"
1054
- t.datetime "created_at", :null => false
1055
- t.datetime "updated_at", :null => false
1056
- end
1057
-
1058
- add_index "preference_types", ["default_pref_option_id"], :name => "index_preference_types_on_default_pref_option_id"
1059
-
1060
- create_table "preferences", :force => true do |t|
1061
- t.integer "preference_option_id"
1062
- t.integer "preference_type_id"
1063
- t.datetime "created_at", :null => false
1064
- t.datetime "updated_at", :null => false
1065
- end
1066
-
1067
- add_index "preferences", ["preference_option_id"], :name => "index_preferences_on_preference_option_id"
1068
- add_index "preferences", ["preference_type_id"], :name => "index_preferences_on_preference_type_id"
1069
-
1070
- create_table "relationship_types", :force => true do |t|
1071
- t.integer "parent_id"
1072
- t.integer "lft"
1073
- t.integer "rgt"
1074
- t.integer "valid_from_role_type_id"
1075
- t.integer "valid_to_role_type_id"
1076
- t.string "name"
1077
- t.string "description"
1078
- t.string "internal_identifier"
1079
- t.string "external_identifier"
1080
- t.string "external_id_source"
1081
- t.datetime "created_at", :null => false
1082
- t.datetime "updated_at", :null => false
1083
- end
1084
-
1085
- add_index "relationship_types", ["valid_from_role_type_id"], :name => "index_relationship_types_on_valid_from_role_type_id"
1086
- add_index "relationship_types", ["valid_to_role_type_id"], :name => "index_relationship_types_on_valid_to_role_type_id"
1087
-
1088
- create_table "role_types", :force => true do |t|
1089
- t.integer "parent_id"
1090
- t.integer "lft"
1091
- t.integer "rgt"
1092
- t.string "description"
1093
- t.string "comments"
1094
- t.string "internal_identifier"
1095
- t.string "external_identifier"
1096
- t.string "external_id_source"
1097
- t.datetime "created_at", :null => false
1098
- t.datetime "updated_at", :null => false
1099
- end
1100
-
1101
- create_table "roles", :force => true do |t|
1102
- t.string "description"
1103
- t.string "internal_identifier"
1104
- t.string "external_identifier"
1105
- t.string "external_id_source"
1106
- t.datetime "created_at", :null => false
1107
- t.datetime "updated_at", :null => false
1108
- end
1109
-
1110
- create_table "roles_secured_models", :id => false, :force => true do |t|
1111
- t.integer "secured_model_id"
1112
- t.integer "role_id"
1113
- end
1114
-
1115
- add_index "roles_secured_models", ["role_id"], :name => "index_roles_secured_models_on_role_id"
1116
- add_index "roles_secured_models", ["secured_model_id"], :name => "index_roles_secured_models_on_secured_model_id"
1117
-
1118
- create_table "secured_models", :force => true do |t|
1119
- t.integer "secured_record_id"
1120
- t.string "secured_record_type"
1121
- t.datetime "created_at", :null => false
1122
- t.datetime "updated_at", :null => false
1123
- end
1124
-
1125
- add_index "secured_models", ["secured_record_id", "secured_record_type"], :name => "secured_record_idx"
1126
-
1127
- create_table "sessions", :force => true do |t|
1128
- t.string "session_id", :null => false
1129
- t.text "data"
1130
- t.datetime "created_at", :null => false
1131
- t.datetime "updated_at", :null => false
1132
- end
1133
-
1134
- add_index "sessions", ["session_id"], :name => "index_sessions_on_session_id"
1135
- add_index "sessions", ["updated_at"], :name => "index_sessions_on_updated_at"
1136
-
1137
- create_table "tree_menu_node_defs", :force => true do |t|
1138
- t.string "node_type"
1139
- t.integer "parent_id"
1140
- t.integer "lft"
1141
- t.integer "rgt"
1142
- t.string "menu_short_name"
1143
- t.string "menu_description"
1144
- t.string "text"
1145
- t.string "icon_url"
1146
- t.string "target_url"
1147
- t.string "resource_class"
1148
- t.datetime "created_at", :null => false
1149
- t.datetime "updated_at", :null => false
1150
- end
1151
-
1152
- add_index "tree_menu_node_defs", ["parent_id"], :name => "index_tree_menu_node_defs_on_parent_id"
1153
-
1154
- create_table "user_preferences", :force => true do |t|
1155
- t.integer "user_id"
1156
- t.integer "preference_id"
1157
- t.integer "preferenced_record_id"
1158
- t.string "preferenced_record_type"
1159
- t.datetime "created_at", :null => false
1160
- t.datetime "updated_at", :null => false
1161
- end
1162
-
1163
- add_index "user_preferences", ["preference_id"], :name => "index_user_preferences_on_preference_id"
1164
- add_index "user_preferences", ["preferenced_record_id"], :name => "index_user_preferences_on_preferenced_record_id"
1165
- add_index "user_preferences", ["preferenced_record_type"], :name => "index_user_preferences_on_preferenced_record_type"
1166
- add_index "user_preferences", ["user_id"], :name => "index_user_preferences_on_user_id"
1167
-
1168
- create_table "users", :force => true do |t|
1169
- t.string "username"
1170
- t.string "email"
1171
- t.integer "party_id"
1172
- t.string "type"
1173
- t.string "salt"
1174
- t.string "crypted_password"
1175
- t.datetime "last_login_at"
1176
- t.datetime "last_logout_at"
1177
- t.datetime "last_activity_at"
1178
- t.integer "failed_logins_count", :default => 0
1179
- t.datetime "lock_expires_at"
1180
- t.string "remember_me_token"
1181
- t.datetime "remember_me_token_expires_at"
1182
- t.string "reset_password_token"
1183
- t.datetime "reset_password_token_expires_at"
1184
- t.datetime "reset_password_email_sent_at"
1185
- t.string "activation_state"
1186
- t.string "activation_token"
1187
- t.datetime "activation_token_expires_at"
1188
- t.string "security_question_1"
1189
- t.string "security_answer_1"
1190
- t.string "security_question_2"
1191
- t.string "security_answer_2"
1192
- t.datetime "created_at", :null => false
1193
- t.datetime "updated_at", :null => false
1194
- end
1195
-
1196
- add_index "users", ["activation_token"], :name => "index_users_on_activation_token"
1197
- add_index "users", ["email"], :name => "index_users_on_email", :unique => true
1198
- add_index "users", ["last_logout_at", "last_activity_at"], :name => "activity_idx"
1199
- add_index "users", ["remember_me_token"], :name => "index_users_on_remember_me_token"
1200
- add_index "users", ["reset_password_token"], :name => "index_users_on_reset_password_token"
1201
- add_index "users", ["username"], :name => "index_users_on_username", :unique => true
1202
-
1203
- create_table "valid_configurations", :force => true do |t|
1204
- t.integer "configured_item_id"
1205
- t.string "configured_item_type"
1206
- t.integer "configuration_id"
1207
- t.datetime "created_at", :null => false
1208
- t.datetime "updated_at", :null => false
1209
- end
1210
-
1211
- add_index "valid_configurations", ["configuration_id"], :name => "index_valid_configurations_on_configuration_id"
1212
- add_index "valid_configurations", ["configured_item_id", "configured_item_type"], :name => "configured_item_poly_idx"
1213
-
1214
- create_table "valid_note_types", :force => true do |t|
1215
- t.integer "valid_note_type_record_id"
1216
- t.string "valid_note_type_record_type"
1217
- t.integer "note_type_id"
1218
- t.datetime "created_at", :null => false
1219
- t.datetime "updated_at", :null => false
1220
- end
1221
-
1222
- add_index "valid_note_types", ["note_type_id"], :name => "index_valid_note_types_on_note_type_id"
1223
- add_index "valid_note_types", ["valid_note_type_record_id", "valid_note_type_record_type"], :name => "valid_note_type_record_idx"
1224
-
1225
- create_table "valid_preference_types", :force => true do |t|
1226
- t.integer "preference_type_id"
1227
- t.integer "preferenced_record_id"
1228
- t.string "preferenced_record_type"
1229
- end
1230
-
1231
- create_table "view_types", :force => true do |t|
1232
- t.string "internal_identifier"
1233
- t.string "description"
1234
- t.datetime "created_at", :null => false
1235
- t.datetime "updated_at", :null => false
1236
- end
1237
-
1238
- create_table "widgets", :force => true do |t|
1239
- t.string "description"
1240
- t.string "internal_identifier"
1241
- t.string "icon"
1242
- t.string "xtype"
1243
- t.datetime "created_at", :null => false
1244
- t.datetime "updated_at", :null => false
1245
- end
1246
-
1247
- end