erp_app 3.1.11 → 3.1.12
Sign up to get free protection for your applications and to get access to all the features.
- data/app/controllers/erp_app/desktop/tail/base_controller.rb +33 -0
- data/config/routes.rb +3 -0
- data/db/data_migrations/20130703181549_create_tail_desktop_application.rb +22 -0
- data/lib/erp_app/version.rb +1 -1
- data/public/javascripts/erp_app/desktop/applications/tail/module.js +36 -0
- data/public/javascripts/erp_app/desktop/applications/tail/tail_panel.js +145 -0
- data/public/javascripts/erp_app/mobile/applications/job_tracker/view/templates.js +16 -16
- data/public/stylesheets/erp_app/shared/compass-ext-all.css +5 -0
- data/spec/dummy/db/data_migrations/20130422163128_add_usd_currency.erp_base_erp_svcs.rb +12 -0
- data/spec/dummy/db/data_migrations/20130422163129_add_iso_codes.erp_base_erp_svcs.rb +19 -0
- data/spec/dummy/db/data_migrations/20130422163130_setup_compass_ae_instance.erp_base_erp_svcs.rb +21 -0
- data/spec/dummy/db/data_migrations/20130422163131_upgrade_compass_ae_instances_data.erp_base_erp_svcs.rb +19 -0
- data/spec/dummy/db/data_migrations/20130422163132_add_guid_to_instances.erp_base_erp_svcs.rb +10 -0
- data/spec/dummy/db/data_migrations/20130422163133_create_capability_scope_types.erp_tech_svcs.rb +15 -0
- data/spec/dummy/db/data_migrations/20130422163134_schedule_delete_expired_sessions_job.erp_tech_svcs.rb +16 -0
- data/spec/dummy/db/data_migrations/20130422163135_setup_audit_log_types.erp_tech_svcs.rb +22 -0
- data/spec/dummy/db/data_migrations/20130422163136_create_group_relationship_and_role_types.erp_tech_svcs.rb +20 -0
- data/spec/dummy/db/data_migrations/20130422163137_note_capabilities.erp_tech_svcs.rb +24 -0
- data/spec/dummy/db/data_migrations/20130422163138_erp_app_setup.erp_app.rb +252 -0
- data/spec/dummy/db/data_migrations/20130422163139_update_preferences.erp_app.rb +53 -0
- data/spec/dummy/db/data_migrations/20130422163140_create_desktop_app_audit_log_viewer.erp_app.rb +24 -0
- data/spec/dummy/db/data_migrations/20130422163141_add_file_manager_application.erp_app.rb +32 -0
- data/spec/dummy/db/data_migrations/20130422163142_add_default_capabilities.erp_app.rb +23 -0
- data/spec/dummy/db/data_migrations/20130422163143_add_new_contact_widgets.erp_app.rb +42 -0
- data/spec/dummy/db/data_migrations/20130422163144_add_userinfo_widget.erp_app.rb +29 -0
- data/spec/dummy/db/data_migrations/20130422163145_create_party_and_role_type_for_communication_events.erp_app.rb +11 -0
- data/spec/dummy/db/data_migrations/20130422163146_create_user_management_mobile_application.erp_app.rb +17 -0
- data/spec/dummy/db/data_migrations/20130422163147_create_configuration_management_desktop_application.erp_app.rb +27 -0
- data/spec/dummy/db/data_migrations/20130422163148_create_job_tracker_desktop_application.erp_app.rb +23 -0
- data/spec/dummy/db/data_migrations/20130422163149_created_tracked_jobs.erp_app.rb +15 -0
- data/spec/dummy/db/data_migrations/20130422163150_upgrade_remove_system_mgmt_app.erp_app.rb +16 -0
- data/spec/dummy/db/data_migrations/20130422163151_create_security_management_desktop_application.erp_app.rb +29 -0
- data/spec/dummy/db/data_migrations/20130422163152_add_job_tracker_mobile_app.erp_app.rb +17 -0
- data/spec/dummy/db/migrate/20130422163121_base_erp_services.erp_base_erp_svcs.rb +486 -0
- data/spec/dummy/db/migrate/20130422163122_add_txn_status.erp_base_erp_svcs.rb +37 -0
- data/spec/dummy/db/migrate/20130422163123_upgrade_compass_ae_instances.erp_base_erp_svcs.rb +34 -0
- data/spec/dummy/db/migrate/20130422163124_add_uuid_compass_ae_instance.erp_base_erp_svcs.rb +17 -0
- data/spec/dummy/db/migrate/20130422163125_add_long_lat_to_address.erp_base_erp_svcs.rb +16 -0
- data/spec/dummy/db/migrate/20130422163126_base_tech_services.erp_tech_svcs.rb +271 -0
- data/spec/dummy/db/migrate/20130422163127_create_has_attribute_tables.erp_tech_svcs.rb +39 -0
- data/spec/dummy/db/migrate/20130422163128_create_groups.erp_tech_svcs.rb +19 -0
- data/spec/dummy/db/migrate/20130422163129_upgrade_security.erp_tech_svcs.rb +54 -0
- data/spec/dummy/db/migrate/20130422163130_upgrade_security2.erp_tech_svcs.rb +275 -0
- data/spec/dummy/db/migrate/20130422163131_add_queue_to_delayed_jobs.erp_tech_svcs.rb +14 -0
- data/spec/dummy/db/migrate/20130422163132_base_app_framework.erp_app.rb +276 -0
- data/spec/dummy/db/migrate/20130422163133_add_job_tracker.erp_app.rb +20 -0
- data/spec/dummy/db/migrate/20130422163134_update_mobile_application.erp_app.rb +28 -0
- data/spec/dummy/db/schema.rb +883 -0
- data/spec/dummy/db/spec.sqlite3 +0 -0
- metadata +89 -3
@@ -0,0 +1,486 @@
|
|
1
|
+
# This migration comes from erp_base_erp_svcs (originally 20080805000020)
|
2
|
+
class BaseErpServices < ActiveRecord::Migration
|
3
|
+
def self.up
|
4
|
+
|
5
|
+
unless table_exists?(:compass_ae_instances)
|
6
|
+
create_table :compass_ae_instances do |t|
|
7
|
+
t.string :description
|
8
|
+
t.string :internal_identifier
|
9
|
+
t.decimal :version, :precision => 8, :scale => 3
|
10
|
+
t.string :type
|
11
|
+
t.string :schema, :default => 'public'
|
12
|
+
t.integer :parent_id
|
13
|
+
|
14
|
+
t.timestamps
|
15
|
+
end
|
16
|
+
|
17
|
+
add_index :compass_ae_instances, :internal_identifier, :name => "iid_idx"
|
18
|
+
add_index :compass_ae_instances, :schema, :name => "schema_idx"
|
19
|
+
add_index :compass_ae_instances, :type, :name => "type_idx"
|
20
|
+
add_index :compass_ae_instances, :parent_id, :name => "parent_id_idx"
|
21
|
+
end
|
22
|
+
|
23
|
+
unless table_exists?(:compass_ae_instance_party_roles)
|
24
|
+
create_table :compass_ae_instance_party_roles do |t|
|
25
|
+
t.string :description
|
26
|
+
t.integer :compass_ae_instance_id
|
27
|
+
t.integer :party_id
|
28
|
+
t.integer :role_type_id
|
29
|
+
|
30
|
+
t.timestamps
|
31
|
+
end
|
32
|
+
|
33
|
+
add_index :compass_ae_instance_party_roles, :compass_ae_instance_id, :name => "compass_ae_instance_id_idx"
|
34
|
+
add_index :compass_ae_instance_party_roles, :party_id, :name => "party_id_idx"
|
35
|
+
add_index :compass_ae_instance_party_roles, :role_type_id, :name => "role_type_id_idx"
|
36
|
+
end
|
37
|
+
|
38
|
+
# Create parties table
|
39
|
+
unless table_exists?(:parties)
|
40
|
+
create_table :parties do |t|
|
41
|
+
t.column :description, :string
|
42
|
+
t.column :business_party_id, :integer
|
43
|
+
t.column :business_party_type, :string
|
44
|
+
t.column :list_view_image_id, :integer
|
45
|
+
|
46
|
+
#This field is here to provide a direct way to map CompassAE
|
47
|
+
#business parties to unified idenfiers in organizations if they
|
48
|
+
#have been implemented in an enterprise.
|
49
|
+
t.column :enterprise_identifier, :string
|
50
|
+
t.timestamps
|
51
|
+
end
|
52
|
+
add_index :parties, [:business_party_id, :business_party_type], :name => "besi_1"
|
53
|
+
end
|
54
|
+
|
55
|
+
# Create party_roles table
|
56
|
+
unless table_exists?(:party_roles)
|
57
|
+
create_table :party_roles do |t|
|
58
|
+
#this column holds the class name of the
|
59
|
+
#subtype of party-to-role_type relatsionship
|
60
|
+
t.column :type, :string
|
61
|
+
#xref between party and role_type
|
62
|
+
t.column :party_id, :integer
|
63
|
+
t.column :role_type_id, :integer
|
64
|
+
t.timestamps
|
65
|
+
end
|
66
|
+
add_index :party_roles, :party_id
|
67
|
+
add_index :party_roles, :role_type_id
|
68
|
+
end
|
69
|
+
|
70
|
+
|
71
|
+
# Create role_types table
|
72
|
+
unless table_exists?(:role_types)
|
73
|
+
create_table :role_types do |t|
|
74
|
+
#these columns are required to support the behavior of the plugin 'awesome_nested_set'
|
75
|
+
t.column :parent_id, :integer
|
76
|
+
t.column :lft, :integer
|
77
|
+
t.column :rgt, :integer
|
78
|
+
|
79
|
+
#custom columns go here
|
80
|
+
t.column :description, :string
|
81
|
+
t.column :comments, :string
|
82
|
+
t.column :internal_identifier, :string
|
83
|
+
t.column :external_identifier, :string
|
84
|
+
t.column :external_id_source, :string
|
85
|
+
t.timestamps
|
86
|
+
end
|
87
|
+
end
|
88
|
+
|
89
|
+
# Create relationship_types table
|
90
|
+
unless table_exists?(:relationship_types)
|
91
|
+
create_table :relationship_types do |t|
|
92
|
+
t.column :parent_id, :integer
|
93
|
+
t.column :lft, :integer
|
94
|
+
t.column :rgt, :integer
|
95
|
+
|
96
|
+
#custom columns go here
|
97
|
+
t.column :valid_from_role_type_id, :integer
|
98
|
+
t.column :valid_to_role_type_id, :integer
|
99
|
+
t.column :name, :string
|
100
|
+
t.column :description, :string
|
101
|
+
|
102
|
+
t.column :internal_identifier, :string
|
103
|
+
t.column :external_identifier, :string
|
104
|
+
t.column :external_id_source, :string
|
105
|
+
t.timestamps
|
106
|
+
end
|
107
|
+
add_index :relationship_types, :valid_from_role_type_id
|
108
|
+
add_index :relationship_types, :valid_to_role_type_id
|
109
|
+
end
|
110
|
+
|
111
|
+
# Create party_relationships table
|
112
|
+
unless table_exists?(:party_relationships)
|
113
|
+
create_table :party_relationships do |t|
|
114
|
+
t.column :description, :string
|
115
|
+
t.column :party_id_from, :integer
|
116
|
+
t.column :party_id_to, :integer
|
117
|
+
t.column :role_type_id_from, :integer
|
118
|
+
t.column :role_type_id_to, :integer
|
119
|
+
t.column :status_type_id, :integer
|
120
|
+
t.column :priority_type_id, :integer
|
121
|
+
t.column :relationship_type_id, :integer
|
122
|
+
t.column :from_date, :date
|
123
|
+
t.column :thru_date, :date
|
124
|
+
t.column :external_identifier, :string
|
125
|
+
t.column :external_id_source, :string
|
126
|
+
t.timestamps
|
127
|
+
end
|
128
|
+
add_index :party_relationships, :status_type_id
|
129
|
+
add_index :party_relationships, :priority_type_id
|
130
|
+
add_index :party_relationships, :relationship_type_id
|
131
|
+
end
|
132
|
+
|
133
|
+
# Create organizations table
|
134
|
+
unless table_exists?(:organizations)
|
135
|
+
create_table :organizations do |t|
|
136
|
+
t.column :description, :string
|
137
|
+
t.column :tax_id_number, :string
|
138
|
+
t.timestamps
|
139
|
+
end
|
140
|
+
end
|
141
|
+
|
142
|
+
# Create individuals table
|
143
|
+
unless table_exists?(:individuals)
|
144
|
+
create_table :individuals do |t|
|
145
|
+
t.column :party_id, :integer
|
146
|
+
t.column :current_last_name, :string
|
147
|
+
t.column :current_first_name, :string
|
148
|
+
t.column :current_middle_name, :string
|
149
|
+
t.column :current_personal_title, :string
|
150
|
+
t.column :current_suffix, :string
|
151
|
+
t.column :current_nickname, :string
|
152
|
+
t.column :gender, :string, :limit => 1
|
153
|
+
t.column :birth_date, :date
|
154
|
+
t.column :height, :decimal, :precision => 5, :scale => 2
|
155
|
+
t.column :weight, :integer
|
156
|
+
t.column :mothers_maiden_name, :string
|
157
|
+
t.column :marital_status, :string, :limit => 1
|
158
|
+
t.column :social_security_number, :string
|
159
|
+
t.column :current_passport_number, :integer
|
160
|
+
|
161
|
+
t.column :current_passport_expire_date, :date
|
162
|
+
t.column :total_years_work_experience, :integer
|
163
|
+
t.column :comments, :string
|
164
|
+
t.column :encrypted_ssn, :string
|
165
|
+
t.column :temp_ssn, :string
|
166
|
+
t.column :salt, :string
|
167
|
+
t.column :ssn_last_four, :string
|
168
|
+
t.timestamps
|
169
|
+
end
|
170
|
+
add_index :individuals, :party_id
|
171
|
+
end
|
172
|
+
|
173
|
+
# Create contacts table
|
174
|
+
unless table_exists?(:contacts)
|
175
|
+
create_table :contacts do |t|
|
176
|
+
t.column :party_id, :integer
|
177
|
+
t.column :contact_mechanism_id, :integer
|
178
|
+
t.column :contact_mechanism_type, :string
|
179
|
+
|
180
|
+
t.column :external_identifier, :string
|
181
|
+
t.column :external_id_source, :string
|
182
|
+
|
183
|
+
t.timestamps
|
184
|
+
end
|
185
|
+
add_index :contacts, :party_id
|
186
|
+
add_index :contacts, [:contact_mechanism_id, :contact_mechanism_type], :name => "besi_2"
|
187
|
+
end
|
188
|
+
|
189
|
+
# Create contact_types
|
190
|
+
unless table_exists?(:contact_types)
|
191
|
+
create_table :contact_types do |t|
|
192
|
+
t.column :parent_id, :integer
|
193
|
+
t.column :lft, :integer
|
194
|
+
t.column :rgt, :integer
|
195
|
+
|
196
|
+
#custom columns go here
|
197
|
+
|
198
|
+
t.column :description, :string
|
199
|
+
t.column :comments, :string
|
200
|
+
|
201
|
+
t.column :internal_identifier, :string
|
202
|
+
t.column :external_identifier, :string
|
203
|
+
t.column :external_id_source, :string
|
204
|
+
|
205
|
+
t.timestamps
|
206
|
+
end
|
207
|
+
add_index :contact_types, :parent_id
|
208
|
+
end
|
209
|
+
|
210
|
+
# Create contact_purposes
|
211
|
+
unless table_exists?(:contact_purposes)
|
212
|
+
create_table :contact_purposes do |t|
|
213
|
+
|
214
|
+
t.column :parent_id, :integer
|
215
|
+
t.column :lft, :integer
|
216
|
+
t.column :rgt, :integer
|
217
|
+
|
218
|
+
#custom columns go here
|
219
|
+
|
220
|
+
t.column :description, :string
|
221
|
+
t.column :comments, :string
|
222
|
+
|
223
|
+
t.column :internal_identifier, :string
|
224
|
+
t.column :external_identifier, :string
|
225
|
+
t.column :external_id_source, :string
|
226
|
+
|
227
|
+
t.timestamps
|
228
|
+
end
|
229
|
+
add_index :contact_purposes, :parent_id
|
230
|
+
|
231
|
+
end
|
232
|
+
|
233
|
+
unless table_exists?(:contact_purposes_contacts)
|
234
|
+
create_table :contact_purposes_contacts, {:id => false} do |t|
|
235
|
+
t.column :contact_id, :integer
|
236
|
+
t.column :contact_purpose_id, :integer
|
237
|
+
end
|
238
|
+
add_index :contact_purposes_contacts, [:contact_id, :contact_purpose_id], :name => "contact_purposes_contacts_index"
|
239
|
+
end
|
240
|
+
|
241
|
+
# Create postal_addresses (a contact_mechanism)
|
242
|
+
unless table_exists?(:postal_addresses)
|
243
|
+
create_table :postal_addresses do |t|
|
244
|
+
t.column :address_line_1, :string
|
245
|
+
t.column :address_line_2, :string
|
246
|
+
t.column :city, :string
|
247
|
+
t.column :state, :string
|
248
|
+
t.column :zip, :string
|
249
|
+
t.column :country, :string
|
250
|
+
t.column :description, :string
|
251
|
+
t.column :geo_country_id, :integer
|
252
|
+
t.column :geo_zone_id, :integer
|
253
|
+
t.timestamps
|
254
|
+
end
|
255
|
+
add_index :postal_addresses, :geo_country_id
|
256
|
+
add_index :postal_addresses, :geo_zone_id
|
257
|
+
end
|
258
|
+
|
259
|
+
# Create email_addresses (a contact_mechanism)
|
260
|
+
unless table_exists?(:email_addresses)
|
261
|
+
create_table :email_addresses do |t|
|
262
|
+
t.column :email_address, :string
|
263
|
+
t.column :description, :string
|
264
|
+
|
265
|
+
t.timestamps
|
266
|
+
end
|
267
|
+
end
|
268
|
+
|
269
|
+
# Create phone_numbers table (A contact_mechanism)
|
270
|
+
unless table_exists?(:phone_numbers)
|
271
|
+
create_table :phone_numbers do |t|
|
272
|
+
t.column :phone_number, :string
|
273
|
+
t.column :description, :string
|
274
|
+
|
275
|
+
t.timestamps
|
276
|
+
end
|
277
|
+
end
|
278
|
+
|
279
|
+
unless table_exists?(:party_search_facts)
|
280
|
+
create_table :party_search_facts do |t|
|
281
|
+
t.column :party_id, :integer
|
282
|
+
t.column :eid, :string
|
283
|
+
t.column :type, :string
|
284
|
+
t.column :roles, :text
|
285
|
+
t.column :party_description, :string
|
286
|
+
t.column :party_business_party_type, :string
|
287
|
+
t.column :user_login, :string
|
288
|
+
t.column :individual_current_last_name, :string
|
289
|
+
t.column :individual_current_first_name, :string
|
290
|
+
t.column :individual_current_middle_name, :string
|
291
|
+
t.column :individual_birth_date, :string
|
292
|
+
t.column :individual_ssn, :string
|
293
|
+
t.column :party_phone_number, :string
|
294
|
+
t.column :party_email_address, :string
|
295
|
+
t.column :party_address_1, :string
|
296
|
+
t.column :party_address_2, :string
|
297
|
+
t.column :party_primary_address_city, :string
|
298
|
+
t.column :party_primary_address_state, :string
|
299
|
+
t.column :party_primary_address_zip, :string
|
300
|
+
t.column :party_primary_address_country, :string
|
301
|
+
t.column :user_enabled, :boolean
|
302
|
+
t.column :user_type, :string
|
303
|
+
t.column :reindex, :boolean
|
304
|
+
t.timestamps
|
305
|
+
end
|
306
|
+
end
|
307
|
+
|
308
|
+
unless table_exists?(:money)
|
309
|
+
create_table :money do |t|
|
310
|
+
t.string :description
|
311
|
+
t.decimal :amount, :precision => 8, :scale => 2
|
312
|
+
t.references :currency
|
313
|
+
t.timestamps
|
314
|
+
end
|
315
|
+
add_index :money, :currency_id
|
316
|
+
end
|
317
|
+
|
318
|
+
unless table_exists?(:currencies)
|
319
|
+
create_table :currencies do |t|
|
320
|
+
t.string :name
|
321
|
+
t.string :definition
|
322
|
+
t.string :internal_identifier # aka alphabetic_code
|
323
|
+
t.string :numeric_code
|
324
|
+
t.string :major_unit_symbol
|
325
|
+
t.string :minor_unit_symbol
|
326
|
+
t.string :ratio_of_minor_unit_to_major_unit
|
327
|
+
t.string :postfix_label
|
328
|
+
t.datetime :introduction_date
|
329
|
+
t.datetime :expiration_date
|
330
|
+
t.timestamps
|
331
|
+
end
|
332
|
+
add_index :currencies, :internal_identifier
|
333
|
+
end
|
334
|
+
|
335
|
+
## categories
|
336
|
+
unless table_exists?(:categories)
|
337
|
+
create_table :categories do |t|
|
338
|
+
t.string :description
|
339
|
+
t.string :external_identifier
|
340
|
+
t.datetime :from_date
|
341
|
+
t.datetime :to_date
|
342
|
+
t.string :internal_identifier
|
343
|
+
|
344
|
+
# polymorphic assns
|
345
|
+
t.integer :category_record_id
|
346
|
+
t.string :category_record_type
|
347
|
+
|
348
|
+
# nested set cols
|
349
|
+
t.integer :parent_id
|
350
|
+
t.integer :lft
|
351
|
+
t.integer :rgt
|
352
|
+
|
353
|
+
t.timestamps
|
354
|
+
end
|
355
|
+
add_index :categories, [:category_record_id, :category_record_type], :name => "category_polymorphic"
|
356
|
+
end
|
357
|
+
|
358
|
+
## category_classifications
|
359
|
+
unless table_exists?(:category_classifications)
|
360
|
+
create_table :category_classifications do |t|
|
361
|
+
t.integer :category_id
|
362
|
+
t.string :classification_type
|
363
|
+
t.integer :classification_id
|
364
|
+
t.datetime :from_date
|
365
|
+
t.datetime :to_date
|
366
|
+
|
367
|
+
t.timestamps
|
368
|
+
end
|
369
|
+
add_index :category_classifications, [:classification_id, :classification_type], :name => "classification_polymorphic"
|
370
|
+
end
|
371
|
+
|
372
|
+
## descriptive_assets
|
373
|
+
unless table_exists?(:descriptive_assets)
|
374
|
+
create_table :descriptive_assets do |t|
|
375
|
+
t.references :view_type
|
376
|
+
t.string :internal_identifier
|
377
|
+
t.text :description
|
378
|
+
t.string :external_identifier
|
379
|
+
t.string :external_id_source
|
380
|
+
t.references :described_record, :polymorphic => true
|
381
|
+
|
382
|
+
t.timestamps
|
383
|
+
end
|
384
|
+
|
385
|
+
add_index :descriptive_assets, :view_type_id
|
386
|
+
add_index :descriptive_assets, [:described_record_id, :described_record_type], :name => 'described_record_idx'
|
387
|
+
end
|
388
|
+
|
389
|
+
unless table_exists?(:view_types)
|
390
|
+
create_table :view_types do |t|
|
391
|
+
t.string :internal_identifier
|
392
|
+
t.string :description
|
393
|
+
|
394
|
+
t.timestamps
|
395
|
+
end
|
396
|
+
end
|
397
|
+
|
398
|
+
unless table_exists?(:geo_countries)
|
399
|
+
create_table :geo_countries do |t|
|
400
|
+
t.column :name, :string
|
401
|
+
t.column :iso_code_2, :string, :length => 2
|
402
|
+
t.column :iso_code_3, :string, :length => 3
|
403
|
+
t.column :display, :boolean, :default => true
|
404
|
+
t.column :external_id, :integer
|
405
|
+
t.column :created_at, :datetime
|
406
|
+
end
|
407
|
+
add_index :geo_countries, :name
|
408
|
+
add_index :geo_countries, :iso_code_2
|
409
|
+
end
|
410
|
+
|
411
|
+
unless table_exists?(:geo_zones)
|
412
|
+
create_table :geo_zones do |t|
|
413
|
+
t.column :geo_country_id, :integer
|
414
|
+
t.column :zone_code, :string, :default => 2
|
415
|
+
t.column :zone_name, :string
|
416
|
+
t.column :created_at, :datetime
|
417
|
+
end
|
418
|
+
add_index :geo_zones, :geo_country_id
|
419
|
+
add_index :geo_zones, :zone_name
|
420
|
+
add_index :geo_zones, :zone_code
|
421
|
+
end
|
422
|
+
|
423
|
+
unless table_exists?(:notes)
|
424
|
+
create_table :notes do |t|
|
425
|
+
t.integer :created_by_id
|
426
|
+
t.text :content
|
427
|
+
t.references :noted_record, :polymorphic => true
|
428
|
+
t.references :note_type
|
429
|
+
|
430
|
+
t.timestamps
|
431
|
+
end
|
432
|
+
|
433
|
+
add_index :notes, [:noted_record_id, :noted_record_type]
|
434
|
+
add_index :notes, :note_type_id
|
435
|
+
add_index :notes, :created_by_id
|
436
|
+
end
|
437
|
+
|
438
|
+
unless table_exists?(:note_types)
|
439
|
+
create_table :note_types do |t|
|
440
|
+
#these columns are required to support the behavior of the plugin 'awesome_nested_set'
|
441
|
+
t.integer :parent_id
|
442
|
+
t.integer :lft
|
443
|
+
t.integer :rgt
|
444
|
+
|
445
|
+
t.string :description
|
446
|
+
t.string :internal_identifier
|
447
|
+
t.string :external_identifier
|
448
|
+
t.references :note_type_record, :polymorphic => true
|
449
|
+
|
450
|
+
t.timestamps
|
451
|
+
end
|
452
|
+
|
453
|
+
add_index :note_types, [:note_type_record_id, :note_type_record_type], :name => "note_type_record_idx"
|
454
|
+
end
|
455
|
+
|
456
|
+
unless table_exists?(:valid_note_types)
|
457
|
+
create_table :valid_note_types do |t|
|
458
|
+
t.references :valid_note_type_record, :polymorphic => true
|
459
|
+
t.references :note_type
|
460
|
+
|
461
|
+
t.timestamps
|
462
|
+
end
|
463
|
+
|
464
|
+
add_index :valid_note_types, [:valid_note_type_record_id, :valid_note_type_record_type], :name => "valid_note_type_record_idx"
|
465
|
+
add_index :valid_note_types, :note_type_id
|
466
|
+
end
|
467
|
+
|
468
|
+
end
|
469
|
+
|
470
|
+
def self.down
|
471
|
+
[
|
472
|
+
:currencies, :money, :compass_ae_instance_party_roles,
|
473
|
+
:party_search_facts, :phone_numbers, :email_addresses,
|
474
|
+
:postal_addresses, :contact_purposes, :contact_types,
|
475
|
+
:contacts, :individuals, :organizations,
|
476
|
+
:party_relationships, :relationship_types, :role_types,
|
477
|
+
:party_roles, :parties, :categories, :category_classifications,
|
478
|
+
:descriptive_assets, :view_types, :notes, :note_types, :valid_note_types, :compass_ae_instances
|
479
|
+
].each do |tbl|
|
480
|
+
if table_exists?(tbl)
|
481
|
+
drop_table tbl
|
482
|
+
end
|
483
|
+
end
|
484
|
+
|
485
|
+
end
|
486
|
+
end
|
@@ -0,0 +1,37 @@
|
|
1
|
+
# This migration comes from erp_base_erp_svcs (originally 20120606183856)
|
2
|
+
class AddTxnStatus < ActiveRecord::Migration
|
3
|
+
def up
|
4
|
+
unless table_exists?(:status_applications)
|
5
|
+
create_table :status_applications do |t|
|
6
|
+
t.references :tracked_status_type
|
7
|
+
t.references :status_application_record, :polymorphic => true
|
8
|
+
t.datetime :from_date
|
9
|
+
t.datetime :thru_date
|
10
|
+
|
11
|
+
t.timestamps
|
12
|
+
end
|
13
|
+
|
14
|
+
add_index :status_applications, [:status_application_record_id, :status_application_record_type], :name => 'status_applications_record_idx'
|
15
|
+
add_index :status_applications, :tracked_status_type_id, :name => 'tracked_status_type_id_idx'
|
16
|
+
add_index :status_applications, :from_date, :name => 'from_date_idx'
|
17
|
+
add_index :status_applications, :thru_date, :name => 'thru_date_idx'
|
18
|
+
end
|
19
|
+
|
20
|
+
unless table_exists?(:tracked_status_types)
|
21
|
+
create_table :tracked_status_types do |t|
|
22
|
+
t.string :description
|
23
|
+
t.string :internal_identifier
|
24
|
+
t.string :external_identifier
|
25
|
+
|
26
|
+
t.timestamps
|
27
|
+
end
|
28
|
+
|
29
|
+
add_index :tracked_status_types, :internal_identifier, :name => 'tracked_status_types_iid_idx'
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
def down
|
34
|
+
drop_table :status_applications if table_exists?(:status_applications)
|
35
|
+
drop_table :tracked_status_types if table_exists?(:tracked_status_types)
|
36
|
+
end
|
37
|
+
end
|
@@ -0,0 +1,34 @@
|
|
1
|
+
# This migration comes from erp_base_erp_svcs (originally 20130211444444)
|
2
|
+
# This migration comes from erp_base_erp_svcs (originally 20130211444444)
|
3
|
+
class UpgradeCompassAeInstances < ActiveRecord::Migration
|
4
|
+
def self.up
|
5
|
+
unless columns(:compass_ae_instances).collect {|c| c.name}.include?('type')
|
6
|
+
add_column :compass_ae_instances, :description, :string
|
7
|
+
add_column :compass_ae_instances, :internal_identifier, :string
|
8
|
+
add_column :compass_ae_instances, :type, :string
|
9
|
+
add_column :compass_ae_instances, :schema, :string, :default => 'public'
|
10
|
+
add_column :compass_ae_instances, :parent_id, :integer
|
11
|
+
|
12
|
+
add_index :compass_ae_instances, :internal_identifier, :name => "iid_idx"
|
13
|
+
add_index :compass_ae_instances, :schema, :name => "schema_idx"
|
14
|
+
add_index :compass_ae_instances, :type, :name => "type_idx"
|
15
|
+
add_index :compass_ae_instances, :parent_id, :name => "parent_id_idx"
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
unless table_exists?(:compass_ae_instance_party_roles)
|
20
|
+
create_table :compass_ae_instance_party_roles do |t|
|
21
|
+
t.string :description
|
22
|
+
t.integer :compass_ae_instance_id
|
23
|
+
t.integer :party_id
|
24
|
+
t.integer :role_type_id
|
25
|
+
|
26
|
+
t.timestamps
|
27
|
+
end
|
28
|
+
|
29
|
+
add_index :compass_ae_instance_party_roles, :compass_ae_instance_id, :name => "compass_ae_instance_id_idx"
|
30
|
+
add_index :compass_ae_instance_party_roles, :party_id, :name => "party_id_idx"
|
31
|
+
add_index :compass_ae_instance_party_roles, :role_type_id, :name => "role_type_id_idx"
|
32
|
+
end
|
33
|
+
|
34
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
# This migration comes from erp_base_erp_svcs (originally 20130404171435)
|
2
|
+
require 'uuid'
|
3
|
+
|
4
|
+
class AddUuidCompassAeInstance < ActiveRecord::Migration
|
5
|
+
def self.up
|
6
|
+
unless columns(:compass_ae_instances).collect {|c| c.name}.include?('guid')
|
7
|
+
add_column :compass_ae_instances, :guid, :string
|
8
|
+
add_index :compass_ae_instances, :guid, :name => "guid_idx"
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
def self.down
|
13
|
+
if columns(:compass_ae_instances).collect {|c| c.name}.include?('guid')
|
14
|
+
remove_column :compass_ae_instances, :guid
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
# This migration comes from erp_base_erp_svcs (originally 20130411125210)
|
2
|
+
class AddLongLatToAddress < ActiveRecord::Migration
|
3
|
+
def up
|
4
|
+
unless columns(:postal_addresses).collect {|c| c.name}.include?('latitude')
|
5
|
+
add_column :postal_addresses, :latitude, :decimal, :precision => 12, :scale => 8
|
6
|
+
add_column :postal_addresses, :longitude, :decimal, :precision => 12, :scale => 8
|
7
|
+
end
|
8
|
+
end
|
9
|
+
|
10
|
+
def down
|
11
|
+
if columns(:postal_addresses).collect {|c| c.name}.include?('latitude')
|
12
|
+
remove_column :postal_addresses, :latitude
|
13
|
+
remove_column :postal_addresses, :longitude
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|