erp_search 3.0.4 → 3.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/app/models/extensions/dynamic_form_document.rb +3 -0
- data/app/models/extensions/ticket.rb +3 -0
- data/app/models/extensions/website_inquiry.rb +3 -0
- data/app/models/party_search_fact.rb +2 -0
- data/config/sunspot.yml +11 -4
- data/lib/erp_search.rb +7 -0
- data/lib/erp_search/engine.rb +5 -2
- data/lib/erp_search/extensions.rb +2 -0
- data/lib/erp_search/extensions/active_record/has_dynamic_solr_search.rb +116 -0
- data/lib/erp_search/version.rb +2 -2
- data/lib/tasks/dynamic_form_models.rake +42 -0
- data/spec/dummy/config/application.rb +6 -0
- data/spec/dummy/config/environments/spec.rb +3 -0
- data/spec/dummy/config/sunspot.yml +36 -0
- data/spec/dummy/db/data_migrations/20110109173616_create_capability_scope_types.erp_tech_svcs.rb +15 -0
- data/spec/dummy/db/data_migrations/20110509223702_add_publisher_role.knitkit.rb +22 -0
- data/spec/dummy/db/data_migrations/20110525001935_add_usd_currency.erp_base_erp_svcs.rb +12 -0
- data/spec/dummy/db/data_migrations/20110608185830_create_default_dynamic_models_and_forms.erp_forms.rb +33 -0
- data/spec/dummy/db/data_migrations/20110609150135_add_iso_codes.erp_base_erp_svcs.rb +19 -0
- data/spec/dummy/db/data_migrations/20110728201729_erp_app_setup.erp_app.rb +252 -0
- data/spec/dummy/db/data_migrations/20110728201733_update_preferences.erp_app.rb +53 -0
- data/spec/dummy/db/data_migrations/20110802200222_schedule_delete_expired_sessions_job.erp_tech_svcs.rb +16 -0
- data/spec/dummy/db/data_migrations/20110816153456_add_knitkit_application.knitkit.rb +32 -0
- data/spec/dummy/db/data_migrations/20110816161238_create_desktop_app_audit_log_viewer.erp_app.rb +21 -0
- data/spec/dummy/db/data_migrations/20110817160743_add_file_manager_application.erp_app.rb +32 -0
- data/spec/dummy/db/data_migrations/20110828190913_create_desktop_app_dynamic_forms.erp_forms.rb +19 -0
- data/spec/dummy/db/data_migrations/20110913145838_setup_compass_ae_instance.erp_base_erp_svcs.rb +12 -0
- data/spec/dummy/db/data_migrations/20111108183739_add_default_capabilities.erp_app.rb +23 -0
- data/spec/dummy/db/data_migrations/20111108183740_add_new_contact_widgets.erp_app.rb +42 -0
- data/spec/dummy/db/data_migrations/20111111144706_setup_audit_log_types.erp_tech_svcs.rb +22 -0
- data/spec/dummy/db/data_migrations/20111118182910_setup_knitkit_capabilities.knitkit.rb +128 -0
- data/spec/dummy/db/data_migrations/20120109173616_create_download_capability_type.erp_tech_svcs.rb +14 -0
- data/spec/dummy/db/data_migrations/20120127144444_create_website_role_types.knitkit.rb +14 -0
- data/spec/dummy/db/data_migrations/20120127150505_create_website_default_configuration.knitkit.rb +73 -0
- data/spec/dummy/db/data_migrations/20120127150506_add_primary_host_to_website_configuration.knitkit.rb +34 -0
- data/spec/dummy/db/data_migrations/20120229160222_add_userinfo_widget.erp_app.rb +29 -0
- data/spec/dummy/db/data_migrations/20120316150424_add_is_template_to_default_website_config.knitkit.rb +17 -0
- data/spec/dummy/db/data_migrations/20120405193721_create_party_and_role_type_for_communication_events.erp_app.rb +11 -0
- data/spec/dummy/db/data_migrations/20120411180756_create_user_management_mobile_application.erp_app.rb +19 -0
- data/spec/dummy/db/data_migrations/20120418164215_create_configuration_management_desktop_application.erp_app.rb +23 -0
- data/spec/dummy/db/data_migrations/20120809020508_update_website_and_configuration.knitkit.rb +78 -0
- data/spec/dummy/db/data_migrations/20120824013449_create_ticket_form.erp_forms.rb +67 -0
- data/spec/dummy/db/data_migrations/20121026013449_update_ticket_form.erp_forms.rb +65 -0
- data/spec/dummy/db/data_migrations/20121026191738_update_contact_form.erp_forms.rb +27 -0
- data/spec/dummy/db/data_migrations/20121116155018_create_group_relationship_and_role_types.erp_tech_svcs.rb +20 -0
- data/spec/dummy/db/data_migrations/20121129185611_upgrade_website_role_iid.knitkit.rb +21 -0
- data/spec/dummy/db/data_migrations/20121130201859_upgrade_remove_system_mgmt_app.erp_app.rb +16 -0
- data/spec/dummy/db/data_migrations/20121130212146_note_capabilities.erp_tech_svcs.rb +24 -0
- data/spec/dummy/db/data_migrations/20121218175028_create_security_management_desktop_application.erp_app.rb +23 -0
- data/spec/dummy/db/migrate/20121219182151_base_erp_services.erp_base_erp_svcs.rb +461 -0
- data/spec/dummy/db/migrate/20121219182152_recreate_party_search_facts_table.erp_search.rb +40 -0
- data/spec/dummy/db/migrate/20121219182153_base_tech_services.erp_tech_svcs.rb +255 -0
- data/spec/dummy/db/migrate/20121219182154_create_has_attribute_tables.erp_tech_svcs.rb +39 -0
- data/spec/dummy/db/migrate/20121219182155_base_app_framework.erp_app.rb +276 -0
- data/spec/dummy/db/migrate/20121219182156_dynamic_forms.erp_forms.rb +95 -0
- data/spec/dummy/db/migrate/20121219182157_create_tickets.erp_forms.rb +19 -0
- data/spec/dummy/db/migrate/20121219182158_upgrade_dynamic_forms_table.erp_forms.rb +32 -0
- data/spec/dummy/db/migrate/20121219182159_setup_knitkit.knitkit.rb +316 -0
- data/spec/dummy/db/migrate/20130107181410_create_groups.erp_tech_svcs.rb +19 -0
- data/spec/dummy/db/migrate/20130107181411_upgrade_security.erp_tech_svcs.rb +54 -0
- data/spec/dummy/db/migrate/20130107181412_upgrade_security2.erp_tech_svcs.rb +270 -0
- data/spec/dummy/db/schema.rb +1172 -0
- data/spec/dummy/db/spec.sqlite3 +0 -0
- data/spec/dummy/log/development.log +3 -0
- data/spec/dummy/log/spec.log +26839 -0
- data/spec/dummy/log/sunspot-solr-spec.log +24338 -0
- data/spec/dummy/solr/conf/admin-extra.html +31 -0
- data/spec/dummy/solr/conf/elevate.xml +36 -0
- data/spec/dummy/solr/conf/mapping-ISOLatin1Accent.txt +246 -0
- data/spec/dummy/solr/conf/protwords.txt +21 -0
- data/spec/dummy/solr/conf/schema.xml +238 -0
- data/spec/dummy/solr/conf/scripts.conf +24 -0
- data/spec/dummy/solr/conf/solrconfig.xml +934 -0
- data/spec/dummy/solr/conf/spellings.txt +2 -0
- data/spec/dummy/solr/conf/stopwords.txt +58 -0
- data/spec/dummy/solr/conf/synonyms.txt +31 -0
- data/spec/dummy/solr/data/spec/index/segments.gen +0 -0
- data/spec/dummy/solr/data/spec/index/segments_av +0 -0
- data/spec/dummy/solr/data/spec/spellchecker/segments.gen +0 -0
- data/spec/dummy/solr/data/spec/spellchecker/segments_1 +0 -0
- data/spec/dummy/solr/pids/spec/sunspot-solr-spec.pid +1 -0
- data/spec/spec_helper.rb +19 -10
- metadata +171 -80
@@ -0,0 +1,19 @@
|
|
1
|
+
# This migration comes from erp_tech_svcs (originally 20121116151510)
|
2
|
+
class CreateGroups < ActiveRecord::Migration
|
3
|
+
def self.up
|
4
|
+
unless table_exists?(:groups)
|
5
|
+
create_table :groups do |t|
|
6
|
+
t.column :description, :string
|
7
|
+
t.timestamps
|
8
|
+
end
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
def self.down
|
13
|
+
[ :groups ].each do |tbl|
|
14
|
+
if table_exists?(tbl)
|
15
|
+
drop_table tbl
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,54 @@
|
|
1
|
+
# This migration comes from erp_tech_svcs (originally 20121126171612)
|
2
|
+
class UpgradeSecurity < ActiveRecord::Migration
|
3
|
+
|
4
|
+
def self.up
|
5
|
+
unless table_exists?(:capability_accessors)
|
6
|
+
create_table :capability_accessors do |t|
|
7
|
+
t.string :capability_accessor_record_type
|
8
|
+
t.integer :capability_accessor_record_id
|
9
|
+
t.integer :capability_id
|
10
|
+
t.timestamps
|
11
|
+
end
|
12
|
+
|
13
|
+
add_index :capability_accessors, :capability_id
|
14
|
+
add_index :capability_accessors, [:capability_accessor_record_id, :capability_accessor_record_type], :name => 'capability_accessor_record_index'
|
15
|
+
end
|
16
|
+
|
17
|
+
unless columns(:capabilities).collect {|c| c.name}.include?('scope_query')
|
18
|
+
add_column :capabilities, :description, :string
|
19
|
+
add_column :capabilities, :capability_resource_type, :string
|
20
|
+
add_column :capabilities, :capability_resource_id, :integer
|
21
|
+
add_column :capabilities, :scope_type_id, :integer
|
22
|
+
add_column :capabilities, :scope_query, :text
|
23
|
+
|
24
|
+
add_index :capabilities, :scope_type_id
|
25
|
+
add_index :capabilities, [:capability_resource_id, :capability_resource_type], :name => 'capability_resource_index'
|
26
|
+
end
|
27
|
+
|
28
|
+
unless table_exists?(:scope_types)
|
29
|
+
create_table :scope_types do |t|
|
30
|
+
t.string :description
|
31
|
+
t.string :internal_identifier
|
32
|
+
t.timestamps
|
33
|
+
end
|
34
|
+
|
35
|
+
add_index :scope_types, :internal_identifier
|
36
|
+
end
|
37
|
+
|
38
|
+
unless table_exists?(:parties_security_roles)
|
39
|
+
create_table :parties_security_roles, :id => false do |t|
|
40
|
+
t.integer :party_id
|
41
|
+
t.integer :security_role_id
|
42
|
+
end
|
43
|
+
|
44
|
+
add_index :parties_security_roles, :party_id
|
45
|
+
add_index :parties_security_roles, :security_role_id
|
46
|
+
end
|
47
|
+
|
48
|
+
rename_table :roles, :security_roles unless table_exists?(:security_roles)
|
49
|
+
|
50
|
+
end
|
51
|
+
|
52
|
+
def self.down
|
53
|
+
end
|
54
|
+
end
|
@@ -0,0 +1,270 @@
|
|
1
|
+
# This migration comes from erp_tech_svcs (originally 20121126173506)
|
2
|
+
class UpgradeSecurity2 < ActiveRecord::Migration
|
3
|
+
def self.up
|
4
|
+
if table_exists?(:secured_models)
|
5
|
+
Website.all.each do |w|
|
6
|
+
old_role_iid = "website_#{w.name.underscore.gsub("'","").gsub(",","")}_access"
|
7
|
+
|
8
|
+
r = SecurityRole.find_by_internal_identifier(old_role_iid)
|
9
|
+
unless r.nil?
|
10
|
+
r.internal_identifier = w.website_role_iid
|
11
|
+
r.save
|
12
|
+
end
|
13
|
+
end
|
14
|
+
instance = ScopeType.create(:description => 'Instance', :internal_identifier => 'instance')
|
15
|
+
class_scope_type = ScopeType.create(:description => 'Class', :internal_identifier => 'class')
|
16
|
+
ScopeType.create(:description => 'Query', :internal_identifier => 'query')
|
17
|
+
|
18
|
+
execute('BEGIN TRANSACTION')
|
19
|
+
puts "populating parties_security_roles"
|
20
|
+
sql =
|
21
|
+
"INSERT INTO parties_security_roles (
|
22
|
+
party_id,
|
23
|
+
security_role_id
|
24
|
+
)
|
25
|
+
SELECT
|
26
|
+
u.party_id AS party_id,
|
27
|
+
rsm.role_id AS security_role_id
|
28
|
+
FROM secured_models sm
|
29
|
+
JOIN roles_secured_models rsm ON sm.id=rsm.secured_model_id
|
30
|
+
JOIN users u ON sm.secured_record_id=u.id
|
31
|
+
WHERE sm.secured_record_type='User'"
|
32
|
+
|
33
|
+
execute(sql)
|
34
|
+
execute('COMMIT')
|
35
|
+
|
36
|
+
execute('BEGIN TRANSACTION')
|
37
|
+
puts "populating capabilities with secure File Assets"
|
38
|
+
sql =
|
39
|
+
"INSERT INTO capabilities (
|
40
|
+
capability_type_id,
|
41
|
+
capability_resource_type,
|
42
|
+
capability_resource_id,
|
43
|
+
scope_type_id
|
44
|
+
)
|
45
|
+
SELECT
|
46
|
+
c.capability_type_id AS capability_type_id,
|
47
|
+
'FileAsset' AS capability_resource_type,
|
48
|
+
cm.capable_model_record_id AS capability_resource_id,
|
49
|
+
#{instance.id} AS scope_type_id
|
50
|
+
FROM capable_models AS cm
|
51
|
+
JOIN capabilities_capable_models AS ccm ON ccm.capable_model_id = cm.id
|
52
|
+
JOIN capabilities AS c ON ccm.capability_id = c.id
|
53
|
+
JOIN secured_models AS sm ON sm.secured_record_id = c.id AND sm.secured_record_type = 'Capability'
|
54
|
+
JOIN roles_secured_models AS rsm ON rsm.secured_model_id = sm.id
|
55
|
+
JOIN security_roles AS r ON r.id = rsm.role_id
|
56
|
+
WHERE cm.capable_model_record_type = 'FileAsset'"
|
57
|
+
|
58
|
+
execute(sql)
|
59
|
+
execute('COMMIT')
|
60
|
+
|
61
|
+
view = CapabilityType.find_by_internal_identifier('view')
|
62
|
+
|
63
|
+
execute('BEGIN TRANSACTION')
|
64
|
+
puts "populating capabilities with secure Website Sections"
|
65
|
+
sql =
|
66
|
+
"INSERT INTO capabilities (
|
67
|
+
capability_type_id,
|
68
|
+
capability_resource_type,
|
69
|
+
capability_resource_id,
|
70
|
+
scope_type_id
|
71
|
+
)
|
72
|
+
SELECT
|
73
|
+
#{view.id} AS capability_type_id,
|
74
|
+
'WebsiteSection' AS capability_resource_type,
|
75
|
+
ws.id AS capability_resource_id,
|
76
|
+
#{instance.id} AS scope_type_id
|
77
|
+
FROM secured_models sm
|
78
|
+
JOIN roles_secured_models rsm ON sm.id=rsm.secured_model_id
|
79
|
+
JOIN website_sections ws ON sm.secured_record_id=ws.id
|
80
|
+
WHERE sm.secured_record_type='WebsiteSection'"
|
81
|
+
|
82
|
+
execute(sql)
|
83
|
+
execute('COMMIT')
|
84
|
+
|
85
|
+
execute('BEGIN TRANSACTION')
|
86
|
+
puts "populating capabilities with secure Website Nav Items"
|
87
|
+
sql =
|
88
|
+
"INSERT INTO capabilities (
|
89
|
+
capability_type_id,
|
90
|
+
capability_resource_type,
|
91
|
+
capability_resource_id,
|
92
|
+
scope_type_id
|
93
|
+
)
|
94
|
+
SELECT
|
95
|
+
#{view.id} AS capability_type_id,
|
96
|
+
'WebsiteNavItem' AS capability_resource_type,
|
97
|
+
ws.id AS capability_resource_id,
|
98
|
+
#{instance.id} AS scope_type_id
|
99
|
+
FROM secured_models sm
|
100
|
+
JOIN roles_secured_models rsm ON sm.id=rsm.secured_model_id
|
101
|
+
JOIN website_sections ws ON sm.secured_record_id=ws.id
|
102
|
+
WHERE sm.secured_record_type='WebsiteNavItem'"
|
103
|
+
|
104
|
+
execute(sql)
|
105
|
+
execute('COMMIT')
|
106
|
+
|
107
|
+
# delete obsolete records: Application, Widget, dupes?
|
108
|
+
Capability.where("capability_resource_type IS NULL").delete_all
|
109
|
+
|
110
|
+
admin = SecurityRole.find_by_internal_identifier('admin')
|
111
|
+
website_author = SecurityRole.find_by_internal_identifier('website_author')
|
112
|
+
layout_author = SecurityRole.find_by_internal_identifier('layout_author')
|
113
|
+
content_author = SecurityRole.find_by_internal_identifier('content_author')
|
114
|
+
designer = SecurityRole.find_by_internal_identifier('designer')
|
115
|
+
publisher = SecurityRole.find_by_internal_identifier('publisher')
|
116
|
+
|
117
|
+
# add instance capabilities to roles
|
118
|
+
instance_capabilities = Capability.where(:scope_type_id => instance.id).all
|
119
|
+
instance_capabilities.each do |c|
|
120
|
+
case c.capability_resource_type
|
121
|
+
when 'FileAsset'
|
122
|
+
admin.add_capability(c)
|
123
|
+
website_author.add_capability(c)
|
124
|
+
content_author.add_capability(c)
|
125
|
+
if c.capability_resource.file_asset_holder_type == 'Website'
|
126
|
+
website_role = c.capability_resource.file_asset_holder.role
|
127
|
+
website_role.add_capability(c)
|
128
|
+
end
|
129
|
+
when 'WebsiteSection'
|
130
|
+
admin.add_capability(c)
|
131
|
+
website_author.add_capability(c)
|
132
|
+
website_role = c.capability_resource.website.role
|
133
|
+
website_role.add_capability(c)
|
134
|
+
when 'WebsiteNavItem'
|
135
|
+
admin.add_capability(c)
|
136
|
+
website_author.add_capability(c)
|
137
|
+
website_role = c.capability_resource.website_nav.website.role
|
138
|
+
website_role.add_capability(c)
|
139
|
+
end
|
140
|
+
end
|
141
|
+
|
142
|
+
# add knitkit class capabilities to roles
|
143
|
+
admin.add_capability('create', 'WebsiteNav')
|
144
|
+
admin.add_capability('delete', 'WebsiteNav')
|
145
|
+
admin.add_capability('edit', 'WebsiteNav')
|
146
|
+
|
147
|
+
website_author.add_capability('create', 'WebsiteNav')
|
148
|
+
website_author.add_capability('delete', 'WebsiteNav')
|
149
|
+
website_author.add_capability('edit', 'WebsiteNav')
|
150
|
+
|
151
|
+
admin.add_capability('create', 'Website')
|
152
|
+
admin.add_capability('delete', 'Website')
|
153
|
+
admin.add_capability('edit', 'Website')
|
154
|
+
admin.add_capability('import', 'Website')
|
155
|
+
admin.add_capability('publish', 'Website')
|
156
|
+
admin.add_capability('activate', 'Website')
|
157
|
+
|
158
|
+
website_author.add_capability('create', 'Website')
|
159
|
+
website_author.add_capability('delete', 'Website')
|
160
|
+
website_author.add_capability('edit', 'Website')
|
161
|
+
website_author.add_capability('import', 'Website')
|
162
|
+
publisher.add_capability('publish', 'Website')
|
163
|
+
publisher.add_capability('activate', 'Website')
|
164
|
+
|
165
|
+
admin.add_capability('create', 'WebsiteHost')
|
166
|
+
admin.add_capability('delete', 'WebsiteHost')
|
167
|
+
admin.add_capability('edit', 'WebsiteHost')
|
168
|
+
|
169
|
+
website_author.add_capability('create', 'WebsiteHost')
|
170
|
+
website_author.add_capability('delete', 'WebsiteHost')
|
171
|
+
website_author.add_capability('edit', 'WebsiteHost')
|
172
|
+
|
173
|
+
admin.add_capability('create', 'WebsiteSection')
|
174
|
+
admin.add_capability('delete', 'WebsiteSection')
|
175
|
+
admin.add_capability('edit', 'WebsiteSection')
|
176
|
+
admin.add_capability('secure', 'WebsiteSection')
|
177
|
+
admin.add_capability('unsecure', 'WebsiteSection')
|
178
|
+
|
179
|
+
website_author.add_capability('create', 'WebsiteSection')
|
180
|
+
website_author.add_capability('delete', 'WebsiteSection')
|
181
|
+
website_author.add_capability('edit', 'WebsiteSection')
|
182
|
+
website_author.add_capability('secure', 'WebsiteSection')
|
183
|
+
website_author.add_capability('unsecure', 'WebsiteSection')
|
184
|
+
|
185
|
+
admin.add_capability('create', 'WebsiteSectionLayout')
|
186
|
+
admin.add_capability('edit', 'WebsiteSectionLayout')
|
187
|
+
|
188
|
+
layout_author.add_capability('create', 'WebsiteSectionLayout')
|
189
|
+
layout_author.add_capability('edit', 'WebsiteSectionLayout')
|
190
|
+
|
191
|
+
admin.add_capability('create', 'Content')
|
192
|
+
admin.add_capability('delete', 'Content')
|
193
|
+
admin.add_capability('edit', 'Content')
|
194
|
+
admin.add_capability('publish', 'Content')
|
195
|
+
admin.add_capability('revert_version', 'Content')
|
196
|
+
admin.add_capability('add_existing', 'Content')
|
197
|
+
admin.add_capability('edit_html', 'Content')
|
198
|
+
admin.add_capability('edit_excerpt', 'Content')
|
199
|
+
|
200
|
+
content_author.add_capability('create', 'Content')
|
201
|
+
content_author.add_capability('delete', 'Content')
|
202
|
+
content_author.add_capability('edit', 'Content')
|
203
|
+
content_author.add_capability('publish', 'Content')
|
204
|
+
content_author.add_capability('revert_version', 'Content')
|
205
|
+
content_author.add_capability('add_existing', 'Content')
|
206
|
+
content_author.add_capability('edit_html', 'Content')
|
207
|
+
content_author.add_capability('edit_excerpt', 'Content')
|
208
|
+
|
209
|
+
admin.add_capability('create', 'WebsiteNavItem')
|
210
|
+
admin.add_capability('delete', 'WebsiteNavItem')
|
211
|
+
admin.add_capability('edit', 'WebsiteNavItem')
|
212
|
+
admin.add_capability('secure', 'WebsiteNavItem')
|
213
|
+
admin.add_capability('unsecure', 'WebsiteNavItem')
|
214
|
+
|
215
|
+
website_author.add_capability('create', 'WebsiteNavItem')
|
216
|
+
website_author.add_capability('delete', 'WebsiteNavItem')
|
217
|
+
website_author.add_capability('edit', 'WebsiteNavItem')
|
218
|
+
website_author.add_capability('secure', 'WebsiteNavItem')
|
219
|
+
website_author.add_capability('unsecure', 'WebsiteNavItem')
|
220
|
+
|
221
|
+
admin.add_capability('view', 'Theme')
|
222
|
+
designer.add_capability('view', 'Theme')
|
223
|
+
|
224
|
+
admin.add_capability('view', 'SiteImageAsset')
|
225
|
+
website_author.add_capability('view', 'SiteImageAsset')
|
226
|
+
content_author.add_capability('view', 'SiteImageAsset')
|
227
|
+
|
228
|
+
content_author.add_capability('view', 'GlobalImageAsset')
|
229
|
+
|
230
|
+
admin.add_capability('view', 'GlobalImageAsset')
|
231
|
+
admin.add_capability('upload', 'GlobalImageAsset')
|
232
|
+
admin.add_capability('delete', 'GlobalImageAsset')
|
233
|
+
|
234
|
+
website_author.add_capability('view', 'GlobalImageAsset')
|
235
|
+
website_author.add_capability('upload', 'GlobalImageAsset')
|
236
|
+
website_author.add_capability('delete', 'GlobalImageAsset')
|
237
|
+
|
238
|
+
admin.add_capability('view', 'SiteFileAsset')
|
239
|
+
website_author.add_capability('view', 'SiteFileAsset')
|
240
|
+
content_author.add_capability('view', 'SiteFileAsset')
|
241
|
+
|
242
|
+
content_author.add_capability('view', 'GlobalFileAsset')
|
243
|
+
|
244
|
+
admin.add_capability('view', 'GlobalFileAsset')
|
245
|
+
admin.add_capability('upload', 'GlobalFileAsset')
|
246
|
+
admin.add_capability('delete', 'GlobalFileAsset')
|
247
|
+
|
248
|
+
website_author.add_capability('view', 'GlobalFileAsset')
|
249
|
+
website_author.add_capability('upload', 'GlobalFileAsset')
|
250
|
+
website_author.add_capability('delete', 'GlobalFileAsset')
|
251
|
+
|
252
|
+
admin.add_capability('drag_item', 'WebsiteTree')
|
253
|
+
website_author.add_capability('drag_item', 'WebsiteTree')
|
254
|
+
|
255
|
+
# update capability descriptions
|
256
|
+
Capability.all.each do |c|
|
257
|
+
c.update_description
|
258
|
+
end
|
259
|
+
|
260
|
+
drop_table :capable_models
|
261
|
+
drop_table :capabilities_capable_models
|
262
|
+
drop_table :secured_models
|
263
|
+
drop_table :roles_secured_models
|
264
|
+
remove_column :capabilities, :resource
|
265
|
+
end
|
266
|
+
end
|
267
|
+
|
268
|
+
def self.down
|
269
|
+
end
|
270
|
+
end
|
@@ -0,0 +1,1172 @@
|
|
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 => 20121219182159) 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 "comments", :force => true do |t|
|
193
|
+
t.string "commentor_name"
|
194
|
+
t.string "email"
|
195
|
+
t.text "comment"
|
196
|
+
t.integer "approved"
|
197
|
+
t.datetime "approved_at"
|
198
|
+
t.integer "user_id"
|
199
|
+
t.integer "commented_record_id"
|
200
|
+
t.string "commented_record_type"
|
201
|
+
t.datetime "created_at", :null => false
|
202
|
+
t.datetime "updated_at", :null => false
|
203
|
+
end
|
204
|
+
|
205
|
+
add_index "comments", ["approved"], :name => "index_comments_on_approved"
|
206
|
+
add_index "comments", ["commented_record_id", "commented_record_type"], :name => "commented_record_idx"
|
207
|
+
add_index "comments", ["user_id"], :name => "index_comments_on_user_id"
|
208
|
+
|
209
|
+
create_table "compass_ae_instances", :force => true do |t|
|
210
|
+
t.decimal "version", :precision => 3, :scale => 8
|
211
|
+
t.datetime "created_at", :null => false
|
212
|
+
t.datetime "updated_at", :null => false
|
213
|
+
end
|
214
|
+
|
215
|
+
create_table "configuration_item_types", :force => true do |t|
|
216
|
+
t.integer "parent_id"
|
217
|
+
t.integer "lft"
|
218
|
+
t.integer "rgt"
|
219
|
+
t.string "description"
|
220
|
+
t.string "internal_identifier"
|
221
|
+
t.boolean "allow_user_defined_options", :default => false
|
222
|
+
t.boolean "is_multi_optional", :default => false
|
223
|
+
t.datetime "created_at", :null => false
|
224
|
+
t.datetime "updated_at", :null => false
|
225
|
+
end
|
226
|
+
|
227
|
+
create_table "configuration_item_types_configuration_options", :force => true do |t|
|
228
|
+
t.integer "configuration_item_type_id"
|
229
|
+
t.integer "configuration_option_id"
|
230
|
+
t.boolean "is_default", :default => false
|
231
|
+
t.datetime "created_at", :null => false
|
232
|
+
t.datetime "updated_at", :null => false
|
233
|
+
end
|
234
|
+
|
235
|
+
add_index "configuration_item_types_configuration_options", ["configuration_item_type_id"], :name => "conf_item_type_conf_opt_id_item_idx"
|
236
|
+
add_index "configuration_item_types_configuration_options", ["configuration_option_id"], :name => "conf_item_type_conf_opt_id_opt_idx"
|
237
|
+
|
238
|
+
create_table "configuration_item_types_configurations", :id => false, :force => true do |t|
|
239
|
+
t.integer "configuration_item_type_id"
|
240
|
+
t.integer "configuration_id"
|
241
|
+
end
|
242
|
+
|
243
|
+
add_index "configuration_item_types_configurations", ["configuration_id"], :name => "conf_id_idx"
|
244
|
+
add_index "configuration_item_types_configurations", ["configuration_item_type_id", "configuration_id"], :name => "conf_config_type_uniq_idx", :unique => true
|
245
|
+
add_index "configuration_item_types_configurations", ["configuration_item_type_id"], :name => "conf_conf_type_id_item_idx"
|
246
|
+
|
247
|
+
create_table "configuration_items", :force => true do |t|
|
248
|
+
t.integer "configuration_id"
|
249
|
+
t.integer "configuration_item_type_id"
|
250
|
+
t.integer "configuration_option_id"
|
251
|
+
t.datetime "created_at", :null => false
|
252
|
+
t.datetime "updated_at", :null => false
|
253
|
+
end
|
254
|
+
|
255
|
+
add_index "configuration_items", ["configuration_id"], :name => "index_configuration_items_on_configuration_id"
|
256
|
+
add_index "configuration_items", ["configuration_item_type_id"], :name => "index_configuration_items_on_configuration_item_type_id"
|
257
|
+
add_index "configuration_items", ["configuration_option_id"], :name => "index_configuration_items_on_configuration_option_id"
|
258
|
+
|
259
|
+
create_table "configuration_items_configuration_options", :id => false, :force => true do |t|
|
260
|
+
t.integer "configuration_item_id"
|
261
|
+
t.integer "configuration_option_id"
|
262
|
+
end
|
263
|
+
|
264
|
+
add_index "configuration_items_configuration_options", ["configuration_item_id"], :name => "conf_item_conf_opt_id_item_idx"
|
265
|
+
add_index "configuration_items_configuration_options", ["configuration_option_id"], :name => "conf_item_conf_opt_id_opt_idx"
|
266
|
+
|
267
|
+
create_table "configuration_options", :force => true do |t|
|
268
|
+
t.string "description"
|
269
|
+
t.string "internal_identifier"
|
270
|
+
t.string "value"
|
271
|
+
t.text "comment"
|
272
|
+
t.boolean "user_defined", :default => false
|
273
|
+
t.datetime "created_at", :null => false
|
274
|
+
t.datetime "updated_at", :null => false
|
275
|
+
end
|
276
|
+
|
277
|
+
add_index "configuration_options", ["internal_identifier"], :name => "index_configuration_options_on_internal_identifier"
|
278
|
+
add_index "configuration_options", ["user_defined"], :name => "index_configuration_options_on_user_defined"
|
279
|
+
add_index "configuration_options", ["value"], :name => "index_configuration_options_on_value"
|
280
|
+
|
281
|
+
create_table "configurations", :force => true do |t|
|
282
|
+
t.string "description"
|
283
|
+
t.string "internal_identifier"
|
284
|
+
t.boolean "active"
|
285
|
+
t.boolean "is_template", :default => false
|
286
|
+
t.datetime "created_at", :null => false
|
287
|
+
t.datetime "updated_at", :null => false
|
288
|
+
end
|
289
|
+
|
290
|
+
add_index "configurations", ["is_template"], :name => "index_configurations_on_is_template"
|
291
|
+
|
292
|
+
create_table "contact_purposes", :force => true do |t|
|
293
|
+
t.integer "parent_id"
|
294
|
+
t.integer "lft"
|
295
|
+
t.integer "rgt"
|
296
|
+
t.string "description"
|
297
|
+
t.string "comments"
|
298
|
+
t.string "internal_identifier"
|
299
|
+
t.string "external_identifier"
|
300
|
+
t.string "external_id_source"
|
301
|
+
t.datetime "created_at", :null => false
|
302
|
+
t.datetime "updated_at", :null => false
|
303
|
+
end
|
304
|
+
|
305
|
+
add_index "contact_purposes", ["parent_id"], :name => "index_contact_purposes_on_parent_id"
|
306
|
+
|
307
|
+
create_table "contact_purposes_contacts", :id => false, :force => true do |t|
|
308
|
+
t.integer "contact_id"
|
309
|
+
t.integer "contact_purpose_id"
|
310
|
+
end
|
311
|
+
|
312
|
+
add_index "contact_purposes_contacts", ["contact_id", "contact_purpose_id"], :name => "contact_purposes_contacts_index"
|
313
|
+
|
314
|
+
create_table "contact_types", :force => true do |t|
|
315
|
+
t.integer "parent_id"
|
316
|
+
t.integer "lft"
|
317
|
+
t.integer "rgt"
|
318
|
+
t.string "description"
|
319
|
+
t.string "comments"
|
320
|
+
t.string "internal_identifier"
|
321
|
+
t.string "external_identifier"
|
322
|
+
t.string "external_id_source"
|
323
|
+
t.datetime "created_at", :null => false
|
324
|
+
t.datetime "updated_at", :null => false
|
325
|
+
end
|
326
|
+
|
327
|
+
add_index "contact_types", ["parent_id"], :name => "index_contact_types_on_parent_id"
|
328
|
+
|
329
|
+
create_table "contacts", :force => true do |t|
|
330
|
+
t.integer "party_id"
|
331
|
+
t.integer "contact_mechanism_id"
|
332
|
+
t.string "contact_mechanism_type"
|
333
|
+
t.string "external_identifier"
|
334
|
+
t.string "external_id_source"
|
335
|
+
t.datetime "created_at", :null => false
|
336
|
+
t.datetime "updated_at", :null => false
|
337
|
+
end
|
338
|
+
|
339
|
+
add_index "contacts", ["contact_mechanism_id", "contact_mechanism_type"], :name => "besi_2"
|
340
|
+
add_index "contacts", ["party_id"], :name => "index_contacts_on_party_id"
|
341
|
+
|
342
|
+
create_table "content_versions", :force => true do |t|
|
343
|
+
t.integer "content_id"
|
344
|
+
t.integer "version"
|
345
|
+
t.string "title"
|
346
|
+
t.string "permalink"
|
347
|
+
t.text "excerpt_html"
|
348
|
+
t.text "body_html"
|
349
|
+
t.integer "created_by_id"
|
350
|
+
t.integer "updated_by_id"
|
351
|
+
t.string "internal_identifier"
|
352
|
+
t.boolean "display_title"
|
353
|
+
t.datetime "created_at"
|
354
|
+
t.datetime "updated_at"
|
355
|
+
t.string "versioned_type"
|
356
|
+
end
|
357
|
+
|
358
|
+
add_index "content_versions", ["content_id"], :name => "index_content_versions_on_content_id"
|
359
|
+
|
360
|
+
create_table "contents", :force => true do |t|
|
361
|
+
t.string "type"
|
362
|
+
t.string "title"
|
363
|
+
t.string "permalink"
|
364
|
+
t.text "excerpt_html"
|
365
|
+
t.text "body_html"
|
366
|
+
t.integer "created_by_id"
|
367
|
+
t.integer "updated_by_id"
|
368
|
+
t.string "internal_identifier"
|
369
|
+
t.boolean "display_title"
|
370
|
+
t.integer "version"
|
371
|
+
t.datetime "created_at", :null => false
|
372
|
+
t.datetime "updated_at", :null => false
|
373
|
+
end
|
374
|
+
|
375
|
+
add_index "contents", ["created_by_id"], :name => "index_contents_on_created_by_id"
|
376
|
+
add_index "contents", ["internal_identifier"], :name => "contents_iid_idx"
|
377
|
+
add_index "contents", ["permalink"], :name => "index_contents_on_permalink"
|
378
|
+
add_index "contents", ["type"], :name => "index_contents_on_type"
|
379
|
+
add_index "contents", ["updated_by_id"], :name => "index_contents_on_updated_by_id"
|
380
|
+
add_index "contents", ["version"], :name => "index_contents_on_version"
|
381
|
+
|
382
|
+
create_table "currencies", :force => true do |t|
|
383
|
+
t.string "name"
|
384
|
+
t.string "definition"
|
385
|
+
t.string "internal_identifier"
|
386
|
+
t.string "numeric_code"
|
387
|
+
t.string "major_unit_symbol"
|
388
|
+
t.string "minor_unit_symbol"
|
389
|
+
t.string "ratio_of_minor_unit_to_major_unit"
|
390
|
+
t.string "postfix_label"
|
391
|
+
t.datetime "introduction_date"
|
392
|
+
t.datetime "expiration_date"
|
393
|
+
t.datetime "created_at", :null => false
|
394
|
+
t.datetime "updated_at", :null => false
|
395
|
+
end
|
396
|
+
|
397
|
+
add_index "currencies", ["internal_identifier"], :name => "index_currencies_on_internal_identifier"
|
398
|
+
|
399
|
+
create_table "delayed_jobs", :force => true do |t|
|
400
|
+
t.integer "priority", :default => 0
|
401
|
+
t.integer "attempts", :default => 0
|
402
|
+
t.text "handler"
|
403
|
+
t.text "last_error"
|
404
|
+
t.datetime "run_at"
|
405
|
+
t.datetime "locked_at"
|
406
|
+
t.datetime "failed_at"
|
407
|
+
t.string "locked_by"
|
408
|
+
t.string "queue"
|
409
|
+
t.datetime "created_at", :null => false
|
410
|
+
t.datetime "updated_at", :null => false
|
411
|
+
end
|
412
|
+
|
413
|
+
add_index "delayed_jobs", ["priority", "run_at"], :name => "delayed_jobs_priority"
|
414
|
+
|
415
|
+
create_table "descriptive_assets", :force => true do |t|
|
416
|
+
t.integer "view_type_id"
|
417
|
+
t.string "internal_identifier"
|
418
|
+
t.text "description"
|
419
|
+
t.string "external_identifier"
|
420
|
+
t.string "external_id_source"
|
421
|
+
t.integer "described_record_id"
|
422
|
+
t.string "described_record_type"
|
423
|
+
t.datetime "created_at", :null => false
|
424
|
+
t.datetime "updated_at", :null => false
|
425
|
+
end
|
426
|
+
|
427
|
+
add_index "descriptive_assets", ["described_record_id", "described_record_type"], :name => "described_record_idx"
|
428
|
+
add_index "descriptive_assets", ["view_type_id"], :name => "index_descriptive_assets_on_view_type_id"
|
429
|
+
|
430
|
+
create_table "document_types", :force => true do |t|
|
431
|
+
t.string "external_identifier"
|
432
|
+
t.string "internal_identifier"
|
433
|
+
t.string "description"
|
434
|
+
t.datetime "created_at", :null => false
|
435
|
+
t.datetime "updated_at", :null => false
|
436
|
+
end
|
437
|
+
|
438
|
+
create_table "documented_items", :force => true do |t|
|
439
|
+
t.string "documented_klass"
|
440
|
+
t.integer "documented_content_id"
|
441
|
+
t.integer "online_document_section_id"
|
442
|
+
t.datetime "created_at", :null => false
|
443
|
+
t.datetime "updated_at", :null => false
|
444
|
+
end
|
445
|
+
|
446
|
+
create_table "documents", :force => true do |t|
|
447
|
+
t.string "external_identifier"
|
448
|
+
t.string "internal_identifier"
|
449
|
+
t.string "description"
|
450
|
+
t.datetime "document_date"
|
451
|
+
t.text "dynamic_attributes"
|
452
|
+
t.integer "document_record_id"
|
453
|
+
t.string "document_record_type"
|
454
|
+
t.integer "document_type_id"
|
455
|
+
t.datetime "created_at", :null => false
|
456
|
+
t.datetime "updated_at", :null => false
|
457
|
+
end
|
458
|
+
|
459
|
+
add_index "documents", ["document_record_type", "document_record_id"], :name => "document_record_poly_idx"
|
460
|
+
add_index "documents", ["document_type_id"], :name => "document_type_idx"
|
461
|
+
|
462
|
+
create_table "dynamic_data", :force => true do |t|
|
463
|
+
t.string "reference_type"
|
464
|
+
t.integer "reference_id"
|
465
|
+
t.text "dynamic_attributes"
|
466
|
+
t.integer "created_with_form_id"
|
467
|
+
t.integer "updated_with_form_id"
|
468
|
+
t.integer "created_by_id"
|
469
|
+
t.integer "updated_by_id"
|
470
|
+
t.datetime "created_at", :null => false
|
471
|
+
t.datetime "updated_at", :null => false
|
472
|
+
end
|
473
|
+
|
474
|
+
add_index "dynamic_data", ["created_by_id"], :name => "index_dynamic_data_on_created_by_id"
|
475
|
+
add_index "dynamic_data", ["created_with_form_id"], :name => "index_dynamic_data_on_created_with_form_id"
|
476
|
+
add_index "dynamic_data", ["reference_id"], :name => "index_dynamic_data_on_reference_id"
|
477
|
+
add_index "dynamic_data", ["reference_type"], :name => "index_dynamic_data_on_reference_type"
|
478
|
+
add_index "dynamic_data", ["updated_by_id"], :name => "index_dynamic_data_on_updated_by_id"
|
479
|
+
add_index "dynamic_data", ["updated_with_form_id"], :name => "index_dynamic_data_on_updated_with_form_id"
|
480
|
+
|
481
|
+
create_table "dynamic_form_documents", :force => true do |t|
|
482
|
+
t.integer "dynamic_form_model_id"
|
483
|
+
t.string "type"
|
484
|
+
t.datetime "created_at", :null => false
|
485
|
+
t.datetime "updated_at", :null => false
|
486
|
+
end
|
487
|
+
|
488
|
+
add_index "dynamic_form_documents", ["dynamic_form_model_id"], :name => "index_dynamic_form_documents_on_dynamic_form_model_id"
|
489
|
+
add_index "dynamic_form_documents", ["type"], :name => "index_dynamic_form_documents_on_type"
|
490
|
+
|
491
|
+
create_table "dynamic_form_models", :force => true do |t|
|
492
|
+
t.string "model_name"
|
493
|
+
t.boolean "show_in_multitask", :default => false
|
494
|
+
t.boolean "allow_comments", :default => true
|
495
|
+
t.boolean "allow_files", :default => true
|
496
|
+
t.string "file_security_default", :default => "private"
|
497
|
+
t.datetime "created_at", :null => false
|
498
|
+
t.datetime "updated_at", :null => false
|
499
|
+
end
|
500
|
+
|
501
|
+
create_table "dynamic_forms", :force => true do |t|
|
502
|
+
t.string "description"
|
503
|
+
t.text "definition"
|
504
|
+
t.integer "dynamic_form_model_id"
|
505
|
+
t.string "model_name"
|
506
|
+
t.string "internal_identifier"
|
507
|
+
t.boolean "default"
|
508
|
+
t.string "widget_action", :default => "save"
|
509
|
+
t.string "widget_email_recipients"
|
510
|
+
t.boolean "focus_first_field", :default => true
|
511
|
+
t.boolean "submit_empty_text", :default => false
|
512
|
+
t.string "msg_target", :default => "qtip"
|
513
|
+
t.string "submit_button_label", :default => "Submit"
|
514
|
+
t.string "cancel_button_label", :default => "Cancel"
|
515
|
+
t.text "comment"
|
516
|
+
t.integer "created_by_id"
|
517
|
+
t.integer "updated_by_id"
|
518
|
+
t.datetime "created_at", :null => false
|
519
|
+
t.datetime "updated_at", :null => false
|
520
|
+
end
|
521
|
+
|
522
|
+
add_index "dynamic_forms", ["created_by_id"], :name => "index_dynamic_forms_on_created_by_id"
|
523
|
+
add_index "dynamic_forms", ["dynamic_form_model_id"], :name => "index_dynamic_forms_on_dynamic_form_model_id"
|
524
|
+
add_index "dynamic_forms", ["internal_identifier"], :name => "index_dynamic_forms_on_internal_identifier"
|
525
|
+
add_index "dynamic_forms", ["model_name"], :name => "index_dynamic_forms_on_model_name"
|
526
|
+
add_index "dynamic_forms", ["updated_by_id"], :name => "index_dynamic_forms_on_updated_by_id"
|
527
|
+
|
528
|
+
create_table "email_addresses", :force => true do |t|
|
529
|
+
t.string "email_address"
|
530
|
+
t.string "description"
|
531
|
+
t.datetime "created_at", :null => false
|
532
|
+
t.datetime "updated_at", :null => false
|
533
|
+
end
|
534
|
+
|
535
|
+
create_table "file_assets", :force => true do |t|
|
536
|
+
t.integer "file_asset_holder_id"
|
537
|
+
t.string "file_asset_holder_type"
|
538
|
+
t.string "type"
|
539
|
+
t.string "name"
|
540
|
+
t.string "directory"
|
541
|
+
t.string "data_file_name"
|
542
|
+
t.string "data_content_type"
|
543
|
+
t.integer "data_file_size"
|
544
|
+
t.datetime "data_updated_at"
|
545
|
+
t.string "width"
|
546
|
+
t.string "height"
|
547
|
+
t.datetime "created_at", :null => false
|
548
|
+
t.datetime "updated_at", :null => false
|
549
|
+
end
|
550
|
+
|
551
|
+
add_index "file_assets", ["directory"], :name => "index_file_assets_on_directory"
|
552
|
+
add_index "file_assets", ["file_asset_holder_id", "file_asset_holder_type"], :name => "file_asset_holder_idx"
|
553
|
+
add_index "file_assets", ["name"], :name => "index_file_assets_on_name"
|
554
|
+
add_index "file_assets", ["type"], :name => "index_file_assets_on_type"
|
555
|
+
|
556
|
+
create_table "geo_countries", :force => true do |t|
|
557
|
+
t.string "name"
|
558
|
+
t.string "iso_code_2"
|
559
|
+
t.string "iso_code_3"
|
560
|
+
t.boolean "display", :default => true
|
561
|
+
t.integer "external_id"
|
562
|
+
t.datetime "created_at"
|
563
|
+
end
|
564
|
+
|
565
|
+
add_index "geo_countries", ["iso_code_2"], :name => "index_geo_countries_on_iso_code_2"
|
566
|
+
add_index "geo_countries", ["name"], :name => "index_geo_countries_on_name"
|
567
|
+
|
568
|
+
create_table "geo_zones", :force => true do |t|
|
569
|
+
t.integer "geo_country_id"
|
570
|
+
t.string "zone_code", :default => "2"
|
571
|
+
t.string "zone_name"
|
572
|
+
t.datetime "created_at"
|
573
|
+
end
|
574
|
+
|
575
|
+
add_index "geo_zones", ["geo_country_id"], :name => "index_geo_zones_on_geo_country_id"
|
576
|
+
add_index "geo_zones", ["zone_code"], :name => "index_geo_zones_on_zone_code"
|
577
|
+
add_index "geo_zones", ["zone_name"], :name => "index_geo_zones_on_zone_name"
|
578
|
+
|
579
|
+
create_table "individuals", :force => true do |t|
|
580
|
+
t.integer "party_id"
|
581
|
+
t.string "current_last_name"
|
582
|
+
t.string "current_first_name"
|
583
|
+
t.string "current_middle_name"
|
584
|
+
t.string "current_personal_title"
|
585
|
+
t.string "current_suffix"
|
586
|
+
t.string "current_nickname"
|
587
|
+
t.string "gender", :limit => 1
|
588
|
+
t.date "birth_date"
|
589
|
+
t.decimal "height", :precision => 5, :scale => 2
|
590
|
+
t.integer "weight"
|
591
|
+
t.string "mothers_maiden_name"
|
592
|
+
t.string "marital_status", :limit => 1
|
593
|
+
t.string "social_security_number"
|
594
|
+
t.integer "current_passport_number"
|
595
|
+
t.date "current_passport_expire_date"
|
596
|
+
t.integer "total_years_work_experience"
|
597
|
+
t.string "comments"
|
598
|
+
t.string "encrypted_ssn"
|
599
|
+
t.string "temp_ssn"
|
600
|
+
t.string "salt"
|
601
|
+
t.string "ssn_last_four"
|
602
|
+
t.datetime "created_at", :null => false
|
603
|
+
t.datetime "updated_at", :null => false
|
604
|
+
end
|
605
|
+
|
606
|
+
add_index "individuals", ["party_id"], :name => "index_individuals_on_party_id"
|
607
|
+
|
608
|
+
create_table "money", :force => true do |t|
|
609
|
+
t.string "description"
|
610
|
+
t.decimal "amount", :precision => 8, :scale => 2
|
611
|
+
t.integer "currency_id"
|
612
|
+
t.datetime "created_at", :null => false
|
613
|
+
t.datetime "updated_at", :null => false
|
614
|
+
end
|
615
|
+
|
616
|
+
add_index "money", ["currency_id"], :name => "index_money_on_currency_id"
|
617
|
+
|
618
|
+
create_table "note_types", :force => true do |t|
|
619
|
+
t.integer "parent_id"
|
620
|
+
t.integer "lft"
|
621
|
+
t.integer "rgt"
|
622
|
+
t.string "description"
|
623
|
+
t.string "internal_identifier"
|
624
|
+
t.string "external_identifier"
|
625
|
+
t.integer "note_type_record_id"
|
626
|
+
t.string "note_type_record_type"
|
627
|
+
t.datetime "created_at", :null => false
|
628
|
+
t.datetime "updated_at", :null => false
|
629
|
+
end
|
630
|
+
|
631
|
+
add_index "note_types", ["note_type_record_id", "note_type_record_type"], :name => "note_type_record_idx"
|
632
|
+
|
633
|
+
create_table "notes", :force => true do |t|
|
634
|
+
t.integer "created_by_id"
|
635
|
+
t.text "content"
|
636
|
+
t.integer "noted_record_id"
|
637
|
+
t.string "noted_record_type"
|
638
|
+
t.integer "note_type_id"
|
639
|
+
t.datetime "created_at", :null => false
|
640
|
+
t.datetime "updated_at", :null => false
|
641
|
+
end
|
642
|
+
|
643
|
+
add_index "notes", ["created_by_id"], :name => "index_notes_on_created_by_id"
|
644
|
+
add_index "notes", ["note_type_id"], :name => "index_notes_on_note_type_id"
|
645
|
+
add_index "notes", ["noted_record_id", "noted_record_type"], :name => "index_notes_on_noted_record_id_and_noted_record_type"
|
646
|
+
|
647
|
+
create_table "organizations", :force => true do |t|
|
648
|
+
t.string "description"
|
649
|
+
t.string "tax_id_number"
|
650
|
+
t.datetime "created_at", :null => false
|
651
|
+
t.datetime "updated_at", :null => false
|
652
|
+
end
|
653
|
+
|
654
|
+
create_table "parties", :force => true do |t|
|
655
|
+
t.string "description"
|
656
|
+
t.integer "business_party_id"
|
657
|
+
t.string "business_party_type"
|
658
|
+
t.integer "list_view_image_id"
|
659
|
+
t.string "enterprise_identifier"
|
660
|
+
t.datetime "created_at", :null => false
|
661
|
+
t.datetime "updated_at", :null => false
|
662
|
+
end
|
663
|
+
|
664
|
+
add_index "parties", ["business_party_id", "business_party_type"], :name => "besi_1"
|
665
|
+
|
666
|
+
create_table "party_relationships", :force => true do |t|
|
667
|
+
t.string "description"
|
668
|
+
t.integer "party_id_from"
|
669
|
+
t.integer "party_id_to"
|
670
|
+
t.integer "role_type_id_from"
|
671
|
+
t.integer "role_type_id_to"
|
672
|
+
t.integer "status_type_id"
|
673
|
+
t.integer "priority_type_id"
|
674
|
+
t.integer "relationship_type_id"
|
675
|
+
t.date "from_date"
|
676
|
+
t.date "thru_date"
|
677
|
+
t.string "external_identifier"
|
678
|
+
t.string "external_id_source"
|
679
|
+
t.datetime "created_at", :null => false
|
680
|
+
t.datetime "updated_at", :null => false
|
681
|
+
end
|
682
|
+
|
683
|
+
add_index "party_relationships", ["priority_type_id"], :name => "index_party_relationships_on_priority_type_id"
|
684
|
+
add_index "party_relationships", ["relationship_type_id"], :name => "index_party_relationships_on_relationship_type_id"
|
685
|
+
add_index "party_relationships", ["status_type_id"], :name => "index_party_relationships_on_status_type_id"
|
686
|
+
|
687
|
+
create_table "party_roles", :force => true do |t|
|
688
|
+
t.string "type"
|
689
|
+
t.integer "party_id"
|
690
|
+
t.integer "role_type_id"
|
691
|
+
t.datetime "created_at", :null => false
|
692
|
+
t.datetime "updated_at", :null => false
|
693
|
+
end
|
694
|
+
|
695
|
+
add_index "party_roles", ["party_id"], :name => "index_party_roles_on_party_id"
|
696
|
+
add_index "party_roles", ["role_type_id"], :name => "index_party_roles_on_role_type_id"
|
697
|
+
|
698
|
+
create_table "party_search_facts", :force => true do |t|
|
699
|
+
t.integer "party_id"
|
700
|
+
t.string "eid"
|
701
|
+
t.string "type"
|
702
|
+
t.text "roles"
|
703
|
+
t.string "party_description"
|
704
|
+
t.string "party_business_party_type"
|
705
|
+
t.string "user_login"
|
706
|
+
t.string "individual_current_last_name"
|
707
|
+
t.string "individual_current_first_name"
|
708
|
+
t.string "individual_current_middle_name"
|
709
|
+
t.string "individual_birth_date"
|
710
|
+
t.string "individual_ssn"
|
711
|
+
t.string "party_phone_number"
|
712
|
+
t.string "party_email_address"
|
713
|
+
t.string "party_address_1"
|
714
|
+
t.string "party_address_2"
|
715
|
+
t.string "party_primary_address_city"
|
716
|
+
t.string "party_primary_address_state"
|
717
|
+
t.string "party_primary_address_zip"
|
718
|
+
t.string "party_primary_address_country"
|
719
|
+
t.boolean "user_enabled"
|
720
|
+
t.string "user_type"
|
721
|
+
t.boolean "reindex"
|
722
|
+
t.datetime "created_at", :null => false
|
723
|
+
t.datetime "updated_at", :null => false
|
724
|
+
end
|
725
|
+
|
726
|
+
create_table "phone_numbers", :force => true do |t|
|
727
|
+
t.string "phone_number"
|
728
|
+
t.string "description"
|
729
|
+
t.datetime "created_at", :null => false
|
730
|
+
t.datetime "updated_at", :null => false
|
731
|
+
end
|
732
|
+
|
733
|
+
create_table "postal_addresses", :force => true do |t|
|
734
|
+
t.string "address_line_1"
|
735
|
+
t.string "address_line_2"
|
736
|
+
t.string "city"
|
737
|
+
t.string "state"
|
738
|
+
t.string "zip"
|
739
|
+
t.string "country"
|
740
|
+
t.string "description"
|
741
|
+
t.integer "geo_country_id"
|
742
|
+
t.integer "geo_zone_id"
|
743
|
+
t.datetime "created_at", :null => false
|
744
|
+
t.datetime "updated_at", :null => false
|
745
|
+
end
|
746
|
+
|
747
|
+
add_index "postal_addresses", ["geo_country_id"], :name => "index_postal_addresses_on_geo_country_id"
|
748
|
+
add_index "postal_addresses", ["geo_zone_id"], :name => "index_postal_addresses_on_geo_zone_id"
|
749
|
+
|
750
|
+
create_table "preference_options", :force => true do |t|
|
751
|
+
t.string "description"
|
752
|
+
t.string "internal_identifier"
|
753
|
+
t.string "value"
|
754
|
+
t.datetime "created_at", :null => false
|
755
|
+
t.datetime "updated_at", :null => false
|
756
|
+
end
|
757
|
+
|
758
|
+
create_table "preference_options_preference_types", :id => false, :force => true do |t|
|
759
|
+
t.integer "preference_type_id"
|
760
|
+
t.integer "preference_option_id"
|
761
|
+
end
|
762
|
+
|
763
|
+
add_index "preference_options_preference_types", ["preference_option_id"], :name => "pref_opt_pref_type_pref_opt_id_idx"
|
764
|
+
add_index "preference_options_preference_types", ["preference_type_id"], :name => "pref_opt_pref_type_pref_type_id_idx"
|
765
|
+
|
766
|
+
create_table "preference_types", :force => true do |t|
|
767
|
+
t.string "description"
|
768
|
+
t.string "internal_identifier"
|
769
|
+
t.integer "default_pref_option_id"
|
770
|
+
t.datetime "created_at", :null => false
|
771
|
+
t.datetime "updated_at", :null => false
|
772
|
+
end
|
773
|
+
|
774
|
+
add_index "preference_types", ["default_pref_option_id"], :name => "index_preference_types_on_default_pref_option_id"
|
775
|
+
|
776
|
+
create_table "preferences", :force => true do |t|
|
777
|
+
t.integer "preference_option_id"
|
778
|
+
t.integer "preference_type_id"
|
779
|
+
t.datetime "created_at", :null => false
|
780
|
+
t.datetime "updated_at", :null => false
|
781
|
+
end
|
782
|
+
|
783
|
+
add_index "preferences", ["preference_option_id"], :name => "index_preferences_on_preference_option_id"
|
784
|
+
add_index "preferences", ["preference_type_id"], :name => "index_preferences_on_preference_type_id"
|
785
|
+
|
786
|
+
create_table "published_elements", :force => true do |t|
|
787
|
+
t.integer "published_website_id"
|
788
|
+
t.integer "published_element_record_id"
|
789
|
+
t.string "published_element_record_type"
|
790
|
+
t.integer "version"
|
791
|
+
t.integer "published_by_id"
|
792
|
+
t.datetime "created_at", :null => false
|
793
|
+
t.datetime "updated_at", :null => false
|
794
|
+
end
|
795
|
+
|
796
|
+
add_index "published_elements", ["published_by_id"], :name => "index_published_elements_on_published_by_id"
|
797
|
+
add_index "published_elements", ["published_element_record_id", "published_element_record_type"], :name => "published_elm_idx"
|
798
|
+
add_index "published_elements", ["published_website_id"], :name => "index_published_elements_on_published_website_id"
|
799
|
+
add_index "published_elements", ["version"], :name => "index_published_elements_on_version"
|
800
|
+
|
801
|
+
create_table "published_websites", :force => true do |t|
|
802
|
+
t.integer "website_id"
|
803
|
+
t.text "comment"
|
804
|
+
t.decimal "version", :precision => 18, :scale => 6
|
805
|
+
t.boolean "active"
|
806
|
+
t.integer "published_by_id"
|
807
|
+
t.datetime "created_at", :null => false
|
808
|
+
t.datetime "updated_at", :null => false
|
809
|
+
end
|
810
|
+
|
811
|
+
add_index "published_websites", ["active"], :name => "index_published_websites_on_active"
|
812
|
+
add_index "published_websites", ["published_by_id"], :name => "index_published_websites_on_published_by_id"
|
813
|
+
add_index "published_websites", ["version"], :name => "index_published_websites_on_version"
|
814
|
+
add_index "published_websites", ["website_id"], :name => "index_published_websites_on_website_id"
|
815
|
+
|
816
|
+
create_table "relationship_types", :force => true do |t|
|
817
|
+
t.integer "parent_id"
|
818
|
+
t.integer "lft"
|
819
|
+
t.integer "rgt"
|
820
|
+
t.integer "valid_from_role_type_id"
|
821
|
+
t.integer "valid_to_role_type_id"
|
822
|
+
t.string "name"
|
823
|
+
t.string "description"
|
824
|
+
t.string "internal_identifier"
|
825
|
+
t.string "external_identifier"
|
826
|
+
t.string "external_id_source"
|
827
|
+
t.datetime "created_at", :null => false
|
828
|
+
t.datetime "updated_at", :null => false
|
829
|
+
end
|
830
|
+
|
831
|
+
add_index "relationship_types", ["valid_from_role_type_id"], :name => "index_relationship_types_on_valid_from_role_type_id"
|
832
|
+
add_index "relationship_types", ["valid_to_role_type_id"], :name => "index_relationship_types_on_valid_to_role_type_id"
|
833
|
+
|
834
|
+
create_table "role_types", :force => true do |t|
|
835
|
+
t.integer "parent_id"
|
836
|
+
t.integer "lft"
|
837
|
+
t.integer "rgt"
|
838
|
+
t.string "description"
|
839
|
+
t.string "comments"
|
840
|
+
t.string "internal_identifier"
|
841
|
+
t.string "external_identifier"
|
842
|
+
t.string "external_id_source"
|
843
|
+
t.datetime "created_at", :null => false
|
844
|
+
t.datetime "updated_at", :null => false
|
845
|
+
end
|
846
|
+
|
847
|
+
create_table "roles", :force => true do |t|
|
848
|
+
t.string "description"
|
849
|
+
t.string "internal_identifier"
|
850
|
+
t.string "external_identifier"
|
851
|
+
t.string "external_id_source"
|
852
|
+
t.datetime "created_at", :null => false
|
853
|
+
t.datetime "updated_at", :null => false
|
854
|
+
end
|
855
|
+
|
856
|
+
create_table "roles_secured_models", :id => false, :force => true do |t|
|
857
|
+
t.integer "secured_model_id"
|
858
|
+
t.integer "role_id"
|
859
|
+
end
|
860
|
+
|
861
|
+
add_index "roles_secured_models", ["role_id"], :name => "index_roles_secured_models_on_role_id"
|
862
|
+
add_index "roles_secured_models", ["secured_model_id"], :name => "index_roles_secured_models_on_secured_model_id"
|
863
|
+
|
864
|
+
create_table "secured_models", :force => true do |t|
|
865
|
+
t.integer "secured_record_id"
|
866
|
+
t.string "secured_record_type"
|
867
|
+
t.datetime "created_at", :null => false
|
868
|
+
t.datetime "updated_at", :null => false
|
869
|
+
end
|
870
|
+
|
871
|
+
add_index "secured_models", ["secured_record_id", "secured_record_type"], :name => "secured_record_idx"
|
872
|
+
|
873
|
+
create_table "sessions", :force => true do |t|
|
874
|
+
t.string "session_id", :null => false
|
875
|
+
t.text "data"
|
876
|
+
t.datetime "created_at", :null => false
|
877
|
+
t.datetime "updated_at", :null => false
|
878
|
+
end
|
879
|
+
|
880
|
+
add_index "sessions", ["session_id"], :name => "index_sessions_on_session_id"
|
881
|
+
add_index "sessions", ["updated_at"], :name => "index_sessions_on_updated_at"
|
882
|
+
|
883
|
+
create_table "taggings", :force => true do |t|
|
884
|
+
t.integer "tag_id"
|
885
|
+
t.integer "taggable_id"
|
886
|
+
t.integer "tagger_id"
|
887
|
+
t.string "tagger_type"
|
888
|
+
t.string "taggable_type"
|
889
|
+
t.string "context"
|
890
|
+
t.datetime "created_at"
|
891
|
+
end
|
892
|
+
|
893
|
+
add_index "taggings", ["tag_id"], :name => "index_taggings_on_tag_id"
|
894
|
+
add_index "taggings", ["taggable_id", "taggable_type", "context"], :name => "taggable_poly_idx"
|
895
|
+
|
896
|
+
create_table "tags", :force => true do |t|
|
897
|
+
t.string "name"
|
898
|
+
end
|
899
|
+
|
900
|
+
create_table "themes", :force => true do |t|
|
901
|
+
t.integer "website_id"
|
902
|
+
t.string "name"
|
903
|
+
t.string "theme_id"
|
904
|
+
t.string "author"
|
905
|
+
t.integer "version"
|
906
|
+
t.string "homepage"
|
907
|
+
t.text "summary"
|
908
|
+
t.integer "active"
|
909
|
+
t.datetime "created_at", :null => false
|
910
|
+
t.datetime "updated_at", :null => false
|
911
|
+
end
|
912
|
+
|
913
|
+
add_index "themes", ["active"], :name => "index_themes_on_active"
|
914
|
+
add_index "themes", ["website_id"], :name => "index_themes_on_website_id"
|
915
|
+
|
916
|
+
create_table "tickets", :force => true do |t|
|
917
|
+
t.datetime "created_at", :null => false
|
918
|
+
t.datetime "updated_at", :null => false
|
919
|
+
end
|
920
|
+
|
921
|
+
create_table "tree_menu_node_defs", :force => true do |t|
|
922
|
+
t.string "node_type"
|
923
|
+
t.integer "parent_id"
|
924
|
+
t.integer "lft"
|
925
|
+
t.integer "rgt"
|
926
|
+
t.string "menu_short_name"
|
927
|
+
t.string "menu_description"
|
928
|
+
t.string "text"
|
929
|
+
t.string "icon_url"
|
930
|
+
t.string "target_url"
|
931
|
+
t.string "resource_class"
|
932
|
+
t.datetime "created_at", :null => false
|
933
|
+
t.datetime "updated_at", :null => false
|
934
|
+
end
|
935
|
+
|
936
|
+
add_index "tree_menu_node_defs", ["parent_id"], :name => "index_tree_menu_node_defs_on_parent_id"
|
937
|
+
|
938
|
+
create_table "user_preferences", :force => true do |t|
|
939
|
+
t.integer "user_id"
|
940
|
+
t.integer "preference_id"
|
941
|
+
t.integer "preferenced_record_id"
|
942
|
+
t.string "preferenced_record_type"
|
943
|
+
t.datetime "created_at", :null => false
|
944
|
+
t.datetime "updated_at", :null => false
|
945
|
+
end
|
946
|
+
|
947
|
+
add_index "user_preferences", ["preference_id"], :name => "index_user_preferences_on_preference_id"
|
948
|
+
add_index "user_preferences", ["preferenced_record_id"], :name => "index_user_preferences_on_preferenced_record_id"
|
949
|
+
add_index "user_preferences", ["preferenced_record_type"], :name => "index_user_preferences_on_preferenced_record_type"
|
950
|
+
add_index "user_preferences", ["user_id"], :name => "index_user_preferences_on_user_id"
|
951
|
+
|
952
|
+
create_table "users", :force => true do |t|
|
953
|
+
t.string "username"
|
954
|
+
t.string "email"
|
955
|
+
t.integer "party_id"
|
956
|
+
t.string "type"
|
957
|
+
t.string "salt"
|
958
|
+
t.string "crypted_password"
|
959
|
+
t.datetime "last_login_at"
|
960
|
+
t.datetime "last_logout_at"
|
961
|
+
t.datetime "last_activity_at"
|
962
|
+
t.integer "failed_logins_count", :default => 0
|
963
|
+
t.datetime "lock_expires_at"
|
964
|
+
t.string "remember_me_token"
|
965
|
+
t.datetime "remember_me_token_expires_at"
|
966
|
+
t.string "reset_password_token"
|
967
|
+
t.datetime "reset_password_token_expires_at"
|
968
|
+
t.datetime "reset_password_email_sent_at"
|
969
|
+
t.string "activation_state"
|
970
|
+
t.string "activation_token"
|
971
|
+
t.datetime "activation_token_expires_at"
|
972
|
+
t.string "security_question_1"
|
973
|
+
t.string "security_answer_1"
|
974
|
+
t.string "security_question_2"
|
975
|
+
t.string "security_answer_2"
|
976
|
+
t.datetime "created_at", :null => false
|
977
|
+
t.datetime "updated_at", :null => false
|
978
|
+
end
|
979
|
+
|
980
|
+
add_index "users", ["activation_token"], :name => "index_users_on_activation_token"
|
981
|
+
add_index "users", ["email"], :name => "index_users_on_email", :unique => true
|
982
|
+
add_index "users", ["last_logout_at", "last_activity_at"], :name => "activity_idx"
|
983
|
+
add_index "users", ["remember_me_token"], :name => "index_users_on_remember_me_token"
|
984
|
+
add_index "users", ["reset_password_token"], :name => "index_users_on_reset_password_token"
|
985
|
+
add_index "users", ["username"], :name => "index_users_on_username", :unique => true
|
986
|
+
|
987
|
+
create_table "valid_configurations", :force => true do |t|
|
988
|
+
t.integer "configured_item_id"
|
989
|
+
t.string "configured_item_type"
|
990
|
+
t.integer "configuration_id"
|
991
|
+
t.datetime "created_at", :null => false
|
992
|
+
t.datetime "updated_at", :null => false
|
993
|
+
end
|
994
|
+
|
995
|
+
add_index "valid_configurations", ["configuration_id"], :name => "index_valid_configurations_on_configuration_id"
|
996
|
+
add_index "valid_configurations", ["configured_item_id", "configured_item_type"], :name => "configured_item_poly_idx"
|
997
|
+
|
998
|
+
create_table "valid_documents", :force => true do |t|
|
999
|
+
t.integer "document_id"
|
1000
|
+
t.integer "documented_model_id"
|
1001
|
+
t.string "documented_model_type"
|
1002
|
+
end
|
1003
|
+
|
1004
|
+
add_index "valid_documents", ["document_id"], :name => "index_valid_documents_on_document_id"
|
1005
|
+
add_index "valid_documents", ["documented_model_id", "documented_model_type"], :name => "valid_documents_model_idx"
|
1006
|
+
|
1007
|
+
create_table "valid_note_types", :force => true do |t|
|
1008
|
+
t.integer "valid_note_type_record_id"
|
1009
|
+
t.string "valid_note_type_record_type"
|
1010
|
+
t.integer "note_type_id"
|
1011
|
+
t.datetime "created_at", :null => false
|
1012
|
+
t.datetime "updated_at", :null => false
|
1013
|
+
end
|
1014
|
+
|
1015
|
+
add_index "valid_note_types", ["note_type_id"], :name => "index_valid_note_types_on_note_type_id"
|
1016
|
+
add_index "valid_note_types", ["valid_note_type_record_id", "valid_note_type_record_type"], :name => "valid_note_type_record_idx"
|
1017
|
+
|
1018
|
+
create_table "valid_preference_types", :force => true do |t|
|
1019
|
+
t.integer "preference_type_id"
|
1020
|
+
t.integer "preferenced_record_id"
|
1021
|
+
t.string "preferenced_record_type"
|
1022
|
+
end
|
1023
|
+
|
1024
|
+
create_table "view_types", :force => true do |t|
|
1025
|
+
t.string "internal_identifier"
|
1026
|
+
t.string "description"
|
1027
|
+
t.datetime "created_at", :null => false
|
1028
|
+
t.datetime "updated_at", :null => false
|
1029
|
+
end
|
1030
|
+
|
1031
|
+
create_table "website_hosts", :force => true do |t|
|
1032
|
+
t.integer "website_id"
|
1033
|
+
t.string "host"
|
1034
|
+
t.datetime "created_at", :null => false
|
1035
|
+
t.datetime "updated_at", :null => false
|
1036
|
+
end
|
1037
|
+
|
1038
|
+
add_index "website_hosts", ["website_id"], :name => "index_website_hosts_on_website_id"
|
1039
|
+
|
1040
|
+
create_table "website_inquiries", :force => true do |t|
|
1041
|
+
t.integer "website_id"
|
1042
|
+
t.datetime "created_at", :null => false
|
1043
|
+
t.datetime "updated_at", :null => false
|
1044
|
+
end
|
1045
|
+
|
1046
|
+
add_index "website_inquiries", ["website_id"], :name => "index_website_inquiries_on_website_id"
|
1047
|
+
|
1048
|
+
create_table "website_nav_items", :force => true do |t|
|
1049
|
+
t.integer "website_nav_id"
|
1050
|
+
t.string "title"
|
1051
|
+
t.string "url"
|
1052
|
+
t.integer "position", :default => 0
|
1053
|
+
t.integer "linked_to_item_id"
|
1054
|
+
t.string "linked_to_item_type"
|
1055
|
+
t.integer "parent_id"
|
1056
|
+
t.integer "lft"
|
1057
|
+
t.integer "rgt"
|
1058
|
+
t.datetime "created_at", :null => false
|
1059
|
+
t.datetime "updated_at", :null => false
|
1060
|
+
end
|
1061
|
+
|
1062
|
+
add_index "website_nav_items", ["lft"], :name => "index_website_nav_items_on_lft"
|
1063
|
+
add_index "website_nav_items", ["linked_to_item_id", "linked_to_item_type"], :name => "linked_to_idx"
|
1064
|
+
add_index "website_nav_items", ["parent_id"], :name => "index_website_nav_items_on_parent_id"
|
1065
|
+
add_index "website_nav_items", ["position"], :name => "index_website_nav_items_on_position"
|
1066
|
+
add_index "website_nav_items", ["rgt"], :name => "index_website_nav_items_on_rgt"
|
1067
|
+
add_index "website_nav_items", ["website_nav_id"], :name => "index_website_nav_items_on_website_nav_id"
|
1068
|
+
|
1069
|
+
create_table "website_navs", :force => true do |t|
|
1070
|
+
t.integer "website_id"
|
1071
|
+
t.string "name"
|
1072
|
+
t.datetime "created_at", :null => false
|
1073
|
+
t.datetime "updated_at", :null => false
|
1074
|
+
end
|
1075
|
+
|
1076
|
+
add_index "website_navs", ["website_id"], :name => "index_website_navs_on_website_id"
|
1077
|
+
|
1078
|
+
create_table "website_party_roles", :force => true do |t|
|
1079
|
+
t.integer "website_id"
|
1080
|
+
t.integer "role_type_id"
|
1081
|
+
t.integer "party_id"
|
1082
|
+
t.datetime "created_at", :null => false
|
1083
|
+
t.datetime "updated_at", :null => false
|
1084
|
+
end
|
1085
|
+
|
1086
|
+
add_index "website_party_roles", ["party_id"], :name => "index_website_party_roles_on_party_id"
|
1087
|
+
add_index "website_party_roles", ["role_type_id"], :name => "index_website_party_roles_on_role_type_id"
|
1088
|
+
add_index "website_party_roles", ["website_id"], :name => "index_website_party_roles_on_website_id"
|
1089
|
+
|
1090
|
+
create_table "website_section_contents", :force => true do |t|
|
1091
|
+
t.integer "website_section_id"
|
1092
|
+
t.integer "content_id"
|
1093
|
+
t.string "content_area"
|
1094
|
+
t.integer "position", :default => 0
|
1095
|
+
t.datetime "created_at", :null => false
|
1096
|
+
t.datetime "updated_at", :null => false
|
1097
|
+
end
|
1098
|
+
|
1099
|
+
add_index "website_section_contents", ["content_area"], :name => "index_website_section_contents_on_content_area"
|
1100
|
+
add_index "website_section_contents", ["content_id"], :name => "index_website_section_contents_on_content_id"
|
1101
|
+
add_index "website_section_contents", ["position"], :name => "index_website_section_contents_on_position"
|
1102
|
+
add_index "website_section_contents", ["website_section_id"], :name => "index_website_section_contents_on_website_section_id"
|
1103
|
+
|
1104
|
+
create_table "website_section_versions", :force => true do |t|
|
1105
|
+
t.integer "website_section_id"
|
1106
|
+
t.integer "version"
|
1107
|
+
t.string "title"
|
1108
|
+
t.integer "website_id"
|
1109
|
+
t.string "path"
|
1110
|
+
t.string "permalink"
|
1111
|
+
t.text "layout"
|
1112
|
+
t.boolean "in_menu"
|
1113
|
+
t.integer "position", :default => 0
|
1114
|
+
t.string "internal_identifier"
|
1115
|
+
t.boolean "render_base_layout", :default => true
|
1116
|
+
t.datetime "created_at"
|
1117
|
+
t.datetime "updated_at"
|
1118
|
+
t.string "versioned_type"
|
1119
|
+
end
|
1120
|
+
|
1121
|
+
add_index "website_section_versions", ["website_section_id"], :name => "index_website_section_versions_on_website_section_id"
|
1122
|
+
|
1123
|
+
create_table "website_sections", :force => true do |t|
|
1124
|
+
t.string "title"
|
1125
|
+
t.string "type"
|
1126
|
+
t.integer "website_id"
|
1127
|
+
t.string "path"
|
1128
|
+
t.string "permalink"
|
1129
|
+
t.text "layout"
|
1130
|
+
t.boolean "in_menu"
|
1131
|
+
t.integer "position", :default => 0
|
1132
|
+
t.string "internal_identifier"
|
1133
|
+
t.integer "version"
|
1134
|
+
t.boolean "render_base_layout", :default => true
|
1135
|
+
t.integer "parent_id"
|
1136
|
+
t.integer "lft"
|
1137
|
+
t.integer "rgt"
|
1138
|
+
t.datetime "created_at", :null => false
|
1139
|
+
t.datetime "updated_at", :null => false
|
1140
|
+
end
|
1141
|
+
|
1142
|
+
add_index "website_sections", ["internal_identifier"], :name => "section_iid_idx"
|
1143
|
+
add_index "website_sections", ["lft"], :name => "index_website_sections_on_lft"
|
1144
|
+
add_index "website_sections", ["parent_id"], :name => "index_website_sections_on_parent_id"
|
1145
|
+
add_index "website_sections", ["permalink"], :name => "index_website_sections_on_permalink"
|
1146
|
+
add_index "website_sections", ["position"], :name => "index_website_sections_on_position"
|
1147
|
+
add_index "website_sections", ["rgt"], :name => "index_website_sections_on_rgt"
|
1148
|
+
add_index "website_sections", ["version"], :name => "index_website_sections_on_version"
|
1149
|
+
add_index "website_sections", ["website_id"], :name => "index_website_sections_on_website_id"
|
1150
|
+
|
1151
|
+
create_table "websites", :force => true do |t|
|
1152
|
+
t.string "name"
|
1153
|
+
t.string "title"
|
1154
|
+
t.string "subtitle"
|
1155
|
+
t.string "internal_identifier"
|
1156
|
+
t.string "email"
|
1157
|
+
t.boolean "auto_activate_publication"
|
1158
|
+
t.boolean "email_inquiries"
|
1159
|
+
t.datetime "created_at", :null => false
|
1160
|
+
t.datetime "updated_at", :null => false
|
1161
|
+
end
|
1162
|
+
|
1163
|
+
create_table "widgets", :force => true do |t|
|
1164
|
+
t.string "description"
|
1165
|
+
t.string "internal_identifier"
|
1166
|
+
t.string "icon"
|
1167
|
+
t.string "xtype"
|
1168
|
+
t.datetime "created_at", :null => false
|
1169
|
+
t.datetime "updated_at", :null => false
|
1170
|
+
end
|
1171
|
+
|
1172
|
+
end
|