diff --git a/app/views/work_packages/_subwork_packages_paragraph.html.erb b/app/views/work_packages/_subwork_packages_paragraph.html.erb index 7959aa1235..6fdd664330 100644 --- a/app/views/work_packages/_subwork_packages_paragraph.html.erb +++ b/app/views/work_packages/_subwork_packages_paragraph.html.erb @@ -30,8 +30,7 @@ See doc/COPYRIGHT.rdoc for more details. <%= l(:label_work_package_hierarchy) %> <% if User.current.allowed_to?(:manage_subtasks, @project) %> (<%= link_to(l(:label_add_subtask), new_project_work_package_path(:project_id => @project, - :sti_type => WorkPackage.to_s, - :work_package => { :parent_id => work_package })) %>) + :work_package => { :parent_id => work_package })) %>) <% end %> <% if !work_package.leaf? || work_package.parent %> diff --git a/app/views/work_packages/new.html.erb b/app/views/work_packages/new.html.erb index bc382b0ef7..4f449dcef0 100644 --- a/app/views/work_packages/new.html.erb +++ b/app/views/work_packages/new.html.erb @@ -38,8 +38,6 @@ See doc/COPYRIGHT.rdoc for more details. <%= error_messages_for :object => work_package %> - <%= f.hidden_field :sti_type %> -
<%= render :partial => 'form', :locals => { :f => f, :work_package => work_package, diff --git a/db/migrate/20131009083648_work_package_indices.rb b/db/migrate/20131009083648_work_package_indices.rb new file mode 100644 index 0000000000..181584b7e7 --- /dev/null +++ b/db/migrate/20131009083648_work_package_indices.rb @@ -0,0 +1,39 @@ +class WorkPackageIndices < ActiveRecord::Migration + def up + # drop obsolete fields + remove_column :work_packages, :planning_element_status_comment + remove_column :work_packages, :planning_element_status_id + remove_column :work_packages, :sti_type + + + add_index :work_packages, :type_id + add_index :work_packages, :status_id + add_index :work_packages, :category_id + + add_index :work_packages, :author_id + add_index :work_packages, :assigned_to_id + + add_index :work_packages, :created_at + add_index :work_packages, :fixed_version_id + + end + + def down + add_column :work_packages, :planning_element_status_comment, :string + add_column :work_packages, :planning_element_status_id, :integer + add_column :work_packages, :sti_type, :string + + remove_index :work_packages, :type_id + remove_index :work_packages, :status_id + remove_index :work_packages, :category_id + + remove_index :work_packages, :author_id + remove_index :work_packages, :assigned_to_id + + remove_index :work_packages, :created_at + remove_index :work_packages, :fixed_version_id + + + end + +end diff --git a/test/fixtures/work_packages.yml b/test/fixtures/work_packages.yml index 09c8586fd7..bfd3fa0a58 100644 --- a/test/fixtures/work_packages.yml +++ b/test/fixtures/work_packages.yml @@ -28,7 +28,6 @@ --- issues_001: - sti_type: "Issue" created_at: <%= 3.days.ago.to_date.to_s(:db) %> project_id: 1 updated_at: <%= 1.day.ago.to_date.to_s(:db) %> @@ -49,7 +48,6 @@ issues_001: rgt: 2 lock_version: 3 issues_002: - sti_type: "Issue" created_at: 2006-07-19 21:04:21 +02:00 project_id: 1 updated_at: 2006-07-19 21:09:50 +02:00 @@ -71,7 +69,6 @@ issues_002: lock_version: 3 done_ratio: 30 issues_003: - sti_type: "Issue" created_at: 2006-07-19 21:07:27 +02:00 project_id: 1 updated_at: 2006-07-19 21:07:27 +02:00 @@ -91,7 +88,6 @@ issues_003: lft: 1 rgt: 2 issues_004: - sti_type: "Issue" created_at: <%= 5.days.ago.to_date.to_s(:db) %> project_id: 2 updated_at: <%= 2.days.ago.to_date.to_s(:db) %> @@ -109,7 +105,6 @@ issues_004: lft: 1 rgt: 2 issues_005: - sti_type: "Issue" created_at: <%= 5.days.ago.to_date.to_s(:db) %> project_id: 3 updated_at: <%= 2.days.ago.to_date.to_s(:db) %> @@ -127,7 +122,6 @@ issues_005: lft: 1 rgt: 2 issues_006: - sti_type: "Issue" created_at: <%= 1.minute.ago.to_date.to_s(:db) %> project_id: 5 updated_at: <%= 1.minute.ago.to_date.to_s(:db) %> @@ -147,7 +141,6 @@ issues_006: lft: 1 rgt: 2 issues_007: - sti_type: "Issue" created_at: <%= 10.days.ago.to_date.to_s(:db) %> project_id: 1 updated_at: <%= 10.days.ago.to_date.to_s(:db) %> @@ -167,7 +160,6 @@ issues_007: lft: 1 rgt: 2 issues_008: - sti_type: "Issue" created_at: <%= 10.days.ago.to_date.to_s(:db) %> project_id: 1 updated_at: <%= 10.days.ago.to_date.to_s(:db) %> @@ -187,7 +179,6 @@ issues_008: lft: 1 rgt: 2 issues_009: - sti_type: "Issue" created_at: <%= 1.minute.ago.to_date.to_s(:db) %> project_id: 5 updated_at: <%= 1.minute.ago.to_date.to_s(:db) %> @@ -207,7 +198,6 @@ issues_009: lft: 1 rgt: 2 issues_010: - sti_type: "Issue" created_at: <%= 1.minute.ago.to_date.to_s(:db) %> project_id: 5 updated_at: <%= 1.minute.ago.to_date.to_s(:db) %> @@ -227,7 +217,6 @@ issues_010: lft: 1 rgt: 2 issues_011: - sti_type: "Issue" created_at: <%= 3.days.ago.to_date.to_s(:db) %> project_id: 1 updated_at: <%= 1.day.ago.to_date.to_s(:db) %> @@ -247,7 +236,6 @@ issues_011: lft: 1 rgt: 2 issues_012: - sti_type: "Issue" created_at: <%= 3.days.ago.to_date.to_s(:db) %> project_id: 1 updated_at: <%= 1.day.ago.to_date.to_s(:db) %> @@ -267,7 +255,6 @@ issues_012: lft: 1 rgt: 2 issues_013: - sti_type: "Issue" created_at: <%= 5.days.ago.to_date.to_s(:db) %> project_id: 3 updated_at: <%= 2.days.ago.to_date.to_s(:db) %>