erp_work_effort 3.1.1 → 4.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (132) hide show
  1. checksums.yaml +7 -0
  2. data/app/controllers/erp_work_effort/erp_app/organizer/tasks/base_controller.rb +13 -0
  3. data/app/controllers/erp_work_effort/erp_app/organizer/tasks/work_efforts_controller.rb +128 -0
  4. data/app/models/associated_transportation_route.rb +12 -0
  5. data/app/models/associated_work_effort.rb +12 -0
  6. data/app/models/deliverable.rb +7 -0
  7. data/app/models/deliverable_type.rb +9 -0
  8. data/app/models/extensions/party.rb +0 -2
  9. data/app/models/good_type.rb +11 -0
  10. data/app/models/party_fixed_asset_assignment.rb +12 -0
  11. data/app/models/party_skill.rb +6 -0
  12. data/app/models/requirement.rb +14 -0
  13. data/app/models/requirement_party_role.rb +8 -0
  14. data/app/models/requirement_type.rb +7 -0
  15. data/app/models/skill_type.rb +10 -0
  16. data/app/models/transportation_route.rb +71 -0
  17. data/app/models/transportation_route_segment.rb +9 -0
  18. data/app/models/transportation_route_stop.rb +6 -0
  19. data/app/models/work_effort.rb +82 -92
  20. data/app/models/work_effort_association.rb +16 -0
  21. data/app/models/work_effort_association_type.rb +14 -0
  22. data/app/models/work_effort_deliverable_produced.rb +6 -0
  23. data/app/models/work_effort_fixed_asset_assignment.rb +10 -0
  24. data/app/models/work_effort_fixed_asset_serviced.rb +6 -0
  25. data/app/models/work_effort_fixed_asset_standard.rb +7 -0
  26. data/app/models/work_effort_good_standard.rb +7 -0
  27. data/app/models/work_effort_inventory_assignment.rb +10 -0
  28. data/app/models/work_effort_inventory_produced.rb +7 -0
  29. data/app/models/work_effort_party_assignment.rb +12 -0
  30. data/app/models/work_effort_purpose_type.rb +11 -0
  31. data/app/models/work_effort_skill_standard.rb +7 -0
  32. data/app/models/work_effort_type.rb +9 -0
  33. data/app/models/work_effort_type_association.rb +10 -0
  34. data/app/models/work_order_item.rb +5 -0
  35. data/app/models/work_order_item_fulfillment.rb +11 -0
  36. data/app/models/work_requirement_fulfillment.rb +3 -0
  37. data/config/routes.rb +20 -0
  38. data/db/data_migrations/20131213151309_create_tasks_organizer_application.rb +14 -0
  39. data/db/data_migrations/20131215225329_add_task_work_effort_types.rb +11 -0
  40. data/db/data_migrations/20131215234936_add_task_statuses.rb +21 -0
  41. data/db/migrate/20100220000000_base_work_efforts.rb +506 -103
  42. data/db/migrate/20130829153419_base_routes.rb +93 -0
  43. data/db/migrate/20131213140617_add_work_effort_role_assignments.rb +16 -0
  44. data/db/migrate/20131213144223_add_work_item_to_work_effort.rb +8 -0
  45. data/db/migrate/20140106184615_update_work_effort_item_id_to_int.rb +27 -0
  46. data/lib/erp_work_effort.rb +1 -1
  47. data/lib/erp_work_effort/engine.rb +7 -5
  48. data/lib/erp_work_effort/extensions.rb +2 -4
  49. data/lib/erp_work_effort/extensions/active_record/acts_as_routable.rb +55 -0
  50. data/lib/erp_work_effort/extensions/active_record/acts_as_work_effort.rb +66 -0
  51. data/lib/erp_work_effort/version.rb +7 -3
  52. data/spec/models/deliverable_spec.rb +5 -0
  53. data/spec/models/deliverable_type_spec.rb +5 -0
  54. data/spec/models/facility_spec.rb +8 -0
  55. data/spec/models/facility_type_spec.rb +8 -0
  56. data/spec/models/fixed_asset_party_role_spec.rb +5 -0
  57. data/spec/models/fixed_asset_spec.rb +5 -0
  58. data/spec/models/fixed_asset_type_spec.rb +5 -0
  59. data/spec/models/good_type_spec.rb +5 -0
  60. data/spec/models/party_fixed_asset_assignment_spec.rb +5 -0
  61. data/spec/models/party_skill_spec.rb +5 -0
  62. data/spec/models/requirement_party_role_spec.rb +5 -0
  63. data/spec/models/requirement_spec.rb +5 -0
  64. data/spec/models/requirement_type_spec.rb +5 -0
  65. data/spec/models/skill_type_spec.rb +8 -0
  66. data/spec/models/work_effort_association_spec.rb +5 -0
  67. data/spec/models/work_effort_association_type_spec.rb +5 -0
  68. data/spec/models/work_effort_deliverable_produced_spec.rb +5 -0
  69. data/spec/models/work_effort_fixed_asset_assignment_spec.rb +5 -0
  70. data/spec/models/work_effort_fixed_asset_serviced_spec.rb +5 -0
  71. data/spec/models/work_effort_fixed_asset_standard_spec.rb +5 -0
  72. data/spec/models/work_effort_good_standard_spec.rb +5 -0
  73. data/spec/models/work_effort_inventory_assignment_spec.rb +5 -0
  74. data/spec/models/work_effort_inventory_produced_spec.rb +5 -0
  75. data/spec/models/work_effort_party_assignment_spec.rb +5 -0
  76. data/spec/models/work_effort_purpose_type_spec.rb +5 -0
  77. data/spec/models/work_effort_skill_standard_spec.rb +5 -0
  78. data/spec/models/work_effort_spec.rb +49 -0
  79. data/spec/models/work_effort_type_association_spec.rb +5 -0
  80. data/spec/models/work_effort_type_spec.rb +5 -0
  81. data/spec/models/work_order_item_fulfillment_spec.rb +5 -0
  82. data/spec/models/work_order_item_spec.rb +29 -0
  83. data/spec/models/work_requirement_fulfillment_spec.rb +5 -0
  84. metadata +141 -105
  85. data/app/assets/javascripts/erp_work_effort/application.js +0 -9
  86. data/app/assets/stylesheets/erp_work_effort/application.css +0 -7
  87. data/app/controllers/erp_work_effort/application_controller.rb +0 -4
  88. data/app/helpers/erp_work_effort/application_helper.rb +0 -4
  89. data/app/models/cost.rb +0 -5
  90. data/app/models/project_effort.rb +0 -2
  91. data/app/models/project_requirement.rb +0 -2
  92. data/app/models/support_effort.rb +0 -2
  93. data/app/models/support_requirement.rb +0 -2
  94. data/app/models/work_effort_assignment.rb +0 -12
  95. data/app/models/work_effort_status.rb +0 -6
  96. data/app/models/work_effort_status_type.rb +0 -15
  97. data/app/models/work_requirement.rb +0 -78
  98. data/app/models/work_requirement_work_effort_status_type.rb +0 -6
  99. data/app/views/layouts/erp_work_effort/application.html.erb +0 -14
  100. data/lib/erp_work_effort/extensions/active_record/acts_as_project_effort.rb +0 -66
  101. data/lib/erp_work_effort/extensions/active_record/acts_as_project_requirement.rb +0 -64
  102. data/lib/erp_work_effort/extensions/active_record/acts_as_support_effort.rb +0 -61
  103. data/lib/erp_work_effort/extensions/active_record/acts_as_support_requirement.rb +0 -68
  104. data/spec/dummy/db/data_migrations/20110109173616_create_capability_scope_types.erp_tech_svcs.rb +0 -15
  105. data/spec/dummy/db/data_migrations/20110525001935_add_usd_currency.erp_base_erp_svcs.rb +0 -12
  106. data/spec/dummy/db/data_migrations/20110609150135_add_iso_codes.erp_base_erp_svcs.rb +0 -19
  107. data/spec/dummy/db/data_migrations/20110802200222_schedule_delete_expired_sessions_job.erp_tech_svcs.rb +0 -16
  108. data/spec/dummy/db/data_migrations/20110913145838_setup_compass_ae_instance.erp_base_erp_svcs.rb +0 -12
  109. data/spec/dummy/db/data_migrations/20111111144706_setup_audit_log_types.erp_tech_svcs.rb +0 -22
  110. data/spec/dummy/db/data_migrations/20121116155018_create_group_relationship_and_role_types.erp_tech_svcs.rb +0 -20
  111. data/spec/dummy/db/data_migrations/20121130212146_note_capabilities.erp_tech_svcs.rb +0 -24
  112. data/spec/dummy/db/migrate/20130107204429_base_erp_services.erp_base_erp_svcs.rb +0 -461
  113. data/spec/dummy/db/migrate/20130107204430_base_work_efforts.erp_work_effort.rb +0 -211
  114. data/spec/dummy/db/migrate/20130107204431_base_tech_services.erp_tech_svcs.rb +0 -271
  115. data/spec/dummy/db/migrate/20130107204432_create_has_attribute_tables.erp_tech_svcs.rb +0 -39
  116. data/spec/dummy/db/migrate/20130107204433_create_groups.erp_tech_svcs.rb +0 -19
  117. data/spec/dummy/db/migrate/20130107204434_upgrade_security.erp_tech_svcs.rb +0 -54
  118. data/spec/dummy/db/migrate/20130107204435_upgrade_security2.erp_tech_svcs.rb +0 -270
  119. data/spec/dummy/db/schema.rb +0 -750
  120. data/spec/dummy/db/spec.sqlite3 +0 -0
  121. data/spec/models/cost_spec.rb +0 -11
  122. data/spec/models/project_effort_spec.rb +0 -11
  123. data/spec/models/project_requirement_spec.rb +0 -11
  124. data/spec/models/support_effort_spec.rb +0 -11
  125. data/spec/models/support_requirement_spec.rb +0 -11
  126. data/spec/models/valid_work_assignment_attribute_spec.rb +0 -11
  127. data/spec/models/valid_work_assignment_spec.rb +0 -11
  128. data/spec/models/work_effort_assignment_spec.rb +0 -13
  129. data/spec/models/work_effort_status_spec.rb +0 -11
  130. data/spec/models/work_effort_status_type_spec.rb +0 -11
  131. data/spec/models/work_requirement_spec.rb +0 -11
  132. data/spec/models/work_requirement_work_effort_status_type._spec.rb +0 -11
