Merge pull request #489 from opf/fix/work_package_indices

pull/487/merge
Hagen Schink 11 years ago
commit c83a360bbd
  1. 3
      app/views/work_packages/_subwork_packages_paragraph.html.erb
  2. 2
      app/views/work_packages/new.html.erb
  3. 39
      db/migrate/20131009083648_work_package_indices.rb
  4. 13
      test/fixtures/work_packages.yml

@ -30,8 +30,7 @@ See doc/COPYRIGHT.rdoc for more details.
<strong><%= l(:label_work_package_hierarchy) %></strong>
<% 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 %>

@ -38,8 +38,6 @@ See doc/COPYRIGHT.rdoc for more details.
<%= error_messages_for :object => work_package %>
<%= f.hidden_field :sti_type %>
<div class="box">
<%= render :partial => 'form', :locals => { :f => f,
:work_package => work_package,

@ -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

@ -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) %>

Loading…
Cancel
Save