##// END OF EJS Templates
Updated migration 41 to support table name prefix/sufix....
Jean-Philippe Lang -
r479:a301d0eb4e3c
parent child
Show More
@@ -57,8 +57,6 Rails::Initializer.run do |config|
57 57 # ActionMailer::Base.deliveries array.
58 58 #config.action_mailer.delivery_method = :test
59 59 config.action_mailer.delivery_method = :smtp
60
61 config.active_record.table_name_prefix = "rdm_"
62 60 end
63 61
64 62 ActiveRecord::Errors.default_error_messages = {
@@ -1,10 +1,10
1 1 class RenameCommentToComments < ActiveRecord::Migration
2 2 def self.up
3 rename_column(:comments, :comment, :comments) if ActiveRecord::Base.connection.columns("comments").detect{|c| c.name == "comment"}
4 rename_column(:wiki_contents, :comment, :comments) if ActiveRecord::Base.connection.columns("wiki_contents").detect{|c| c.name == "comment"}
5 rename_column(:wiki_content_versions, :comment, :comments) if ActiveRecord::Base.connection.columns("wiki_content_versions").detect{|c| c.name == "comment"}
6 rename_column(:time_entries, :comment, :comments) if ActiveRecord::Base.connection.columns("time_entries").detect{|c| c.name == "comment"}
7 rename_column(:changesets, :comment, :comments) if ActiveRecord::Base.connection.columns("changesets").detect{|c| c.name == "comment"}
3 rename_column(:comments, :comment, :comments) if ActiveRecord::Base.connection.columns(Comment.table_name).detect{|c| c.name == "comment"}
4 rename_column(:wiki_contents, :comment, :comments) if ActiveRecord::Base.connection.columns(WikiContent.table_name).detect{|c| c.name == "comment"}
5 rename_column(:wiki_content_versions, :comment, :comments) if ActiveRecord::Base.connection.columns(WikiContent.versioned_table_name).detect{|c| c.name == "comment"}
6 rename_column(:time_entries, :comment, :comments) if ActiveRecord::Base.connection.columns(TimeEntry.table_name).detect{|c| c.name == "comment"}
7 rename_column(:changesets, :comment, :comments) if ActiveRecord::Base.connection.columns(Changeset.table_name).detect{|c| c.name == "comment"}
8 8 end
9 9
10 10 def self.down
General Comments 0
You need to be logged in to leave comments. Login now