@@ -1,211 +0,0 @@
1
- # This migration comes from erp_work_effort (originally 20100220000000)
2
- class BaseWorkEfforts < ActiveRecord::Migration
3
-
4
- def self.up
5
-
6
- ## work_efforts
7
- unless table_exists?(:work_efforts)
8
- create_table :work_efforts do |t|
9
- t.string :description
10
- t.string :type
11
- t.datetime :started_at
12
- t.datetime :finished_at
13
- t.integer :projected_completion_time
14
- t.integer :actual_completion_time
15
-
16
- t.timestamps
17
-
18
- #polymorphic columns
19
- t.integer :facility_id
20
- t.string :facility_type
21
- t.integer :work_effort_record_id
22
- t.string :work_effort_record_type
23
-
24
- #foreign keys
25
- t.integer :projected_cost_id
26
- t.integer :actual_cost_id
27
-
28
- #better nested set columns
29
- t.integer :parent_id
30
- t.integer :lft
31
- t.integer :rgt
32
- end
33
-
34
- add_index :work_efforts, [:work_effort_record_id, :work_effort_record_type], :name => "work_effort_record_id_type"
35
- add_index :work_efforts, [:facility_type, :facility_id], :name => "facility"
36
- add_index :work_efforts, :finished_at
37
- end
38
-
39
- ## work_requirements
40
- unless table_exists?(:work_requirements)
41
- create_table :work_requirements do |t|
42
- t.string :description
43
- t.string :type
44
- t.integer :projected_completion_time
45
- t.timestamps
46
-
47
- #polymorphic columns
48
- t.integer :work_requirement_record_id
49
- t.string :work_requirement_record_type
50
- t.integer :facility_id
51
- t.string :facility_type
52
-
53
- # foreign keys
54
- t.integer :cost_id
55
-
56
- #better nested set columns
57
- t.integer :parent_id
58
- t.integer :lft
59
- t.integer :rgt
60
- end
61
- end
62
-
63
- ## work_requirement_work_effort_status_types
64
- unless table_exists?(:work_requirement_work_effort_status_types)
65
- create_table :work_requirement_work_effort_status_types do |t|
66
- t.timestamps
67
-
68
- #foreign keys
69
- t.integer :work_requirement_id
70
- t.integer :work_effort_status_type_id
71
- t.boolean :is_initial_status
72
- end
73
- end
74
-
75
- ## work_effort_statuses
76
- unless table_exists?(:work_effort_statuses)
77
- create_table :work_effort_statuses do |t|
78
- t.datetime :started_at
79
- t.datetime :finished_at
80
- t.integer :work_effort_id
81
- t.integer :work_effort_status_type_id
82
-
83
- t.timestamps
84
- end
85
-
86
- add_index :work_effort_statuses, :work_effort_status_type_id
87
- add_index :work_effort_statuses, :work_effort_id
88
- end
89
-
90
- ## work_effort_status_types
91
- unless table_exists?(:work_effort_status_types)
92
- create_table :work_effort_status_types do |t|
93
- t.string :internal_identifier
94
- t.string :description
95
- t.integer :next_status_id
96
- t.integer :previous_status_id
97
-
98
- t.timestamps
99
- end
100
-
101
- add_index :work_effort_status_types, :internal_identifier
102
- add_index :work_effort_status_types, :description
103
- end
104
-
105
- ## work_effort_assignments
106
- unless table_exists?(:work_effort_assignments)
107
- create_table :work_effort_assignments do |t|
108
- #foreign keys
109
- t.references :work_effort
110
-
111
- t.datetime :assigned_at
112
- t.datetime :assigned_from
113
- t.datetime :assigned_thru
114
- t.datetime :unassigned_at
115
-
116
- #Polymorphic Columns
117
- t.integer :assigned_to_id
118
- t.string :assigned_to_type
119
- t.integer :assigned_by_id
120
- t.string :assigned_by_type
121
-
122
- t.timestamps
123
- end
124
-
125
- add_index :work_effort_assignments, [:assigned_to_id, :assigned_to_type], :name => "assigned_to"
126
- add_index :work_effort_assignments, :assigned_from
127
- add_index :work_effort_assignments, :assigned_thru
128
- add_index :work_effort_assignments, :work_effort_id
129
- end
130
-
131
- ## valid_work_assignments
132
- unless table_exists?(:valid_work_assignments)
133
- create_table :valid_work_assignments do |t|
134
- t.integer :role_type_id
135
- t.integer :work_requirement_id
136
-
137
- t.timestamps
138
- end
139
-
140
- end
141
-
142
- ## valid_work_assignment_attributes
143
- unless table_exists?(:valid_work_assignment_attributes)
144
- create_table :valid_work_assignment_attributes do |t|
145
- t.integer :valid_work_assignment_id
146
- t.string :name
147
- t.string :type
148
- t.string :value
149
-
150
- t.timestamps
151
- end
152
- end
153
-
154
- ## party_resource_availabilities
155
- unless table_exists?(:party_resource_availabilities)
156
- create_table :party_resource_availabilities do |t|
157
- t.datetime :from_date
158
- t.datetime :to_date
159
- t.integer :party_id
160
- t.integer :pra_type_id #:party_resource_availability_type_id is too long
161
-
162
- t.timestamps
163
- end
164
-
165
- add_index :party_resource_availabilities, :from_date
166
- add_index :party_resource_availabilities, :to_date
167
- add_index :party_resource_availabilities, :pra_type_id
168
- add_index :party_resource_availabilities, :party_id
169
- end
170
-
171
- unless table_exists?(:party_resource_availability_types)
172
- create_table :party_resource_availability_types do |t|
173
- t.string :description
174
- t.string :internal_identifier
175
-
176
- t.timestamps
177
- end
178
-
179
- add_index :party_resource_availability_types, :internal_identifier
180
- add_index :party_resource_availability_types, :description
181
- end
182
-
183
- ## costs
184
- unless table_exists?(:costs)
185
- create_table :costs do |t|
186
- t.integer :money_id
187
- t.timestamps
188
- end
189
- end
190
-
191
- end
192
-
193
- def self.down
194
- # Drop all tables, including those that were originally created then deleted
195
- [
196
- # Old tables deleted and no longer used
197
- :work_requirement_assignabilities,
198
- # Currently used tables
199
- :category_classifications, :categories, :work_requirement_assignability_attributes,
200
- :valid_work_assignments, :work_effort_assignments, :work_effort_status_types,
201
- :work_effort_statuses, :work_requirement_work_effort_status_types,
202
- :work_requirements, :work_efforts, :party_resource_availabilities, :party_resource_availability_types,
203
- :costs
204
- ].each do |tbl|
205
- if table_exists?(tbl)
206
- drop_table tbl
207
- end
208
- end
209
-
210
- end
211
- end
@@ -1,271 +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?(:groups)
54
- create_table :groups do |t|
55
- t.column :description, :string
56
- t.timestamps
57
- end
58
- end
59
-
60
- unless table_exists?(:security_roles)
61
- # create the roles table
62
- create_table :security_roles do |t|
63
- t.column :description, :string
64
- t.column :internal_identifier, :string
65
- t.column :external_identifier, :string
66
- t.column :external_id_source, :string
67
-
68
- t.timestamps
69
- end
70
- end
71
-
72
- unless table_exists?(:sessions)
73
- # Create sessions table
74
- create_table :sessions do |t|
75
- t.string :session_id, :null => false
76
- t.text :data
77
- t.timestamps
78
- end
79
- add_index :sessions, :session_id
80
- add_index :sessions, :updated_at
81
- end
82
-
83
- unless table_exists?(:audit_logs)
84
- # Create audit_logs
85
- create_table :audit_logs do |t|
86
- t.string :application
87
- t.string :description
88
- t.integer :party_id
89
- t.text :additional_info
90
- t.references :audit_log_type
91
-
92
- #polymorphic columns
93
- t.references :event_record, :polymorphic => true
94
-
95
- t.timestamps
96
- end
97
- add_index :audit_logs, :party_id
98
- add_index :audit_logs, [:event_record_id, :event_record_type], :name => 'event_record_index'
99
- end
100
-
101
- unless table_exists?(:audit_log_types)
102
- # Create audit_logs
103
- create_table :audit_log_types do |t|
104
- t.string :description
105
- t.string :error_code
106
- t.string :comments
107
- t.string :internal_identifier
108
- t.string :external_identifier
109
- t.string :external_id_source
110
-
111
- #better nested set columns
112
- t.integer :parent_id
113
- t.integer :lft
114
- t.integer :rgt
115
-
116
- t.timestamps
117
- end
118
- end
119
-
120
- unless table_exists?(:audit_log_items)
121
- # Create audit_log_items
122
- create_table :audit_log_items do |t|
123
- t.references :audit_log
124
- t.references :audit_log_item_type
125
- t.string :audit_log_item_value
126
- t.string :description
127
-
128
- t.timestamps
129
- end
130
- end
131
-
132
- unless table_exists?(:audit_log_item_types)
133
- # Create audit_log_item_types
134
- create_table :audit_log_item_types do |t|
135
- t.string :internal_identifier
136
- t.string :external_identifier
137
- t.string :external_id_source
138
- t.string :description
139
- t.string :comments
140
-
141
- #better nested set columns
142
- t.integer :parent_id
143
- t.integer :lft
144
- t.integer :rgt
145
-
146
- t.timestamps
147
- end
148
- end
149
-
150
- unless table_exists?(:file_assets)
151
- create_table :file_assets do |t|
152
- t.references :file_asset_holder, :polymorphic => true
153
- t.string :type
154
- t.string :name
155
- t.string :directory
156
- t.string :data_file_name
157
- t.string :data_content_type
158
- t.integer :data_file_size
159
- t.datetime :data_updated_at
160
- t.string :width
161
- t.string :height
162
-
163
- t.timestamps
164
- end
165
- add_index :file_assets, :type
166
- add_index :file_assets, [:file_asset_holder_id, :file_asset_holder_type], :name => 'file_asset_holder_idx'
167
- add_index :file_assets, :name
168
- add_index :file_assets, :directory
169
- end
170
-
171
- unless table_exists?(:delayed_jobs)
172
- create_table :delayed_jobs, :force => true do |table|
173
- table.integer :priority, :default => 0 # Allows some jobs to jump to the front of the queue
174
- table.integer :attempts, :default => 0 # Provides for retries, but still fail eventually.
175
- table.text :handler # YAML-encoded string of the object that will do work
176
- table.text :last_error # reason for last failure (See Note below)
177
- table.datetime :run_at # When to run. Could be Time.zone.now for immediately, or sometime in the future.
178
- table.datetime :locked_at # Set when a client is working on this object
179
- table.datetime :failed_at # Set when all retries have failed (actually, by default, the record is deleted instead)
180
- table.string :locked_by # Who is working on this object (if locked)
181
- table.string :queue
182
- table.timestamps
183
- end
184
- add_index :delayed_jobs, [:priority, :run_at], :name => 'delayed_jobs_priority'
185
- end
186
-
187
- unless table_exists?(:capable_models)
188
- # create the roles table
189
- create_table :capable_models do |t|
190
- t.references :capable_model_record, :polymorphic => true
191
-
192
- t.timestamps
193
- end
194
-
195
- add_index :capable_models, [:capable_model_record_id, :capable_model_record_type], :name => 'capable_model_record_idx'
196
- end
197
-
198
- unless table_exists?(:capability_types)
199
- # create the roles table
200
- create_table :capability_types do |t|
201
- t.string :internal_identifier
202
- t.string :description
203
- t.timestamps
204
- end
205
- end
206
-
207
- unless table_exists?(:capabilities)
208
- # create the roles table
209
- create_table :capabilities do |t|
210
- t.string :description
211
- t.references :capability_type
212
- t.string :capability_resource_type
213
- t.integer :capability_resource_id
214
- t.integer :scope_type_id
215
- t.text :scope_query
216
- t.timestamps
217
- end
218
-
219
- add_index :capabilities, :capability_type_id
220
- add_index :capabilities, :scope_type_id
221
- add_index :capabilities, [:capability_resource_id, :capability_resource_type], :name => 'capability_resource_index'
222
- end
223
-
224
- unless table_exists?(:capability_accessors)
225
- create_table :capability_accessors do |t|
226
- t.string :capability_accessor_record_type
227
- t.integer :capability_accessor_record_id
228
- t.integer :capability_id
229
- t.timestamps
230
- end
231
-
232
- add_index :capability_accessors, :capability_id
233
- add_index :capability_accessors, [:capability_accessor_record_id, :capability_accessor_record_type], :name => 'capability_accessor_record_index'
234
- end
235
-
236
- unless table_exists?(:scope_types)
237
- create_table :scope_types do |t|
238
- t.string :description
239
- t.string :internal_identifier
240
- t.timestamps
241
- end
242
-
243
- add_index :scope_types, :internal_identifier
244
- end
245
-
246
- unless table_exists?(:parties_security_roles)
247
- create_table :parties_security_roles, :id => false do |t|
248
- t.integer :party_id
249
- t.integer :security_role_id
250
- end
251
-
252
- add_index :parties_security_roles, :party_id
253
- add_index :parties_security_roles, :security_role_id
254
- end
255
-
256
- end
257
-
258
- def self.down
259
- # check that each table exists before trying to delete it.
260
- [ :groups,
261
- :audit_logs, :sessions, :simple_captcha_data,
262
- :capability_accessors, :capability_types, :capabilities,:scope_types,
263
- :parties_security_roles, :roles, :audit_log_items, :audit_log_item_types,
264
- :users, :file_assets, :delayed_jobs
265
- ].each do |tbl|
266
- if table_exists?(tbl)
267
- drop_table tbl
268
- end
269
- end
270
- end
271
- end