aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/railties
Commit message (Collapse)AuthorAgeFilesLines
...
* Automatically maintain test database schemaJon Leighton2014-01-021-17/+17
| | | | | | | | | | | | | | * Move check from generated helper to test_help.rb, so that all applications can benefit * Rather than just raising when the test schema has pending migrations, try to load in the schema and only raise if there are pending migrations afterwards * Opt out of the check by setting config.active_record.maintain_test_schema = false * Deprecate db:test:* tasks. The test helper is now fully responsible for maintaining the test schema, so we don't need rake tasks for this. This is also a speed improvement since we're no longer reloading the test database on every call to "rake test".
* Remove deprecation warning for FIXTURES_PATHPiotr Sarnacki2013-12-301-6/+0
| | | | | | | | FIXTURES_PATH has a bit different case than DatabaseTasks.fixtures_path, which was added along with deprecation. A use case for FIXTURES_PATH could be loading fixtures from a different directory just for a given test run. The implementation is fairly simple, so leaving it as it is won't hurt.
* Guarantee the connection resolver handles string valuesJosé Valim2013-12-231-10/+2
| | | | | | | | | This commit also cleans up the rake tasks that were checking for DATABASE_URL in different places. In fact, it would be nice to deprecate DATABASE_URL usage in the long term, considering the direction we are moving of allowing those in .yml files.
* db:test:clone and prepare must load environmentArthur Neves2013-12-141-3/+2
| | | | | | db:test:clone and db:test:prepare use ActiveRecord::Base. configurations, so we need to load the rails environment, otherwise the config wont be in place.
* Revert "Explicitly exit with status "1" for create and drop failures"Rafael Mendonça França2013-11-191-26/+10
| | | | | | | | | | This reverts commit 22f80ae57b26907f662b7fd50a7270a6381e527e. See https://github.com/rails/rails/commit/22f80ae57b26907f662b7fd50a7270a6381e527e#commitcomment-4640676 Conflicts: activerecord/CHANGELOG.md
* Merge pull request #12531 from iamvery/database-tasks-exit-statusRafael Mendonça França2013-11-151-10/+26
|\ | | | | | | | | | | | | Explicitly exit with status "1" for create and drop task failures Conflicts: activerecord/CHANGELOG.md
| * Explicitly exit with status "1" for create and drop failuresJay Hayes2013-11-111-10/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * A non-zero exit status allows subsequent shell commands to be chained together such as: `rake db:reset test:prepare && rspec && cap deploy` (if you're feeling brave :) * Any exceptions raised during the `create` and `drop` tasks are caught in order to print a "pretty" message to the user. Unfortunately doing so prevents rake from aborting with a non-zero exit status to the shell. * Therefore we re-raise the exceptions after the "pretty" message and re-catch them in the task. * From the task we explicitly exit with a non-zero status. This method was chosen (rather than just letting rake fail from the exception) so that the backtrace is suppressed and the output to stderr is unchanged. * Update activerecord CHANGELOG
* | Warnings removed for ruby trunkArun Agrawal2013-11-011-1/+1
|/ | | Same as 4d4ff531b8807ee88a3fc46875c7e76f613956fb
* newline at end of structure.sql fileChad Jolly2013-10-131-0/+1
|
* Revert "Merge pull request #12085 from valk/master"Santiago Pastorino2013-09-031-3/+1
| | | | | This reverts commit 15455d76c8d33b3767a61e0cdd2de0ff592098ef, reversing changes made to ffa56f73d5ae98fe0b8b6dd2ca6f0dffac9d9217.
* FIX reload! within rails console --sandbox causes undefined method rollback ↵Val Kotlarov Hoffman2013-08-301-1/+3
| | | | upon exiting [https://github.com/rails/rails/issues/11834]
* only reconnect if there was already an active connectionAaron Patterson2013-08-111-1/+4
| | | | | If you're using an in-memory database for the test database, reconnecting will lose all information that schema:load did for us.
* Improved grammar and replaced 'dbs' slang with 'databases'Prathamesh Sonpatki2013-06-271-3/+3
|
* Properly namespace DatabaseTasksPiotr Sarnacki2013-06-141-1/+1
|
* Use DatabaseTasks.env instead of Rails.env in databases.rakePiotr Sarnacki2013-06-141-1/+1
|
* the rake task `db:test:prepare` needs to load the configurationYves Senn2013-05-211-1/+1
| | | | Without loading the configuration the task will not perform any work.
* rake:db:test:prepare falls back to original environment after execution.markevich2013-05-021-3/+7
|
* Abort a rake task when missing db/structure.sql like `db:schema:load` task.kennyj2013-05-011-5/+3
|
* Use DatabaseTasks.fixtures_path instead of FIXTURES_PATH in db.rakePiotr Sarnacki2013-04-241-2/+19
| | | | | | This will allow to set fixtures path in global config easier, it should be not needed to use FIXTURES_PATH every time user wants to load fixtures.
* Don't require having Rails.application to run database tasksPiotr Sarnacki2013-04-241-15/+9
|
* Merge pull request #10258 from thenickcox/pending_migrations_pluralRafael Mendonça França2013-04-181-3/+3
|\ | | | | Fix subject-verb agreement in error msg (and other grammar stuff)
| * Fix subject-verb agreement in error msg (and other grammar stuff)thenickcox2013-04-171-3/+3
| |
* | Use db:test:load instead of db:test:load_schemaPiotr Sarnacki2013-04-161-1/+1
| | | | | | | | | | | | | | db:test:load task should be favored over db:test:load_schema, because it checks for chosen format (ActiveRecord::Base.schema_format). closes #10227
* | fix AP warning; remove unused variableVipul A M2013-04-091-1/+1
| |
* | just check pending migrations in the current environmentAaron Patterson2013-04-051-2/+2
| |
* | check pending migrations against the test dbAaron Patterson2013-04-031-11/+3
| |
* | ensure the schema checking is done in the dev connectionAaron Patterson2013-04-031-0/+8
|/
* Fix tiny problem: change method order for consistency and fix wrong method name.kennyj2013-04-031-1/+1
|
* Extract Oracle database tasks.kennyj2013-04-031-26/+3
|
* Extract Sqlserver database tasks.kennyj2013-04-031-10/+0
|
* Extract Firebird database tasks.kennyj2013-04-031-20/+0
|
* The console --sandbox transaction should not be joinableJon Leighton2013-03-081-1/+2
| | | | Thanks @neerajdotname for noticing this bug.
* Fix rails console --sandboxJon Leighton2013-03-081-2/+2
| | | | | | I've also added a proper acceptance test which reproduced the issue. Closes #9513, #9515.
* Remove hard coded references to Active Record in railtiesJosé Valim2013-03-021-1/+1
|
* fix db_runtime attribute value after raising ActionView::MissingTemplate ↵Igor2013-02-271-1/+2
| | | | exception
* Remove pre-emptive adapter name check from databases.rake so third party ↵Daniel Azuma2013-01-291-9/+3
| | | | adapters can register rake tasks
* Revert "Merge pull request #8930 from cordawyn/ordered_railties"Carlos Antonio da Silva2013-01-151-1/+1
| | | | | | | | | | 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
* rake railties:install:migrations respects the order of railtiesSlava Kravchenko2013-01-141-1/+1
|
* Fix missing ending newline in db structure dump:Thibault Jouan2012-12-301-1/+3
| | | | | | | | | | | 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.
* Shush deprecation warning due to initializing a Migrator with migration ↵Jeremy Kemper2012-12-121-1/+1
| | | | paths rather than migrations. Use Migrator.open(paths) instead. Thanks @rubys!
* Don't use test environment by default when running rake db:structure:load; #7951Martin Grandrath2012-10-181-1/+1
| | | | | `ENV['RAILS_ENV']` is not defined unless explicitly specified on the command line when running `rake db:structure:load`.
* Rename "Fixtures" class to "FixtureSet"Alexey Muranov2012-10-071-3/+3
| | | | 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.
* nodoc AR::Railtie [ci skip]Francesco Rodriguez2012-09-211-2/+2
|
* Load the environment after creating the databaseJeremy Kemper2012-09-191-2/+2
|
* Revert "Make sure :environment task is executed before db:schema:load or ↵Jeremy Kemper2012-09-191-2/+2
| | | | | | | | db:structure:load " Breaks db:setup because it tries to load the environment before creating the database. This reverts commit 5ca11fefce6d83f5db399aa4412f1f1a0d42b2e6.
* Store the transaction number in the transaction objectJon Leighton2012-09-151-2/+0
| | | | This avoids us having to manually increment and decrement it.
* fixed support for DATABASE_URL for rake db tasksGrace Liu2012-09-111-29/+31
| | | | | | | | | | | | - 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).
* Extract ActiveRecord::SessionStore from RailsPrem Sichanugrist2012-08-241-15/+0
| | | | | This functionality will be available from gem `active_record-session_store` instead.
* Merge pull request #7140 from seamusabshere/patch-1Rafael Mendonça França2012-08-051-2/+2
|\ | | | | | | | | Make sure :environment task is executed before db:schema:load or db:structure:load
| * Make sure :environment task is executed before db:schema:load or ↵Seamus Abshere2012-07-231-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.