rails/railties
eileencodes ee9e308f68
Default db_config should be primary or first
The handling for single database applications has always set a schema.rb
or structure.sql files for loading the database schema. When we first
implemented multiple database support we intended to keep this for the
original, default database. Afterall Rails _has_ to connect to something
on boot. In development only one connection is connected on boot since
we don't eager load the app.

Originally we had thought that all applications should be required to
add a `primary` entry in the database configurations file. However,
this hasn't worked in practice and we have some code now that does not
assume there's a primary. The schema dumping/loading code however,
still assumed there was a "primary" in the configurations file.

We want the "default" database in any application to use the original
files even when converted to a multiple database application as this
reduces the need to make changes when implementing this functionality on
an existing application.

The changes here update Rails to ensure that we treat either "primary"
or the first database configuration for an environment as "default".
If there is a "primary" that will be used as the default configuration.
If there is no primary the configuration that is first for an
environment will be used as the default. For schema dump/load this means
that the default configuration (primary or first) will use `schema.rb`
as the filename and other configurations will use
`[CONFIGURATION_NAME]_schema.rb`.

This should also help us finish the pull request to infer migrations
paths since now we can say the first configuration is the default. This
is a natural assumption for application developers.

Followup to #39536
2020-09-03 15:55:46 -04:00
..
bin Adding frozen_string_literal pragma to Railties. 2017-08-14 19:08:09 +02:00
exe Adding frozen_string_literal pragma to Railties. 2017-08-14 19:08:09 +02:00
lib Move TruffleRuby check to select the autoloading mode to 6.1 defaults 2020-08-31 20:12:26 +02:00
test Default db_config should be primary or first 2020-09-03 15:55:46 -04:00
.gitignore Install JavaScript packages before run test 2019-02-11 09:58:08 +09:00
CHANGELOG.md Formats code blocks for better syntax highlighting 2020-08-21 15:47:32 +05:30
MIT-LICENSE Bump license years from 2019 to 2020 [ci skip] 2020-01-01 15:10:31 +05:30
railties.gemspec Update the Rails mailing list URLs to new discuss discourse URL [ci skip] 2020-04-02 22:00:28 +05:30
Rakefile Fallback to spawn instead of fork in jruby (#36111) 2019-04-26 17:22:28 -05:00
RDOC_MAIN.rdoc remove reference to global rails command and replace with bin/rails 2019-12-27 19:32:37 +00:00
README.rdoc Update the Rails mailing list URLs to new discuss discourse URL [ci skip] 2020-04-02 22:00:28 +05:30

= Railties -- Gluing the Engine to the Rails

Railties is responsible for gluing all frameworks together. Overall, it:

* handles the bootstrapping process for a Rails application;

* manages the +rails+ command line interface;

* and provides the Rails generators core.


== Download

The latest version of Railties can be installed with RubyGems:

* gem install railties

Source code can be downloaded as part of the Rails project on GitHub

* https://github.com/rails/rails/tree/master/railties

== License

Railties is released under the MIT license:

* https://opensource.org/licenses/MIT

== Support

API documentation is at

* https://api.rubyonrails.org

Bug reports can be filed for the Ruby on Rails project here:

* https://github.com/rails/rails/issues

Feature requests should be discussed on the rails-core mailing list here:

* https://discuss.rubyonrails.org/c/rubyonrails-core