Skip to content

Commit 0af9308

Browse files
committed
Move schema_format :sql config setting from test.rb to application.rb
I've moved the schema_format :sql config setting to application.rb because you would never enable this only for the test environment. If you use database constraints or database specific data types you would want all of your environments to use them.
1 parent e2d3060 commit 0af9308

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed

railties/guides/code/getting_started/config/application.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,11 @@ class Application < Rails::Application
3939
# Configure sensitive parameters which will be filtered from the log file.
4040
config.filter_parameters += [:password]
4141

42+
# Use SQL instead of Active Record's schema dumper when creating the database.
43+
# This is necessary if your schema can't be completely dumped by the schema dumper,
44+
# like if you have constraints or database-specific column types
45+
# config.active_record.schema_format = :sql
46+
4247
# Enable the asset pipeline
4348
config.assets.enabled = true
4449

railties/guides/code/getting_started/config/environments/test.rb

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,6 @@
2929
# ActionMailer::Base.deliveries array.
3030
config.action_mailer.delivery_method = :test
3131

32-
# Use SQL instead of Active Record's schema dumper when creating the test database.
33-
# This is necessary if your schema can't be completely dumped by the schema dumper,
34-
# like if you have constraints or database-specific column types
35-
# config.active_record.schema_format = :sql
36-
3732
# Print deprecation notices to the stderr
3833
config.active_support.deprecation = :stderr
3934

railties/lib/rails/generators/rails/app/templates/config/application.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,11 @@ class Application < Rails::Application
4949
# Configure sensitive parameters which will be filtered from the log file.
5050
config.filter_parameters += [:password]
5151
52+
# Use SQL instead of Active Record's schema dumper when creating the database.
53+
# This is necessary if your schema can't be completely dumped by the schema dumper,
54+
# like if you have constraints or database-specific column types
55+
# config.active_record.schema_format = :sql
56+
5257
<% unless options.skip_sprockets? -%>
5358
# Enable the asset pipeline
5459
config.assets.enabled = true

railties/lib/rails/generators/rails/app/templates/config/environments/test.rb.tt

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,6 @@
2929
# ActionMailer::Base.deliveries array.
3030
config.action_mailer.delivery_method = :test
3131

32-
# Use SQL instead of Active Record's schema dumper when creating the test database.
33-
# This is necessary if your schema can't be completely dumped by the schema dumper,
34-
# like if you have constraints or database-specific column types
35-
# config.active_record.schema_format = :sql
36-
3732
<%- unless options.skip_active_record? -%>
3833
# Raise exception on mass assignment protection for ActiveRecord models
3934
config.active_record.mass_assignment_sanitizer = :strict

0 commit comments

Comments
 (0)