##// END OF EJS Templates
Updated migration 41 to support table name prefix/sufix....
Jean-Philippe Lang -
r479:a301d0eb4e3c
parent child
Show More
@@ -1,88 +1,86
1 # Be sure to restart your web server when you modify this file.
1 # Be sure to restart your web server when you modify this file.
2
2
3 # Uncomment below to force Rails into production mode when
3 # Uncomment below to force Rails into production mode when
4 # you don't control web/app server and can't set it the proper way
4 # you don't control web/app server and can't set it the proper way
5 # ENV['RAILS_ENV'] ||= 'production'
5 # ENV['RAILS_ENV'] ||= 'production'
6
6
7 # Bootstrap the Rails environment, frameworks, and default configuration
7 # Bootstrap the Rails environment, frameworks, and default configuration
8 require File.join(File.dirname(__FILE__), 'boot')
8 require File.join(File.dirname(__FILE__), 'boot')
9
9
10 Rails::Initializer.run do |config|
10 Rails::Initializer.run do |config|
11 # Settings in config/environments/* take precedence those specified here
11 # Settings in config/environments/* take precedence those specified here
12
12
13 # Skip frameworks you're not going to use
13 # Skip frameworks you're not going to use
14 # config.frameworks -= [ :action_web_service, :action_mailer ]
14 # config.frameworks -= [ :action_web_service, :action_mailer ]
15
15
16 # Add additional load paths for your own custom dirs
16 # Add additional load paths for your own custom dirs
17 # config.load_paths += %W( #{RAILS_ROOT}/extras )
17 # config.load_paths += %W( #{RAILS_ROOT}/extras )
18
18
19 # Force all environments to use the same logger level
19 # Force all environments to use the same logger level
20 # (by default production uses :info, the others :debug)
20 # (by default production uses :info, the others :debug)
21 # config.log_level = :debug
21 # config.log_level = :debug
22
22
23 # Use the database for sessions instead of the file system
23 # Use the database for sessions instead of the file system
24 # (create the session table with 'rake create_sessions_table')
24 # (create the session table with 'rake create_sessions_table')
25 # config.action_controller.session_store = :active_record_store
25 # config.action_controller.session_store = :active_record_store
26
26
27 # Enable page/fragment caching by setting a file-based store
27 # Enable page/fragment caching by setting a file-based store
28 # (remember to create the caching directory and make it readable to the application)
28 # (remember to create the caching directory and make it readable to the application)
29 # config.action_controller.fragment_cache_store = :file_store, "#{RAILS_ROOT}/cache"
29 # config.action_controller.fragment_cache_store = :file_store, "#{RAILS_ROOT}/cache"
30
30
31 # Activate observers that should always be running
31 # Activate observers that should always be running
32 # config.active_record.observers = :cacher, :garbage_collector
32 # config.active_record.observers = :cacher, :garbage_collector
33
33
34 # Make Active Record use UTC-base instead of local time
34 # Make Active Record use UTC-base instead of local time
35 # config.active_record.default_timezone = :utc
35 # config.active_record.default_timezone = :utc
36
36
37 # Use Active Record's schema dumper instead of SQL when creating the test database
37 # Use Active Record's schema dumper instead of SQL when creating the test database
38 # (enables use of different database adapters for development and test environments)
38 # (enables use of different database adapters for development and test environments)
39 # config.active_record.schema_format = :ruby
39 # config.active_record.schema_format = :ruby
40
40
41 # See Rails::Configuration for more options
41 # See Rails::Configuration for more options
42
42
43 # SMTP server configuration
43 # SMTP server configuration
44 config.action_mailer.smtp_settings = {
44 config.action_mailer.smtp_settings = {
45 :address => "127.0.0.1",
45 :address => "127.0.0.1",
46 :port => 25,
46 :port => 25,
47 :domain => "somenet.foo",
47 :domain => "somenet.foo",
48 :authentication => :login,
48 :authentication => :login,
49 :user_name => "redmine",
49 :user_name => "redmine",
50 :password => "redmine",
50 :password => "redmine",
51 }
51 }
52
52
53 config.action_mailer.perform_deliveries = true
53 config.action_mailer.perform_deliveries = true
54
54
55 # Tell ActionMailer not to deliver emails to the real world.
55 # Tell ActionMailer not to deliver emails to the real world.
56 # The :test delivery method accumulates sent emails in the
56 # The :test delivery method accumulates sent emails in the
57 # ActionMailer::Base.deliveries array.
57 # ActionMailer::Base.deliveries array.
58 #config.action_mailer.delivery_method = :test
58 #config.action_mailer.delivery_method = :test
59 config.action_mailer.delivery_method = :smtp
59 config.action_mailer.delivery_method = :smtp
60
61 config.active_record.table_name_prefix = "rdm_"
62 end
60 end
63
61
64 ActiveRecord::Errors.default_error_messages = {
62 ActiveRecord::Errors.default_error_messages = {
65 :inclusion => "activerecord_error_inclusion",
63 :inclusion => "activerecord_error_inclusion",
66 :exclusion => "activerecord_error_exclusion",
64 :exclusion => "activerecord_error_exclusion",
67 :invalid => "activerecord_error_invalid",
65 :invalid => "activerecord_error_invalid",
68 :confirmation => "activerecord_error_confirmation",
66 :confirmation => "activerecord_error_confirmation",
69 :accepted => "activerecord_error_accepted",
67 :accepted => "activerecord_error_accepted",
70 :empty => "activerecord_error_empty",
68 :empty => "activerecord_error_empty",
71 :blank => "activerecord_error_blank",
69 :blank => "activerecord_error_blank",
72 :too_long => "activerecord_error_too_long",
70 :too_long => "activerecord_error_too_long",
73 :too_short => "activerecord_error_too_short",
71 :too_short => "activerecord_error_too_short",
74 :wrong_length => "activerecord_error_wrong_length",
72 :wrong_length => "activerecord_error_wrong_length",
75 :taken => "activerecord_error_taken",
73 :taken => "activerecord_error_taken",
76 :not_a_number => "activerecord_error_not_a_number"
74 :not_a_number => "activerecord_error_not_a_number"
77 }
75 }
78
76
79 ActionView::Base.field_error_proc = Proc.new{ |html_tag, instance| "#{html_tag}" }
77 ActionView::Base.field_error_proc = Proc.new{ |html_tag, instance| "#{html_tag}" }
80
78
81 GLoc.set_config :default_language => :en
79 GLoc.set_config :default_language => :en
82 GLoc.clear_strings
80 GLoc.clear_strings
83 GLoc.set_kcode
81 GLoc.set_kcode
84 GLoc.load_localized_strings
82 GLoc.load_localized_strings
85 GLoc.set_config(:raise_string_not_found_errors => false)
83 GLoc.set_config(:raise_string_not_found_errors => false)
86
84
87 require 'redmine'
85 require 'redmine'
88
86
@@ -1,13 +1,13
1 class RenameCommentToComments < ActiveRecord::Migration
1 class RenameCommentToComments < ActiveRecord::Migration
2 def self.up
2 def self.up
3 rename_column(:comments, :comment, :comments) if ActiveRecord::Base.connection.columns("comments").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("wiki_contents").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("wiki_content_versions").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("time_entries").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("changesets").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 end
8 end
9
9
10 def self.down
10 def self.down
11 raise IrreversibleMigration
11 raise IrreversibleMigration
12 end
12 end
13 end
13 end
General Comments 0
You need to be logged in to leave comments. Login now