knitkit 2.1.9 → 2.1.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/app/controllers/knitkit/erp_app/desktop/image_assets_controller.rb +2 -2
- data/app/controllers/knitkit/online_document_sections_controller.rb +26 -16
- data/app/models/content.rb +52 -42
- data/app/models/documented_content.rb +57 -3
- data/app/models/online_document_section.rb +1 -1
- data/app/views/knitkit/online_document_sections/index.html.erb +175 -85
- data/app/views/layouts/knitkit/online_document_sections.html.erb +1 -1
- data/lib/knitkit/config.rb +3 -2
- data/lib/knitkit/version.rb +1 -1
- metadata +3 -123
- data/spec/dummy/db/data_migrations/20110109173616_create_capability_scope_types.erp_tech_svcs.rb +0 -15
- data/spec/dummy/db/data_migrations/20110509223702_add_publisher_role.knitkit.rb +0 -22
- data/spec/dummy/db/data_migrations/20110525001935_add_usd_currency.erp_base_erp_svcs.rb +0 -12
- data/spec/dummy/db/data_migrations/20110608185830_create_default_dynamic_models_and_forms.erp_forms.rb +0 -33
- data/spec/dummy/db/data_migrations/20110609150135_add_iso_codes.erp_base_erp_svcs.rb +0 -19
- data/spec/dummy/db/data_migrations/20110728201729_erp_app_setup.erp_app.rb +0 -252
- data/spec/dummy/db/data_migrations/20110728201733_update_preferences.erp_app.rb +0 -53
- data/spec/dummy/db/data_migrations/20110802200222_schedule_delete_expired_sessions_job.erp_tech_svcs.rb +0 -16
- data/spec/dummy/db/data_migrations/20110816153456_add_knitkit_application.knitkit.rb +0 -32
- data/spec/dummy/db/data_migrations/20110816161238_create_desktop_app_audit_log_viewer.erp_app.rb +0 -21
- data/spec/dummy/db/data_migrations/20110817160743_add_file_manager_application.erp_app.rb +0 -32
- data/spec/dummy/db/data_migrations/20110828190913_create_desktop_app_dynamic_forms.erp_forms.rb +0 -19
- data/spec/dummy/db/data_migrations/20110913145838_setup_compass_ae_instance.erp_base_erp_svcs.rb +0 -12
- data/spec/dummy/db/data_migrations/20111108183739_add_default_capabilities.erp_app.rb +0 -23
- data/spec/dummy/db/data_migrations/20111108183740_add_new_contact_widgets.erp_app.rb +0 -42
- data/spec/dummy/db/data_migrations/20111111144706_setup_audit_log_types.erp_tech_svcs.rb +0 -22
- data/spec/dummy/db/data_migrations/20111118182910_setup_knitkit_capabilities.knitkit.rb +0 -128
- data/spec/dummy/db/data_migrations/20120127144444_create_website_role_types.knitkit.rb +0 -14
- data/spec/dummy/db/data_migrations/20120127150505_create_website_default_configuration.knitkit.rb +0 -73
- data/spec/dummy/db/data_migrations/20120127150506_add_primary_host_to_website_configuration.knitkit.rb +0 -34
- data/spec/dummy/db/data_migrations/20120229160222_add_userinfo_widget.erp_app.rb +0 -29
- data/spec/dummy/db/data_migrations/20120316150424_add_is_template_to_default_website_config.knitkit.rb +0 -17
- data/spec/dummy/db/data_migrations/20120405193721_create_party_and_role_type_for_communication_events.erp_app.rb +0 -11
- data/spec/dummy/db/data_migrations/20120411180756_create_user_management_mobile_application.erp_app.rb +0 -19
- data/spec/dummy/db/data_migrations/20120418164215_create_configuration_management_desktop_application.erp_app.rb +0 -23
- data/spec/dummy/db/data_migrations/20120809020508_update_website_and_configuration.knitkit.rb +0 -78
- data/spec/dummy/db/data_migrations/20120824013449_create_ticket_form.erp_forms.rb +0 -67
- data/spec/dummy/db/data_migrations/20121026013449_update_ticket_form.erp_forms.rb +0 -65
- data/spec/dummy/db/data_migrations/20121026191738_update_contact_form.erp_forms.rb +0 -27
- data/spec/dummy/db/data_migrations/20121116155018_create_group_relationship_and_role_types.erp_tech_svcs.rb +0 -20
- data/spec/dummy/db/data_migrations/20121129185611_upgrade_website_role_iid.knitkit.rb +0 -21
- data/spec/dummy/db/data_migrations/20121130201859_upgrade_remove_system_mgmt_app.erp_app.rb +0 -16
- data/spec/dummy/db/data_migrations/20121130212146_note_capabilities.erp_tech_svcs.rb +0 -24
- data/spec/dummy/db/data_migrations/20121218175028_create_security_management_desktop_application.erp_app.rb +0 -23
- data/spec/dummy/db/data_migrations/20130422154409_upgrade_compass_ae_instances_data.erp_base_erp_svcs.rb +0 -19
- data/spec/dummy/db/data_migrations/20130422154410_add_guid_to_instances.erp_base_erp_svcs.rb +0 -10
- data/spec/dummy/db/data_migrations/20130422154411_create_job_tracker_desktop_application.erp_app.rb +0 -23
- data/spec/dummy/db/data_migrations/20130422154412_created_tracked_jobs.erp_app.rb +0 -15
- data/spec/dummy/db/data_migrations/20130422154413_add_job_tracker_mobile_app.erp_app.rb +0 -17
- data/spec/dummy/db/migrate/20130107153232_base_erp_services.erp_base_erp_svcs.rb +0 -461
- data/spec/dummy/db/migrate/20130107153233_base_tech_services.erp_tech_svcs.rb +0 -271
- data/spec/dummy/db/migrate/20130107153234_create_has_attribute_tables.erp_tech_svcs.rb +0 -39
- data/spec/dummy/db/migrate/20130107153235_create_groups.erp_tech_svcs.rb +0 -19
- data/spec/dummy/db/migrate/20130107153236_upgrade_security.erp_tech_svcs.rb +0 -54
- data/spec/dummy/db/migrate/20130107153237_upgrade_security2.erp_tech_svcs.rb +0 -270
- data/spec/dummy/db/migrate/20130107153238_base_app_framework.erp_app.rb +0 -276
- data/spec/dummy/db/migrate/20130107153239_dynamic_forms.erp_forms.rb +0 -95
- data/spec/dummy/db/migrate/20130107153240_create_tickets.erp_forms.rb +0 -19
- data/spec/dummy/db/migrate/20130107153241_upgrade_dynamic_forms_table.erp_forms.rb +0 -32
- data/spec/dummy/db/migrate/20130107153242_setup_knitkit.knitkit.rb +0 -316
- data/spec/dummy/db/migrate/20130422154401_add_txn_status.erp_base_erp_svcs.rb +0 -37
- data/spec/dummy/db/migrate/20130422154402_upgrade_compass_ae_instances.erp_base_erp_svcs.rb +0 -34
- data/spec/dummy/db/migrate/20130422154403_add_uuid_compass_ae_instance.erp_base_erp_svcs.rb +0 -17
- data/spec/dummy/db/migrate/20130422154404_add_long_lat_to_address.erp_base_erp_svcs.rb +0 -16
- data/spec/dummy/db/migrate/20130422154405_add_queue_to_delayed_jobs.erp_tech_svcs.rb +0 -14
- data/spec/dummy/db/migrate/20130422154406_add_job_tracker.erp_app.rb +0 -20
- data/spec/dummy/db/migrate/20130422154407_update_mobile_application.erp_app.rb +0 -28
- data/spec/dummy/db/migrate/20130422154408_add_use_markdown_to_section.knitkit.rb +0 -20
- data/spec/dummy/db/schema.rb +0 -1248
- data/spec/dummy/db/spec.sqlite3 +0 -0
|
@@ -1,316 +0,0 @@
|
|
|
1
|
-
# This migration comes from knitkit (originally 20110211002317)
|
|
2
|
-
class SetupKnitkit < ActiveRecord::Migration
|
|
3
|
-
def self.up
|
|
4
|
-
|
|
5
|
-
unless table_exists?(:websites)
|
|
6
|
-
create_table :websites do |t|
|
|
7
|
-
t.string :name
|
|
8
|
-
t.string :title
|
|
9
|
-
t.string :subtitle
|
|
10
|
-
t.string :internal_identifier
|
|
11
|
-
t.string :email
|
|
12
|
-
t.boolean :auto_activate_publication
|
|
13
|
-
t.boolean :email_inquiries
|
|
14
|
-
|
|
15
|
-
t.timestamps
|
|
16
|
-
end
|
|
17
|
-
end
|
|
18
|
-
|
|
19
|
-
unless table_exists?(:website_hosts)
|
|
20
|
-
create_table :website_hosts do |t|
|
|
21
|
-
t.references :website
|
|
22
|
-
t.string :host
|
|
23
|
-
|
|
24
|
-
t.timestamps
|
|
25
|
-
end
|
|
26
|
-
|
|
27
|
-
add_index :website_hosts, :website_id
|
|
28
|
-
end
|
|
29
|
-
|
|
30
|
-
unless table_exists?(:website_inquiries)
|
|
31
|
-
create_table :website_inquiries do |t|
|
|
32
|
-
t.integer :website_id
|
|
33
|
-
|
|
34
|
-
t.timestamps
|
|
35
|
-
end
|
|
36
|
-
|
|
37
|
-
add_index :website_inquiries, :website_id
|
|
38
|
-
end
|
|
39
|
-
|
|
40
|
-
unless table_exists?(:website_sections)
|
|
41
|
-
create_table :website_sections do |t|
|
|
42
|
-
t.string :title
|
|
43
|
-
t.string :type
|
|
44
|
-
t.references :website
|
|
45
|
-
t.string :path
|
|
46
|
-
t.string :permalink
|
|
47
|
-
t.text :layout
|
|
48
|
-
t.boolean :in_menu
|
|
49
|
-
t.integer :position, :default => 0
|
|
50
|
-
t.string :internal_identifier
|
|
51
|
-
t.integer :version
|
|
52
|
-
t.boolean :render_base_layout, :default => true
|
|
53
|
-
|
|
54
|
-
#better nested set columns
|
|
55
|
-
t.integer :parent_id
|
|
56
|
-
t.integer :lft
|
|
57
|
-
t.integer :rgt
|
|
58
|
-
|
|
59
|
-
t.timestamps
|
|
60
|
-
end
|
|
61
|
-
#indexes
|
|
62
|
-
add_index :website_sections, :permalink
|
|
63
|
-
add_index :website_sections, :website_id
|
|
64
|
-
add_index :website_sections, :position
|
|
65
|
-
add_index :website_sections, :parent_id
|
|
66
|
-
add_index :website_sections, :lft
|
|
67
|
-
add_index :website_sections, :rgt
|
|
68
|
-
add_index :website_sections, :version
|
|
69
|
-
add_index :website_sections, :internal_identifier, :name => 'section_iid_idx'
|
|
70
|
-
|
|
71
|
-
WebsiteSection.create_versioned_table
|
|
72
|
-
end
|
|
73
|
-
|
|
74
|
-
unless table_exists?(:contents)
|
|
75
|
-
create_table :contents do |t|
|
|
76
|
-
t.string :type
|
|
77
|
-
t.string :title
|
|
78
|
-
t.string :permalink
|
|
79
|
-
t.text :excerpt_html
|
|
80
|
-
t.text :body_html
|
|
81
|
-
t.integer :created_by_id
|
|
82
|
-
t.integer :updated_by_id
|
|
83
|
-
t.string :internal_identifier
|
|
84
|
-
t.boolean :display_title
|
|
85
|
-
t.integer :version
|
|
86
|
-
|
|
87
|
-
t.timestamps
|
|
88
|
-
end
|
|
89
|
-
#indexes
|
|
90
|
-
add_index :contents, :type
|
|
91
|
-
add_index :contents, :created_by_id
|
|
92
|
-
add_index :contents, :updated_by_id
|
|
93
|
-
add_index :contents, :permalink
|
|
94
|
-
add_index :contents, :version
|
|
95
|
-
add_index :contents, :internal_identifier, :name => 'contents_iid_idx'
|
|
96
|
-
|
|
97
|
-
Content.create_versioned_table
|
|
98
|
-
end
|
|
99
|
-
|
|
100
|
-
unless table_exists?(:website_section_contents)
|
|
101
|
-
create_table :website_section_contents do |t|
|
|
102
|
-
t.integer :website_section_id
|
|
103
|
-
t.integer :content_id
|
|
104
|
-
t.string :content_area
|
|
105
|
-
t.integer :position, :default => 0
|
|
106
|
-
|
|
107
|
-
t.timestamps
|
|
108
|
-
end
|
|
109
|
-
#indexes
|
|
110
|
-
add_index :website_section_contents, :website_section_id
|
|
111
|
-
add_index :website_section_contents, :content_id
|
|
112
|
-
add_index :website_section_contents, :position
|
|
113
|
-
add_index :website_section_contents, :content_area
|
|
114
|
-
end
|
|
115
|
-
|
|
116
|
-
unless table_exists?(:themes)
|
|
117
|
-
create_table :themes do |t|
|
|
118
|
-
t.references :website
|
|
119
|
-
t.string :name
|
|
120
|
-
t.string :theme_id
|
|
121
|
-
t.string :author
|
|
122
|
-
t.integer :version
|
|
123
|
-
t.string :homepage
|
|
124
|
-
t.text :summary
|
|
125
|
-
t.integer :active
|
|
126
|
-
|
|
127
|
-
t.timestamps
|
|
128
|
-
end
|
|
129
|
-
#indexes
|
|
130
|
-
add_index :themes, :website_id
|
|
131
|
-
add_index :themes, :active
|
|
132
|
-
end
|
|
133
|
-
|
|
134
|
-
unless table_exists?(:published_websites)
|
|
135
|
-
create_table :published_websites do |t|
|
|
136
|
-
t.references :website
|
|
137
|
-
t.text :comment
|
|
138
|
-
t.decimal :version, :precision => 18, :scale => 6
|
|
139
|
-
t.boolean :active
|
|
140
|
-
t.integer :published_by_id
|
|
141
|
-
|
|
142
|
-
t.timestamps
|
|
143
|
-
end
|
|
144
|
-
|
|
145
|
-
#indexes
|
|
146
|
-
add_index :published_websites, :website_id
|
|
147
|
-
add_index :published_websites, :version
|
|
148
|
-
add_index :published_websites, :active
|
|
149
|
-
add_index :published_websites, :published_by_id
|
|
150
|
-
end
|
|
151
|
-
|
|
152
|
-
unless table_exists?(:published_elements)
|
|
153
|
-
create_table :published_elements do |t|
|
|
154
|
-
t.references :published_website
|
|
155
|
-
t.references :published_element_record, :polymorphic => true
|
|
156
|
-
t.integer :version
|
|
157
|
-
t.integer :published_by_id
|
|
158
|
-
|
|
159
|
-
t.timestamps
|
|
160
|
-
end
|
|
161
|
-
|
|
162
|
-
#indexes
|
|
163
|
-
add_index :published_elements, [:published_element_record_id, :published_element_record_type], :name => 'published_elm_idx'
|
|
164
|
-
add_index :published_elements, :published_website_id
|
|
165
|
-
add_index :published_elements, :version
|
|
166
|
-
add_index :published_elements, :published_by_id
|
|
167
|
-
end
|
|
168
|
-
|
|
169
|
-
unless table_exists?(:comments)
|
|
170
|
-
create_table :comments do |t|
|
|
171
|
-
t.string :commentor_name
|
|
172
|
-
t.string :email
|
|
173
|
-
t.text :comment
|
|
174
|
-
t.integer :approved
|
|
175
|
-
t.datetime :approved_at
|
|
176
|
-
t.references :user
|
|
177
|
-
t.references :commented_record, :polymorphic => true
|
|
178
|
-
|
|
179
|
-
t.timestamps
|
|
180
|
-
end
|
|
181
|
-
|
|
182
|
-
add_index :comments, [:commented_record_id, :commented_record_type], :name => 'commented_record_idx'
|
|
183
|
-
add_index :comments, [:approved]
|
|
184
|
-
add_index :comments, [:user_id]
|
|
185
|
-
end
|
|
186
|
-
|
|
187
|
-
unless table_exists?(:website_nav_items)
|
|
188
|
-
create_table :website_nav_items do |t|
|
|
189
|
-
t.references :website_nav
|
|
190
|
-
t.string :title
|
|
191
|
-
t.string :url
|
|
192
|
-
t.integer :position, :default => 0
|
|
193
|
-
t.references :linked_to_item, :polymorphic => true
|
|
194
|
-
|
|
195
|
-
#better nested set columns
|
|
196
|
-
t.integer :parent_id
|
|
197
|
-
t.integer :lft
|
|
198
|
-
t.integer :rgt
|
|
199
|
-
|
|
200
|
-
t.timestamps
|
|
201
|
-
end
|
|
202
|
-
|
|
203
|
-
add_index :website_nav_items, [:linked_to_item_id, :linked_to_item_type], :name => 'linked_to_idx'
|
|
204
|
-
add_index :website_nav_items, :website_nav_id
|
|
205
|
-
add_index :website_nav_items, :position
|
|
206
|
-
add_index :website_nav_items, :parent_id
|
|
207
|
-
add_index :website_nav_items, :lft
|
|
208
|
-
add_index :website_nav_items, :rgt
|
|
209
|
-
end
|
|
210
|
-
|
|
211
|
-
unless table_exists?(:website_navs)
|
|
212
|
-
create_table :website_navs do |t|
|
|
213
|
-
t.references :website
|
|
214
|
-
t.string :name
|
|
215
|
-
|
|
216
|
-
t.timestamps
|
|
217
|
-
end
|
|
218
|
-
|
|
219
|
-
add_index :website_navs, :website_id
|
|
220
|
-
end
|
|
221
|
-
|
|
222
|
-
unless table_exists?(:tags)
|
|
223
|
-
create_table :tags do |t|
|
|
224
|
-
t.column :name, :string
|
|
225
|
-
end
|
|
226
|
-
end
|
|
227
|
-
|
|
228
|
-
unless table_exists?(:taggings)
|
|
229
|
-
create_table :taggings do |t|
|
|
230
|
-
t.column :tag_id, :integer
|
|
231
|
-
t.column :taggable_id, :integer
|
|
232
|
-
t.column :tagger_id, :integer
|
|
233
|
-
t.column :tagger_type, :string
|
|
234
|
-
|
|
235
|
-
# You should make sure that the column created is
|
|
236
|
-
# long enough to store the required class names.
|
|
237
|
-
t.column :taggable_type, :string
|
|
238
|
-
t.column :context, :string
|
|
239
|
-
|
|
240
|
-
t.column :created_at, :datetime
|
|
241
|
-
end
|
|
242
|
-
|
|
243
|
-
add_index :taggings, :tag_id
|
|
244
|
-
add_index :taggings, [:taggable_id, :taggable_type, :context], :name => 'taggable_poly_idx'
|
|
245
|
-
end
|
|
246
|
-
|
|
247
|
-
unless table_exists? :website_party_roles
|
|
248
|
-
create_table :website_party_roles do |t|
|
|
249
|
-
#foreign keys
|
|
250
|
-
t.references :website
|
|
251
|
-
t.references :role_type
|
|
252
|
-
t.references :party
|
|
253
|
-
|
|
254
|
-
t.timestamps
|
|
255
|
-
end
|
|
256
|
-
|
|
257
|
-
add_index :website_party_roles, :website_id
|
|
258
|
-
add_index :website_party_roles, :role_type_id
|
|
259
|
-
add_index :website_party_roles, :party_id
|
|
260
|
-
end
|
|
261
|
-
|
|
262
|
-
create_table :documented_items, :force => true do |t|
|
|
263
|
-
t.string :documented_klass, :null => true
|
|
264
|
-
t.integer :documented_content_id, :null => true
|
|
265
|
-
t.integer :online_document_section_id
|
|
266
|
-
t.timestamps
|
|
267
|
-
end
|
|
268
|
-
|
|
269
|
-
create_table :documents do |t|
|
|
270
|
-
t.string :external_identifier
|
|
271
|
-
t.string :internal_identifier
|
|
272
|
-
t.string :description
|
|
273
|
-
t.datetime :document_date
|
|
274
|
-
t.text :dynamic_attributes
|
|
275
|
-
|
|
276
|
-
t.references :document_record, :polymorphic => true
|
|
277
|
-
t.references :document_type
|
|
278
|
-
|
|
279
|
-
t.timestamps
|
|
280
|
-
end
|
|
281
|
-
|
|
282
|
-
add_index :documents, [:document_record_type, :document_record_id], :name => 'document_record_poly_idx'
|
|
283
|
-
add_index :documents, :document_type_id, :name => 'document_type_idx'
|
|
284
|
-
|
|
285
|
-
create_table :document_types do |t|
|
|
286
|
-
t.string :external_identifier
|
|
287
|
-
t.string :internal_identifier
|
|
288
|
-
t.string :description
|
|
289
|
-
|
|
290
|
-
t.timestamps
|
|
291
|
-
end
|
|
292
|
-
|
|
293
|
-
create_table :valid_documents do |t|
|
|
294
|
-
t.references :document
|
|
295
|
-
t.references :documented_model, :polymorphic => true
|
|
296
|
-
end
|
|
297
|
-
|
|
298
|
-
add_index :valid_documents, :document_id
|
|
299
|
-
add_index :valid_documents, [:documented_model_id, :documented_model_type], :name => 'valid_documents_model_idx'
|
|
300
|
-
|
|
301
|
-
end
|
|
302
|
-
|
|
303
|
-
def self.down
|
|
304
|
-
WebsiteSection.drop_versioned_table
|
|
305
|
-
Content.drop_versioned_table
|
|
306
|
-
|
|
307
|
-
# check that each table exists before trying to delete it.
|
|
308
|
-
[:websites, :website_sections, :contents, :website_section_contents, :documents, :document_types, :valid_documents,
|
|
309
|
-
:themes, :theme_files, :published_websites, :published_elements, :website_party_roles,
|
|
310
|
-
:comments,:website_hosts,:website_nav_items, :website_navs, :tags, :taggings, :documented_items].each do |tbl|
|
|
311
|
-
if table_exists?(tbl)
|
|
312
|
-
drop_table tbl
|
|
313
|
-
end
|
|
314
|
-
end
|
|
315
|
-
end
|
|
316
|
-
end
|
|
@@ -1,37 +0,0 @@
|
|
|
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
|
|
@@ -1,34 +0,0 @@
|
|
|
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
|
|
@@ -1,17 +0,0 @@
|
|
|
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
|
|
@@ -1,16 +0,0 @@
|
|
|
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
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
# This migration comes from erp_tech_svcs (originally 20130410135419)
|
|
2
|
-
class AddQueueToDelayedJobs < ActiveRecord::Migration
|
|
3
|
-
def up
|
|
4
|
-
unless columns(:delayed_jobs).collect {|c| c.name}.include?('queue')
|
|
5
|
-
add_column :delayed_jobs, :queue, :string
|
|
6
|
-
end
|
|
7
|
-
end
|
|
8
|
-
|
|
9
|
-
def down
|
|
10
|
-
if columns(:delayed_jobs).collect {|c| c.name}.include?('queue')
|
|
11
|
-
remove_column :delayed_jobs, :queue, :string
|
|
12
|
-
end
|
|
13
|
-
end
|
|
14
|
-
end
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
# This migration comes from erp_app (originally 20120920145259)
|
|
2
|
-
class AddJobTracker < ActiveRecord::Migration
|
|
3
|
-
def up
|
|
4
|
-
unless table_exists?(:job_trackers)
|
|
5
|
-
create_table :job_trackers do |t|
|
|
6
|
-
t.string :job_name
|
|
7
|
-
t.string :job_klass
|
|
8
|
-
t.string :run_time
|
|
9
|
-
t.datetime :last_run_at
|
|
10
|
-
t.datetime :next_run_at
|
|
11
|
-
end
|
|
12
|
-
end
|
|
13
|
-
end
|
|
14
|
-
|
|
15
|
-
def down
|
|
16
|
-
if table_exists?(:job_trackers)
|
|
17
|
-
drop_table :job_trackers
|
|
18
|
-
end
|
|
19
|
-
end
|
|
20
|
-
end
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
# This migration comes from erp_app (originally 20130410182333)
|
|
2
|
-
class UpdateMobileApplication < ActiveRecord::Migration
|
|
3
|
-
def up
|
|
4
|
-
unless columns(:applications).collect { |c| c.name }.include?('xtype')
|
|
5
|
-
rename_column :applications, :base_url, :xtype
|
|
6
|
-
|
|
7
|
-
user_management = MobileApplication.find_by_internal_identifier('user_management')
|
|
8
|
-
if user_management.nil?
|
|
9
|
-
MobileApplication.create(
|
|
10
|
-
:description => 'User Mgmt',
|
|
11
|
-
:icon => 'icon-user',
|
|
12
|
-
:internal_identifier => 'user_management',
|
|
13
|
-
:xtype => 'compass-erpapp-mobile-usermanagement-application'
|
|
14
|
-
)
|
|
15
|
-
else
|
|
16
|
-
user_management.description = 'User Mgmt'
|
|
17
|
-
user_management.xtype = 'compass-erpapp-mobile-usermanagement-application'
|
|
18
|
-
user_management.save
|
|
19
|
-
end
|
|
20
|
-
end
|
|
21
|
-
end
|
|
22
|
-
|
|
23
|
-
def down
|
|
24
|
-
if columns(:applications).collect { |c| c.name }.include?('xtype')
|
|
25
|
-
rename_column :applications, :xtype, :base_url
|
|
26
|
-
end
|
|
27
|
-
end
|
|
28
|
-
end
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
# This migration comes from knitkit (originally 20130405184234)
|
|
2
|
-
class AddUseMarkdownToSection < ActiveRecord::Migration
|
|
3
|
-
def self.up
|
|
4
|
-
unless columns(:website_sections).collect {|c| c.name}.include?('use_markdown')
|
|
5
|
-
add_column :website_sections, :use_markdown, :boolean
|
|
6
|
-
|
|
7
|
-
WebsiteSection.all.each do |section|
|
|
8
|
-
section.use_markdown = false
|
|
9
|
-
section.save
|
|
10
|
-
end
|
|
11
|
-
|
|
12
|
-
end
|
|
13
|
-
end
|
|
14
|
-
|
|
15
|
-
def self.down
|
|
16
|
-
if columns(:website_sections).collect {|c| c.name}.include?('use_markdown')
|
|
17
|
-
remove_column :website_sections, :use_markdown
|
|
18
|
-
end
|
|
19
|
-
end
|
|
20
|
-
end
|