erp_invoicing 3.1.0 → 4.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (107) hide show
  1. checksums.yaml +7 -0
  2. data/app/models/extensions/party.rb +15 -3
  3. data/app/models/invoice.rb +33 -1
  4. data/app/models/invoice_party_role.rb +16 -0
  5. data/app/models/payment_application.rb +17 -1
  6. data/lib/erp_invoicing/engine.rb +1 -1
  7. data/lib/erp_invoicing/version.rb +6 -2
  8. metadata +31 -234
  9. data/app/assets/javascripts/erp_invoicing/application.js +0 -9
  10. data/app/assets/stylesheets/erp_invoicing/application.css +0 -7
  11. data/app/controllers/erp_invoicing/erp_app/organizer/bill_pay/accounts_controller.rb +0 -166
  12. data/app/controllers/erp_invoicing/erp_app/organizer/bill_pay/base_controller.rb +0 -22
  13. data/app/controllers/erp_invoicing/erp_app/shared/billing_accounts_controller.rb +0 -111
  14. data/app/controllers/erp_invoicing/erp_app/shared/files_controller.rb +0 -52
  15. data/app/controllers/erp_invoicing/erp_app/shared/invoices_controller.rb +0 -208
  16. data/app/controllers/erp_invoicing/sms_controller.rb +0 -156
  17. data/app/helpers/erp_invoicing/application_helper.rb +0 -4
  18. data/app/views/layouts/erp_invoicing/application.html.erb +0 -14
  19. data/db/data_migrations/20111121153349_create_bill_pay_organizer_application.rb +0 -14
  20. data/db/data_migrations/20120118181839_create_invoice_management_desktop_application.rb +0 -26
  21. data/db/data_migrations/20120229174322_add_billpay_widget.rb +0 -26
  22. data/public/javascripts/erp_app/desktop/applications/invoice_management/billing_accounts_panel.js +0 -79
  23. data/public/javascripts/erp_app/desktop/applications/invoice_management/invoices_panel.js +0 -48
  24. data/public/javascripts/erp_app/desktop/applications/invoice_management/module.js +0 -36
  25. data/public/javascripts/erp_app/organizer/applications/bill_pay/base.js +0 -146
  26. data/public/javascripts/erp_app/organizer/applications/bill_pay/extensions.js +0 -21
  27. data/public/javascripts/erp_app/organizer/applications/bill_pay/make_payment_window.js +0 -109
  28. data/public/javascripts/erp_app/organizer/applications/bill_pay/payment_accounts_grid_panel.js +0 -105
  29. data/public/javascripts/erp_app/organizer/applications/bill_pay/transactions_grid_panel.js +0 -84
  30. data/public/javascripts/erp_app/shared/add_invoice_window.js +0 -220
  31. data/public/javascripts/erp_app/shared/billing_accounts_grid_panel.js +0 -316
  32. data/public/javascripts/erp_app/shared/invoice_items_grid_panel.js +0 -152
  33. data/public/javascripts/erp_app/shared/invoices_grid_panel.js +0 -361
  34. data/public/javascripts/erp_app/shared/payments_grid_panel.js +0 -74
  35. data/spec/dummy/db/data_migrations/20101011152441_payment_gateway_actions.erp_commerce.rb +0 -28
  36. data/spec/dummy/db/data_migrations/20101014142230_financial_txn_types.erp_txns_and_accts.rb +0 -16
  37. data/spec/dummy/db/data_migrations/20110109173616_create_capability_scope_types.erp_tech_svcs.rb +0 -15
  38. data/spec/dummy/db/data_migrations/20110324010232_product_role_types.erp_products.rb +0 -24
  39. data/spec/dummy/db/data_migrations/20110509223702_add_publisher_role.knitkit.rb +0 -22
  40. data/spec/dummy/db/data_migrations/20110525001935_add_usd_currency.erp_base_erp_svcs.rb +0 -12
  41. data/spec/dummy/db/data_migrations/20110527160807_add_default_prod_avail_types.erp_products.rb +0 -27
  42. data/spec/dummy/db/data_migrations/20110605231556_create_order_party_roles.erp_orders.rb +0 -24
  43. data/spec/dummy/db/data_migrations/20110608185830_create_default_dynamic_models_and_forms.erp_forms.rb +0 -33
  44. data/spec/dummy/db/data_migrations/20110609150135_add_iso_codes.erp_base_erp_svcs.rb +0 -19
  45. data/spec/dummy/db/data_migrations/20110728201729_erp_app_setup.erp_app.rb +0 -252
  46. data/spec/dummy/db/data_migrations/20110728201730_create_desktop_app_product_manager.erp_products.rb +0 -26
  47. data/spec/dummy/db/data_migrations/20110728201731_create_desktop_app_order_manager.erp_orders.rb +0 -26
  48. data/spec/dummy/db/data_migrations/20110728201732_create_organizer_app_order_management.erp_orders.rb +0 -15
  49. data/spec/dummy/db/data_migrations/20110728201733_update_preferences.erp_app.rb +0 -53
  50. data/spec/dummy/db/data_migrations/20110802200222_schedule_delete_expired_sessions_job.erp_tech_svcs.rb +0 -16
  51. data/spec/dummy/db/data_migrations/20110816153456_add_knitkit_application.knitkit.rb +0 -32
  52. data/spec/dummy/db/data_migrations/20110816161238_create_desktop_app_audit_log_viewer.erp_app.rb +0 -21
  53. data/spec/dummy/db/data_migrations/20110817160743_add_file_manager_application.erp_app.rb +0 -32
  54. data/spec/dummy/db/data_migrations/20110828190913_create_desktop_app_dynamic_forms.erp_forms.rb +0 -19
  55. data/spec/dummy/db/data_migrations/20110913145838_setup_compass_ae_instance.erp_base_erp_svcs.rb +0 -12
  56. data/spec/dummy/db/data_migrations/20111108183739_add_default_capabilities.erp_app.rb +0 -23
  57. data/spec/dummy/db/data_migrations/20111108183740_add_new_contact_widgets.erp_app.rb +0 -42
  58. data/spec/dummy/db/data_migrations/20111111144706_setup_audit_log_types.erp_tech_svcs.rb +0 -22
  59. data/spec/dummy/db/data_migrations/20111118182910_setup_knitkit_capabilities.knitkit.rb +0 -128
  60. data/spec/dummy/db/data_migrations/20111121153349_create_bill_pay_organizer_application.erp_invoicing.rb +0 -15
  61. data/spec/dummy/db/data_migrations/20120109173616_create_download_capability_type.erp_tech_svcs.rb +0 -14
  62. data/spec/dummy/db/data_migrations/20120118181839_create_invoice_management_desktop_application.erp_invoicing.rb +0 -27
  63. data/spec/dummy/db/data_migrations/20120127144444_create_website_role_types.knitkit.rb +0 -14
  64. data/spec/dummy/db/data_migrations/20120127150505_create_website_default_configuration.knitkit.rb +0 -73
  65. data/spec/dummy/db/data_migrations/20120127150506_add_primary_host_to_website_configuration.knitkit.rb +0 -34
  66. data/spec/dummy/db/data_migrations/20120229160222_add_userinfo_widget.erp_app.rb +0 -29
  67. data/spec/dummy/db/data_migrations/20120229174322_add_billpay_widget.erp_invoicing.rb +0 -27
  68. data/spec/dummy/db/data_migrations/20120229174343_add_orders_widget.erp_orders.rb +0 -29
  69. data/spec/dummy/db/data_migrations/20120316150424_add_is_template_to_default_website_config.knitkit.rb +0 -17
  70. data/spec/dummy/db/data_migrations/20120405193721_create_party_and_role_type_for_communication_events.erp_app.rb +0 -11
  71. data/spec/dummy/db/data_migrations/20120411180756_create_user_management_mobile_application.erp_app.rb +0 -19
  72. data/spec/dummy/db/data_migrations/20120418164215_create_configuration_management_desktop_application.erp_app.rb +0 -23
  73. data/spec/dummy/db/data_migrations/20120605154637_add_calculate_balance_strategy_types.erp_invoicing.rb +0 -21
  74. data/spec/dummy/db/data_migrations/20120809020508_update_website_and_configuration.knitkit.rb +0 -78
  75. data/spec/dummy/db/data_migrations/20120824013449_create_ticket_form.erp_forms.rb +0 -67
  76. data/spec/dummy/db/data_migrations/20121026013449_update_ticket_form.erp_forms.rb +0 -65
  77. data/spec/dummy/db/data_migrations/20121026191738_update_contact_form.erp_forms.rb +0 -27
  78. data/spec/dummy/db/data_migrations/20121116155018_create_group_relationship_and_role_types.erp_tech_svcs.rb +0 -20
  79. data/spec/dummy/db/data_migrations/20121129185611_upgrade_website_role_iid.knitkit.rb +0 -21
  80. data/spec/dummy/db/data_migrations/20121130201859_upgrade_remove_system_mgmt_app.erp_app.rb +0 -16
  81. data/spec/dummy/db/data_migrations/20121130212146_note_capabilities.erp_tech_svcs.rb +0 -24
  82. data/spec/dummy/db/data_migrations/20121218175028_create_security_management_desktop_application.erp_app.rb +0 -23
  83. data/spec/dummy/db/migrate/20121214000230_base_erp_services.erp_base_erp_svcs.rb +0 -461
  84. data/spec/dummy/db/migrate/20121214000231_base_tech_services.erp_tech_svcs.rb +0 -255
  85. data/spec/dummy/db/migrate/20121214000232_create_has_attribute_tables.erp_tech_svcs.rb +0 -39
  86. data/spec/dummy/db/migrate/20121214000233_base_app_framework.erp_app.rb +0 -276
  87. data/spec/dummy/db/migrate/20121214000234_dynamic_forms.erp_forms.rb +0 -95
  88. data/spec/dummy/db/migrate/20121214000235_create_tickets.erp_forms.rb +0 -19
  89. data/spec/dummy/db/migrate/20121214000236_upgrade_dynamic_forms_table.erp_forms.rb +0 -32
  90. data/spec/dummy/db/migrate/20121214000237_setup_knitkit.knitkit.rb +0 -316
  91. data/spec/dummy/db/migrate/20121214000238_invoicing_services.erp_invoicing.rb +0 -277
  92. data/spec/dummy/db/migrate/20121214000239_base_inventory.erp_inventory.rb +0 -91
  93. data/spec/dummy/db/migrate/20121214000240_base_inventory_indexes.erp_inventory.rb +0 -48
  94. data/spec/dummy/db/migrate/20121214000241_base_txns_and_accts.erp_txns_and_accts.rb +0 -364
  95. data/spec/dummy/db/migrate/20121214000242_agreements_services.erp_agreements.rb +0 -160
  96. data/spec/dummy/db/migrate/20121214000243_agreements_services_indexes.erp_agreements.rb +0 -52
  97. data/spec/dummy/db/migrate/20121214000244_base_orders.erp_orders.rb +0 -178
  98. data/spec/dummy/db/migrate/20121214000245_base_products.erp_products.rb +0 -234
  99. data/spec/dummy/db/migrate/20121214000246_base_products_indexes.erp_products.rb +0 -59
  100. data/spec/dummy/db/migrate/20121214000247_erp_commerce_base.erp_commerce.rb +0 -442
  101. data/spec/dummy/db/migrate/20121214000248_base_work_efforts.erp_work_effort.rb +0 -211
  102. data/spec/dummy/db/migrate/20130107181155_create_groups.erp_tech_svcs.rb +0 -19
  103. data/spec/dummy/db/migrate/20130107181156_upgrade_security.erp_tech_svcs.rb +0 -54
  104. data/spec/dummy/db/migrate/20130107181157_upgrade_security2.erp_tech_svcs.rb +0 -270
  105. data/spec/dummy/db/schema.rb +0 -2569
  106. data/spec/dummy/db/spec.sqlite3 +0 -0
  107. data/spec/dummy/log/spec.log +0 -64744
