| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
| |
This reverts commit 8348f9ea72c9b50fc4d4462fd9ebe3bba932c783, reversing
changes made to 9dfe2d6f9fabddf9a451a995678a9648c8aaf401.
Reason: this broke railties tests as explained in the issue, and the
author is going to review and report back.
https://github.com/rails/rails/pull/8930#issuecomment-12272671
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
When dumping database structure with `rake db:structure:dump` and
using migrations, the resulting file will not end with a newline char.
Although it's not mandatory, it breaks a lot of simple use cases with
programs like cat, more, grep, etc.
This changes use `puts' instead of `<<' to append migration versions
data to the dump and also split the line where this is happening as it
was a bit long.
|
|
|
|
| |
paths rather than migrations. Use Migrator.open(paths) instead. Thanks @rubys!
|
|
|
|
|
| |
`ENV['RAILS_ENV']` is not defined unless explicitly specified on the
command line when running `rake db:structure:load`.
|
|
|
|
| |
Rename `ActiveRecord::Fixtures` class to `ActiveRecord::FixtureSet`. Instances of this class normally hold a collection of fixtures (records) loaded either from a single YAML file, or from a file and a folder with the same name. This change make the class name singular and makes the class easier to distinguish from the modules like `ActiveRecord::TestFixtures`, which operates on multiple fixture sets, or `DelegatingFixtures`, `::Fixtures`, etc., and from the class `ActiveRecord::Fixture`, which corresponds to a single fixture.
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
db:structure:load
"
Breaks db:setup because it tries to load the environment before creating the database.
This reverts commit 5ca11fefce6d83f5db399aa4412f1f1a0d42b2e6.
|
|
|
|
| |
This avoids us having to manually increment and decrement it.
|
|
|
|
|
|
|
|
|
|
|
|
| |
- added tests to confirm establish_connection uses DATABASE_URL and
Rails.env correctly even when no arguments are passed in.
- updated rake db tasks to support DATABASE_URL, and added tests to
confirm correct behavior for these rake tasks. (Removed
establish_connection call from some tasks since in those cases
the :environment task already made sure the function would be called)
- updated Resolver so that when it resolves the database url, it
removes hash values with empty strings from the config spec (e.g.
to support connection to postgresql when no username is specified).
|
|
|
|
|
| |
This functionality will be available from gem
`active_record-session_store` instead.
|
|\
| |
| |
| |
| | |
Make sure :environment task is executed before db:schema:load or
db:structure:load
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
db:structure:load
Otherwise, if schema_format = :sql, you will see:
$ rake db:setup --trace
** Invoke db:setup (first_time)
** Invoke db:schema:load_if_ruby (first_time)
** Invoke db:create (first_time)
** Invoke db:load_config (first_time)
** Invoke rails_env (first_time)
** Execute rails_env
** Execute db:load_config
** Execute db:create
db_example_development already exists
db_example_test already exists
** Execute db:schema:load_if_ruby #<-------- :environment hasn't been executed yet
** Invoke db:schema:load (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute db:schema:load
~/db_example/db/schema.rb doesn't exist yet. Run `rake db:migrate` to create it then try again.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
by Active Support)
Selecting which key extensions to include in active_support/rails
made apparent the systematic usage of Object#in? in the code base.
After some discussion in
https://github.com/rails/rails/commit/5ea6b0df9a36d033f21b52049426257a4637028d
we decided to remove it and use plain Ruby, which seems enough
for this particular idiom.
In this commit the refactor has been made case by case. Sometimes
include? is the natural alternative, others a simple || is the
way you actually spell the condition in your head, others a case
statement seems more appropriate. I have chosen the one I liked
the most in each case.
|
| | |
|
|/
|
|
|
|
|
|
|
|
|
|
|
| |
`:rails_env` tasks is not needed in all the tasks that depends of
`load_config`, only in the tasks that uses `Rails.env`.
Since `:rails_env` task set the `Rails.env` to be "development" if it is
not set we don't need the `||` statements too
Fix #7175.
Conflicts:
activerecord/lib/active_record/railties/databases.rake
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
Since plugins were removed, we can clean up a few methods in engines.
We also use this opportunity to move `load_console`, `load_tasks` and
`load_runner` to Rails::Engine. This means that, if someone wants to
improve script/rails for engines to support console or runner commands,
part of the work is already done.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
consistency.
|
|
|
|
| |
consistency.
|
| |
|
| |
|
| |
|
|
|
|
|
| |
In a similar vein to Pat's work on create, drop etc, the db:charset
task is now a one liner in databases.rake
|
|\
| |
| | |
Get logic out of db rake tasks, and into classes and objects
|
| |
| |
| |
| |
| |
| | |
Now isn't that better?
And yes, I know that private has no impact on class methods - it's a visual distinction, not a technical one.
|
| | |
|
| | |
|
| | |
|
| |
| |
| |
| | |
Minimal implementation that supports db:create SQLite replacement
|
| |
| |
| |
| | |
Without this, some tasks won't load configurations
like custom engines.
|
|/ |
|
|\
| |
| | |
Reset postgreSQL search path in db:test:clone_structure.
|
| |
| |
| |
| |
| |
| |
| |
| | |
This patch resets the postgres search path in the structure.sql after
the structure is dumped in order to find schema_migrations table when
multiples schemas are used.
Fixes #945
|
| |
| |
| |
| | |
Quote arguments in db:structure:dump for PostgreSQL.
|
| | |
|
|\ \
| | |
| | | |
[Proposal] Schema cache dump
|
| | | |
|
|\ \ \
| | | |
| | | | |
warning fix : mismatched indentations at 'end' with 'case'
|
| | | | |
|
|/ / /
| | |
| | |
| | | |
Removed some useless docstrings and no-doc'ed some.
|
|\ \ \
| |/ /
|/| | |
Refactored code
|
| | | |
|
| | | |
|