summaryrefslogtreecommitdiffstats
path: root/db
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2016-07-16 10:30:45 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2016-07-16 10:30:45 +0000
commit57afa5345eea60c47b4fc44e86f32e73a202d860 (patch)
treee60a1fc76597f4648fff91c80c0abc9be8da18a6 /db
parentd3d62f4ded2a8c8738451e58d81df27a71a6842f (diff)
downloadredmine-57afa5345eea60c47b4fc44e86f32e73a202d860.tar.gz
redmine-57afa5345eea60c47b4fc44e86f32e73a202d860.zip
Don't pass conditions to #delete_all.
git-svn-id: http://svn.redmine.org/redmine/trunk@15675 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'db')
-rw-r--r--db/migrate/098_set_topic_authors_as_watchers.rb2
-rw-r--r--db/migrate/20100819172912_enable_calendar_and_gantt_modules_where_appropriate.rb2
-rw-r--r--db/migrate/20101104182107_add_unique_index_on_members.rb4
-rw-r--r--db/migrate/20111201201315_add_unique_index_to_issue_relations.rb2
4 files changed, 5 insertions, 5 deletions
diff --git a/db/migrate/098_set_topic_authors_as_watchers.rb b/db/migrate/098_set_topic_authors_as_watchers.rb
index 92a53f4a1..1a1529561 100644
--- a/db/migrate/098_set_topic_authors_as_watchers.rb
+++ b/db/migrate/098_set_topic_authors_as_watchers.rb
@@ -10,6 +10,6 @@ class SetTopicAuthorsAsWatchers < ActiveRecord::Migration
def self.down
# Removes all message watchers
- Watcher.delete_all("watchable_type = 'Message'")
+ Watcher.where("watchable_type = 'Message'").delete_all
end
end
diff --git a/db/migrate/20100819172912_enable_calendar_and_gantt_modules_where_appropriate.rb b/db/migrate/20100819172912_enable_calendar_and_gantt_modules_where_appropriate.rb
index 5bee50e3a..6071adf52 100644
--- a/db/migrate/20100819172912_enable_calendar_and_gantt_modules_where_appropriate.rb
+++ b/db/migrate/20100819172912_enable_calendar_and_gantt_modules_where_appropriate.rb
@@ -7,6 +7,6 @@ class EnableCalendarAndGanttModulesWhereAppropriate < ActiveRecord::Migration
end
def self.down
- EnabledModule.delete_all("name = 'calendar' OR name = 'gantt'")
+ EnabledModule.where("name = 'calendar' OR name = 'gantt'").delete_all
end
end
diff --git a/db/migrate/20101104182107_add_unique_index_on_members.rb b/db/migrate/20101104182107_add_unique_index_on_members.rb
index 14d1585f7..eabdad86b 100644
--- a/db/migrate/20101104182107_add_unique_index_on_members.rb
+++ b/db/migrate/20101104182107_add_unique_index_on_members.rb
@@ -1,7 +1,7 @@
class AddUniqueIndexOnMembers < ActiveRecord::Migration
def self.up
# Clean and reassign MemberRole rows if needed
- MemberRole.delete_all("member_id NOT IN (SELECT id FROM #{Member.table_name})")
+ MemberRole.where("member_id NOT IN (SELECT id FROM #{Member.table_name})").delete_all
MemberRole.update_all("member_id =" +
" (SELECT min(m2.id) FROM #{Member.table_name} m1, #{Member.table_name} m2" +
" WHERE m1.user_id = m2.user_id AND m1.project_id = m2.project_id" +
@@ -9,7 +9,7 @@ class AddUniqueIndexOnMembers < ActiveRecord::Migration
# Remove duplicates
Member.connection.select_values("SELECT m.id FROM #{Member.table_name} m" +
" WHERE m.id > (SELECT min(m1.id) FROM #{Member.table_name} m1 WHERE m1.user_id = m.user_id AND m1.project_id = m.project_id)").each do |i|
- Member.delete_all(["id = ?", i])
+ Member.where(["id = ?", i]).delete_all
end
# Then add a unique index
diff --git a/db/migrate/20111201201315_add_unique_index_to_issue_relations.rb b/db/migrate/20111201201315_add_unique_index_to_issue_relations.rb
index c27158c13..1bee49ab0 100644
--- a/db/migrate/20111201201315_add_unique_index_to_issue_relations.rb
+++ b/db/migrate/20111201201315_add_unique_index_to_issue_relations.rb
@@ -4,7 +4,7 @@ class AddUniqueIndexToIssueRelations < ActiveRecord::Migration
# Remove duplicates
IssueRelation.connection.select_values("SELECT r.id FROM #{IssueRelation.table_name} r" +
" WHERE r.id > (SELECT min(r1.id) FROM #{IssueRelation.table_name} r1 WHERE r1.issue_from_id = r.issue_from_id AND r1.issue_to_id = r.issue_to_id)").each do |i|
- IssueRelation.delete_all(["id = ?", i])
+ IssueRelation.where(["id = ?", i]).delete_all
end
add_index :issue_relations, [:issue_from_id, :issue_to_id], :unique => true