@@ -1,255 +0,0 @@
1
- # This migration comes from erp_tech_svcs (originally 20080805000010)
2
- class BaseTechServices < ActiveRecord::Migration
3
- def self.up
4
- unless table_exists?(:users)
5
- # Create the users table
6
- create_table :users do |t|
7
- t.string :username
8
- t.string :email
9
- t.references :party
10
- t.string :type
11
- t.string :salt, :default => nil
12
- t.string :crypted_password, :default => nil
13
-
14
- #activity logging
15
- t.datetime :last_login_at, :default => nil
16
- t.datetime :last_logout_at, :default => nil
17
- t.datetime :last_activity_at, :default => nil
18
-
19
- #brute force protection
20
- t.integer :failed_logins_count, :default => 0
21
- t.datetime :lock_expires_at, :default => nil
22
-
23
- #remember me
24
- t.string :remember_me_token, :default => nil
25
- t.datetime :remember_me_token_expires_at, :default => nil
26
-
27
- #reset password
28
- t.string :reset_password_token, :default => nil
29
- t.datetime :reset_password_token_expires_at, :default => nil
30
- t.datetime :reset_password_email_sent_at, :default => nil
31
-
32
- #user activation
33
- t.string :activation_state, :default => nil
34
- t.string :activation_token, :default => nil
35
- t.datetime :activation_token_expires_at, :default => nil
36
-
37
- t.string :security_question_1
38
- t.string :security_answer_1
39
- t.string :security_question_2
40
- t.string :security_answer_2
41
-
42
- t.timestamps
43
- end
44
- add_index :users, :email, :unique => true
45
- add_index :users, :username, :unique => true
46
- add_index :users, [:last_logout_at, :last_activity_at], :name => 'activity_idx'
47
- add_index :users, :remember_me_token
48
- add_index :users, :reset_password_token
49
- add_index :users, :activation_token
50
-
51
- end
52
-
53
- unless table_exists?(:roles)
54
- # create the roles table
55
- create_table :roles do |t|
56
- t.column :description, :string
57
- t.column :internal_identifier, :string
58
- t.column :external_identifier, :string
59
- t.column :external_id_source, :string
60
-
61
- t.timestamps
62
- end
63
- end
64
-
65
- unless table_exists?(:sessions)
66
- # Create sessions table
67
- create_table :sessions do |t|
68
- t.string :session_id, :null => false
69
- t.text :data
70
- t.timestamps
71
- end
72
- add_index :sessions, :session_id
73
- add_index :sessions, :updated_at
74
- end
75
-
76
- unless table_exists?(:audit_logs)
77
- # Create audit_logs
78
- create_table :audit_logs do |t|
79
- t.string :application
80
- t.string :description
81
- t.integer :party_id
82
- t.text :additional_info
83
- t.references :audit_log_type
84
-
85
- #polymorphic columns
86
- t.references :event_record, :polymorphic => true
87
-
88
- t.timestamps
89
- end
90
- add_index :audit_logs, :party_id
91
- add_index :audit_logs, [:event_record_id, :event_record_type], :name => 'event_record_index'
92
- end
93
-
94
- unless table_exists?(:audit_log_types)
95
- # Create audit_logs
96
- create_table :audit_log_types do |t|
97
- t.string :description
98
- t.string :error_code
99
- t.string :comments
100
- t.string :internal_identifier
101
- t.string :external_identifier
102
- t.string :external_id_source
103
-
104
- #better nested set columns
105
- t.integer :parent_id
106
- t.integer :lft
107
- t.integer :rgt
108
-
109
- t.timestamps
110
- end
111
- end
112
-
113
- unless table_exists?(:audit_log_items)
114
- # Create audit_log_items
115
- create_table :audit_log_items do |t|
116
- t.references :audit_log
117
- t.references :audit_log_item_type
118
- t.string :audit_log_item_value
119
- t.string :description
120
-
121
- t.timestamps
122
- end
123
- end
124
-
125
- unless table_exists?(:audit_log_item_types)
126
- # Create audit_log_item_types
127
- create_table :audit_log_item_types do |t|
128
- t.string :internal_identifier
129
- t.string :external_identifier
130
- t.string :external_id_source
131
- t.string :description
132
- t.string :comments
133
-
134
- #better nested set columns
135
- t.integer :parent_id
136
- t.integer :lft
137
- t.integer :rgt
138
-
139
- t.timestamps
140
- end
141
- end
142
-
143
- unless table_exists?(:secured_models)
144
- create_table :secured_models do |t|
145
- t.references :secured_record, :polymorphic => true
146
-
147
- t.timestamps
148
- end
149
- add_index :secured_models, [:secured_record_id, :secured_record_type], :name => 'secured_record_idx'
150
- end
151
-
152
- unless table_exists?(:roles_secured_models)
153
- create_table :roles_secured_models, :id => false do |t|
154
- t.references :secured_model
155
- t.references :role
156
- end
157
- add_index :roles_secured_models, :secured_model_id
158
- add_index :roles_secured_models, :role_id
159
- end
160
-
161
- unless table_exists?(:file_assets)
162
- create_table :file_assets do |t|
163
- t.references :file_asset_holder, :polymorphic => true
164
- t.string :type
165
- t.string :name
166
- t.string :directory
167
- t.string :data_file_name
168
- t.string :data_content_type
169
- t.integer :data_file_size
170
- t.datetime :data_updated_at
171
- t.string :width
172
- t.string :height
173
-
174
- t.timestamps
175
- end
176
- add_index :file_assets, :type
177
- add_index :file_assets, [:file_asset_holder_id, :file_asset_holder_type], :name => 'file_asset_holder_idx'
178
- add_index :file_assets, :name
179
- add_index :file_assets, :directory
180
- end
181
-
182
- unless table_exists?(:delayed_jobs)
183
- create_table :delayed_jobs, :force => true do |table|
184
- table.integer :priority, :default => 0 # Allows some jobs to jump to the front of the queue
185
- table.integer :attempts, :default => 0 # Provides for retries, but still fail eventually.
186
- table.text :handler # YAML-encoded string of the object that will do work
187
- table.text :last_error # reason for last failure (See Note below)
188
- table.datetime :run_at # When to run. Could be Time.zone.now for immediately, or sometime in the future.
189
- table.datetime :locked_at # Set when a client is working on this object
190
- table.datetime :failed_at # Set when all retries have failed (actually, by default, the record is deleted instead)
191
- table.string :locked_by # Who is working on this object (if locked)
192
- table.string :queue
193
- table.timestamps
194
- end
195
- add_index :delayed_jobs, [:priority, :run_at], :name => 'delayed_jobs_priority'
196
- end
197
-
198
- unless table_exists?(:capable_models)
199
- # create the roles table
200
- create_table :capable_models do |t|
201
- t.references :capable_model_record, :polymorphic => true
202
-
203
- t.timestamps
204
- end
205
-
206
- add_index :capable_models, [:capable_model_record_id, :capable_model_record_type], :name => 'capable_model_record_idx'
207
- end
208
-
209
- unless table_exists?(:capability_types)
210
- # create the roles table
211
- create_table :capability_types do |t|
212
- t.string :internal_identifier
213
- t.string :description
214
- t.timestamps
215
- end
216
- end
217
-
218
- unless table_exists?(:capabilities)
219
- # create the roles table
220
- create_table :capabilities do |t|
221
- t.string :resource
222
- t.references :capability_type
223
- t.timestamps
224
- end
225
-
226
- add_index :capabilities, :capability_type_id
227
- end
228
-
229
- unless table_exists?(:capabilities_capable_models)
230
- # create the roles table
231
- create_table :capabilities_capable_models, :id => false do |t|
232
- t.references :capable_model
233
- t.references :capability
234
- end
235
-
236
- add_index :capabilities_capable_models, :capable_model_id
237
- add_index :capabilities_capable_models, :capability_id
238
- end
239
-
240
- end
241
-
242
- def self.down
243
- # check that each table exists before trying to delete it.
244
- [
245
- :audit_logs, :sessions, :simple_captcha_data,
246
- :capable_models, :capability_types, :capabilities,:capabilities_capable_models,
247
- :roles_users, :roles, :audit_log_items, :audit_log_item_types,
248
- :users, :secured_models, :roles_secured_models, :file_assets, :delayed_jobs
249
- ].each do |tbl|
250
- if table_exists?(tbl)
251
- drop_table tbl
252
- end
253
- end
254
- end
255
- end
@@ -1,39 +0,0 @@
1
- # This migration comes from erp_tech_svcs (originally 20111117183144)
2
- class CreateHasAttributeTables < ActiveRecord::Migration
3
- def up
4
- unless table_exists?(:attribute_types)
5
- create_table :attribute_types do |t|
6
- t.string :internal_identifier
7
- t.string :description
8
- t.string :data_type
9
-
10
- t.timestamps
11
- end
12
-
13
- add_index :attribute_types, :internal_identifier, :name => ':attribute_types_iid_idx'
14
- end
15
- unless table_exists?(:attribute_values)
16
- create_table :attribute_values do |t|
17
- t.integer :attributed_record_id
18
- t.string :attributed_record_type
19
- t.references :attribute_type
20
- t.string :value
21
-
22
- t.timestamps
23
- end
24
-
25
- add_index :attribute_values, [:attributed_record_id, :attributed_record_type], :name => 'attribute_values_attributed_record_idx'
26
- add_index :attribute_values, :attribute_type_id, :name => 'attribute_values_attributed_type_idx'
27
- add_index :attribute_values, :value, :name => 'attribute_values_value_idx'
28
- end
29
- end
30
-
31
- def down
32
- if table_exists?(:attribute_types)
33
- drop_table :attribute_types
34
- end
35
- if table_exists?(:attribute_values)
36
- drop_table :attribute_values
37
- end
38
- end
39
- end
@@ -1,276 +0,0 @@
1
- # This migration comes from erp_app (originally 20080805000096)
2
- class BaseAppFramework < ActiveRecord::Migration
3
- def self.up
4
-
5
- unless table_exists?(:preferences)
6
- create_table :preferences do |t|
7
- t.references :preference_option
8
- t.references :preference_type
9
-
10
- t.timestamps
11
- end
12
- add_index :preferences, :preference_option_id
13
- add_index :preferences, :preference_type_id
14
- end
15
-
16
- unless table_exists?(:preference_types)
17
- create_table :preference_types do |t|
18
- t.string :description
19
- t.string :internal_identifier
20
- t.integer :default_pref_option_id
21
-
22
- t.timestamps
23
- end
24
-
25
- add_index :preference_types, :default_pref_option_id
26
- end
27
-
28
- unless table_exists?(:preference_options)
29
- create_table :preference_options do |t|
30
- t.string :description
31
- t.string :internal_identifier
32
- t.string :value
33
-
34
- t.timestamps
35
- end
36
- end
37
-
38
- unless table_exists?(:preference_options_preference_types)
39
- create_table :preference_options_preference_types, {:id => false} do |t|
40
- t.references :preference_type
41
- t.references :preference_option
42
- end
43
-
44
- add_index :preference_options_preference_types, :preference_type_id, :name => 'pref_opt_pref_type_pref_type_id_idx'
45
- add_index :preference_options_preference_types, :preference_option_id, :name => 'pref_opt_pref_type_pref_opt_id_idx'
46
- end
47
-
48
- unless table_exists?(:valid_preference_types)
49
- create_table :valid_preference_types do |t|
50
- t.references :preference_type
51
- t.references :preferenced_record, :polymorphic => true
52
- end
53
- end
54
-
55
- unless table_exists?(:user_preferences)
56
- create_table :user_preferences do |t|
57
- t.references :user
58
- t.references :preference
59
-
60
- t.references :preferenced_record, :polymorphic => true
61
-
62
- t.timestamps
63
- end
64
- add_index :user_preferences, :user_id
65
- add_index :user_preferences, :preference_id
66
- add_index :user_preferences, :preferenced_record_id
67
- add_index :user_preferences, :preferenced_record_type
68
- end
69
-
70
- unless table_exists?(:app_containers)
71
- create_table :app_containers do |t|
72
- t.references :user
73
- t.string :description
74
- t.string :internal_identifier
75
- t.string :type
76
-
77
- t.timestamps
78
- end
79
- add_index :app_containers, :user_id
80
- add_index :app_containers, :type
81
- end
82
-
83
- unless table_exists?(:applications)
84
- create_table :applications do |t|
85
- t.column :description, :string
86
- t.column :icon, :string
87
- t.column :internal_identifier, :string
88
- t.column :javascript_class_name, :string
89
- t.column :shortcut_id, :string
90
- t.column :base_url, :string
91
- t.column :type, :string
92
-
93
- t.timestamps
94
- end
95
- end
96
-
97
- unless table_exists?(:app_containers_applications)
98
- create_table :app_containers_applications, {:id => false} do |t|
99
- t.column :app_container_id, :integer
100
- t.column :application_id, :integer
101
- end
102
-
103
- add_index :app_containers_applications, :application_id
104
- add_index :app_containers_applications, :app_container_id
105
- end
106
-
107
- unless table_exists?(:widgets)
108
- create_table :widgets do |t|
109
- t.column :description, :string
110
- t.column :internal_identifier, :string
111
- t.column :icon, :string
112
- t.column :xtype, :string
113
-
114
- t.timestamps
115
- end
116
- end
117
-
118
- unless table_exists?(:applications_widgets)
119
- create_table :applications_widgets, {:id => false} do |t|
120
- t.column :application_id, :integer
121
- t.column :widget_id, :integer
122
- end
123
- add_index :applications_widgets, :application_id
124
- add_index :applications_widgets, :widget_id
125
- end
126
-
127
- unless table_exists?(:tree_menu_node_defs)
128
- create_table :tree_menu_node_defs do |t|
129
- t.string :node_type
130
- t.integer :parent_id
131
- t.integer :lft
132
- t.integer :rgt
133
- t.string :menu_short_name
134
- t.string :menu_description
135
- t.string :text
136
- t.string :icon_url
137
- t.string :target_url
138
- t.string :resource_class
139
- t.timestamps
140
- end
141
- add_index :tree_menu_node_defs, :parent_id
142
- end
143
-
144
- unless table_exists? :configurations
145
- create_table :configurations do |t|
146
- #custom columns go here
147
- t.string :description
148
- t.string :internal_identifier
149
- t.boolean :active
150
- t.boolean :is_template, :default => false
151
-
152
- t.timestamps
153
- end
154
-
155
- add_index :configurations, :is_template
156
- end
157
-
158
- unless table_exists? :valid_configurations
159
- create_table :valid_configurations do |t|
160
- #foreign keys
161
- t.references :configured_item, :polymorphic => true
162
- t.references :configuration
163
-
164
- t.timestamps
165
- end
166
-
167
- add_index :valid_configurations, [:configured_item_id, :configured_item_type], :name => 'configured_item_poly_idx'
168
- add_index :valid_configurations, :configuration_id
169
- end
170
-
171
- unless table_exists? :configuration_items
172
- create_table :configuration_items do |t|
173
- #foreign keys
174
- t.references :configuration
175
- t.references :configuration_item_type
176
- t.references :configuration_option
177
-
178
- t.timestamps
179
- end
180
-
181
- add_index :configuration_items, :configuration_id
182
- add_index :configuration_items, :configuration_item_type_id
183
- add_index :configuration_items, :configuration_option_id
184
- end
185
-
186
- unless table_exists? :configuration_item_types
187
- create_table :configuration_item_types do |t|
188
- #awesome nested set columns
189
- t.integer :parent_id
190
- t.integer :lft
191
- t.integer :rgt
192
-
193
- #custom columns go here
194
- t.string :description
195
- t.string :internal_identifier
196
- t.boolean :allow_user_defined_options, :default => false
197
- t.boolean :is_multi_optional, :default => false
198
-
199
- t.timestamps
200
- end
201
- end
202
-
203
- unless table_exists?(:configuration_item_types_configurations)
204
- create_table :configuration_item_types_configurations, {:id => false} do |t|
205
- t.references :configuration_item_type
206
- t.references :configuration
207
- end
208
-
209
- add_index :configuration_item_types_configurations, :configuration_item_type_id, :name => 'conf_conf_type_id_item_idx'
210
- add_index :configuration_item_types_configurations, :configuration_id, :name => 'conf_id_idx'
211
- add_index :configuration_item_types_configurations, [:configuration_item_type_id, :configuration_id], :unique => true, :name => 'conf_config_type_uniq_idx'
212
- end
213
-
214
- unless table_exists? :configuration_options
215
- create_table :configuration_options do |t|
216
- #custom columns go here
217
- t.string :description
218
- t.string :internal_identifier
219
- t.string :value
220
- t.text :comment
221
- t.boolean :user_defined, :default => false
222
-
223
- t.timestamps
224
- end
225
-
226
- add_index :configuration_options, :value
227
- add_index :configuration_options, :internal_identifier
228
- add_index :configuration_options, :user_defined
229
- end
230
-
231
- unless table_exists?(:configuration_item_types_configuration_options)
232
- create_table :configuration_item_types_configuration_options do |t|
233
- t.references :configuration_item_type
234
- t.references :configuration_option
235
- t.boolean :is_default, :default => false
236
-
237
- t.timestamps
238
- end
239
-
240
- add_index :configuration_item_types_configuration_options, :configuration_item_type_id, :name => 'conf_item_type_conf_opt_id_item_idx'
241
- add_index :configuration_item_types_configuration_options, :configuration_option_id, :name => 'conf_item_type_conf_opt_id_opt_idx'
242
- end
243
-
244
- unless table_exists?(:configuration_items_configuration_options)
245
- create_table :configuration_items_configuration_options, {:id => false} do |t|
246
- t.references :configuration_item
247
- t.references :configuration_option
248
- end
249
-
250
- add_index :configuration_items_configuration_options, :configuration_item_id, :name => 'conf_item_conf_opt_id_item_idx'
251
- add_index :configuration_items_configuration_options, :configuration_option_id, :name => 'conf_item_conf_opt_id_opt_idx'
252
- end
253
-
254
- end
255
-
256
- def self.down
257
- [
258
- :preferences, :preference_types,
259
- :preference_options, :preference_options_preference_types,
260
- :valid_preference_types, :user_preferences,
261
- :app_containers, :app_containers_applications,
262
- :applications_widgets, :widgets, :tree_menu_node_defs,
263
- :applications, :applications_desktops,
264
- :configurations, :configuration_items,
265
- :configuration_item_types, :configuration_options,
266
- :configuration_item_types_configuration_options,
267
- :configuration_items_configuration_options, :configured_items,
268
- :configuration_item_types_configurations
269
- ].each do |tbl|
270
- if table_exists?(tbl)
271
- drop_table(tbl)
272
- end
273
- end
274
- end
275
-
276
- end
@@ -1,95 +0,0 @@
1
- # This migration comes from erp_forms (originally 20110530193446)
2
- class DynamicForms < ActiveRecord::Migration
3
- def self.up
4
- unless table_exists?(:dynamic_form_models)
5
- create_table :dynamic_form_models do |t|
6
- t.string :model_name
7
- t.boolean :show_in_multitask, :default => false
8
- t.boolean :allow_comments, :default => true
9
- t.boolean :allow_files, :default => true
10
- t.string :file_security_default, :default => 'private'
11
-
12
- t.timestamps
13
- end
14
- end
15
-
16
- unless table_exists?(:dynamic_form_documents)
17
- create_table :dynamic_form_documents do |t|
18
- t.integer :dynamic_form_model_id
19
- t.string :type
20
-
21
- t.timestamps
22
- end
23
-
24
- add_index :dynamic_form_documents, :dynamic_form_model_id
25
- add_index :dynamic_form_documents, :type
26
- end
27
-
28
- unless table_exists?(:dynamic_forms)
29
- create_table :dynamic_forms do |t|
30
- t.string :description
31
- t.text :definition
32
- t.integer :dynamic_form_model_id
33
- t.string :model_name
34
- t.string :internal_identifier
35
- t.boolean :default
36
- t.string :widget_action, :default => 'save'
37
- t.string :widget_email_recipients
38
- t.boolean :focus_first_field, :default => true
39
- t.boolean :submit_empty_text, :default => false
40
- t.string :msg_target, :default => 'qtip'
41
- t.string :submit_button_label, :default => 'Submit'
42
- t.string :cancel_button_label, :default => 'Cancel'
43
- t.text :comment
44
-
45
- t.integer :created_by_id
46
- t.integer :updated_by_id
47
-
48
- t.timestamps
49
- end
50
-
51
- add_index :dynamic_forms, :created_by_id
52
- add_index :dynamic_forms, :updated_by_id
53
- add_index :dynamic_forms, :dynamic_form_model_id
54
- add_index :dynamic_forms, :model_name
55
- add_index :dynamic_forms, :internal_identifier
56
- end
57
-
58
- unless table_exists?(:dynamic_data)
59
- create_table :dynamic_data do |t|
60
- t.string :reference_type
61
- t.integer :reference_id
62
- t.text :dynamic_attributes
63
-
64
- t.integer :created_with_form_id
65
- t.integer :updated_with_form_id
66
-
67
- t.integer :created_by_id
68
- t.integer :updated_by_id
69
-
70
- t.timestamps
71
- end
72
-
73
- add_index :dynamic_data, :created_with_form_id
74
- add_index :dynamic_data, :updated_with_form_id
75
- add_index :dynamic_data, :created_by_id
76
- add_index :dynamic_data, :updated_by_id
77
- add_index :dynamic_data, :reference_type
78
- add_index :dynamic_data, :reference_id
79
- end
80
-
81
- end
82
-
83
- def self.down
84
- [ :dynamic_form_models,
85
- :dynamic_form_documents,
86
- :dynamic_forms,
87
- :dynamic_data
88
- ].each do |tbl|
89
- if table_exists?(tbl)
90
- drop_table tbl
91
- end
92
- end
93
-
94
- end
95
- end
@@ -1,19 +0,0 @@
1
- # This migration comes from erp_forms (originally 20120824012520)
2
- class CreateTickets < ActiveRecord::Migration
3
-
4
- def up
5
- unless table_exists?(:tickets)
6
- create_table :tickets do |t|
7
- t.timestamps
8
- end
9
- end
10
-
11
- end
12
-
13
- def down
14
- if table_exists?(:tickets)
15
- drop_table :tickets
16
- end
17
- end
18
-
19
- end