aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/tasks/database_tasks.rb
Commit message (Collapse)AuthorAgeFilesLines
...
* create/drop test and development databases only if RAILS_ENV is nilDamien Mathieu2014-01-081-1/+2
| | | | Closes #13625
* Automatically maintain test database schemaJon Leighton2014-01-021-3/+41
| | | | | | | | | | | | | | * 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".
* Cast env to symbol, fixes deprecation warningŁukasz Strzałkowski2013-12-251-1/+1
| | | | | | Warning: DEPRECATION WARNING: Passing a string to ActiveRecord::Base.establish_connection for a configuration lookup is deprecated, please pass a symbol (:development) instead.
* Guarantee the connection resolver handles string valuesJosé Valim2013-12-231-18/+1
| | | | | | | | | 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.
* Revert "Explicitly exit with status "1" for create and drop failures"Rafael Mendonça França2013-11-191-3/+0
| | | | | | | | | | 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-0/+3
|\ | | | | | | | | | | | | 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-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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
* let the sqlite task run without railsDamien Mathieu2013-08-071-1/+2
|
* Remove FirebirdDatabaseTasks was deprecated, because this was provided by ↵kennyj2013-06-051-2/+0
| | | | 3rd-party.
* Remove SqlseverDatabaseTasks was deprecated, because this was provided by ↵kennyj2013-06-051-1/+0
| | | | 3rd-party.
* Remove OracleDatabaseTasks was deprecated, because this was provided by ↵kennyj2013-06-051-1/+0
| | | | 3rd-party.
* Abort a rake task when missing db/structure.sql like `db:schema:load` task.kennyj2013-05-011-0/+8
|
* Review DatabaseTasks docs [ci skip]Carlos Antonio da Silva2013-04-241-17/+17
|
* Use env == 'development' instead of env.development?Piotr Sarnacki2013-04-241-1/+1
| | | | | | It's simpler to assume that passed env is just a string without any extensions, especially when DatabaseTasks are intended to be used also without rails.
* Don't require Rails.env in order to use AR::Tasks::DatabaseTasksPiotr Sarnacki2013-04-241-6/+7
|
* Add some documentation to ActiveRecord::Tasks::DatabaseTasksPiotr Sarnacki2013-04-241-1/+29
| | | | | | This is a public class, which could be used directly in order to allow easier database management. Now it also contains settings, which will be used by databases.rake.
* Use DatabaseTasks.fixtures_path instead of FIXTURES_PATH in db.rakePiotr Sarnacki2013-04-241-1/+2
| | | | | | 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-0/+11
|
* Extract Oracle database tasks.kennyj2013-04-031-5/+6
|
* Extract Sqlserver database tasks.kennyj2013-04-031-1/+3
|
* Extract Firebird database tasks.kennyj2013-04-031-0/+1
|
* Raise a specific exception with a useful message if a rake task is requested ↵Daniel Azuma2013-01-301-0/+4
| | | | for an unknown adapter
* Bring back "database already exists" messages when running rake tasksCarlos Antonio da Silva2013-01-121-0/+4
| | | | | | | | | | When running tasks such "rake db:setup", instead of showing messages like "db_development already exists", it was showing a big stack trace and a message "Couldn't create database for ..." with the configuration options, a very confusing message with a big trace. This brings back the functionality present in 3-2, showing the same message.
* fixed support for DATABASE_URL for rake db tasksGrace Liu2012-09-111-0/+28
| | | | | | | | | | | | - 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).
* removes usage of Object#in? from the code base (the method remains defined ↵Xavier Noria2012-08-061-1/+1
| | | | | | | | | | | | | | | | | | | 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.
* Merge pull request #6838 from kennyj/added_registration_taskCarlos Antonio da Silva2012-07-071-7/+11
|\ | | | | Allow to register database tasks from different adapters
| * Added a feature to add a database task. e.g. OracleDatabaseTaskskennyj2012-06-241-7/+11
| |
* | Extract collation tasks to database tasks.kennyj2012-07-011-0/+9
|/
* Refactor db:structure:load task.kennyj2012-06-211-0/+6
|
* Refactor db:structure:dump task.kennyj2012-06-201-0/+6
|
* Refactor db:charset taskSimon Jefford2012-06-191-0/+9
| | | | | In a similar vein to Pat's work on create, drop etc, the db:charset task is now a one liner in databases.rake
* Make DatabaseTasks a module with real private methodsCarlos Antonio da Silva2012-06-181-13/+14
|
* add :nodoc: to AR::Tasks and update to follow the coding conventionsFrancesco Rodriguez2012-06-181-66/+71
|
* Rails is the default (but now override able) source for environment and path.Pat Allan2012-06-171-12/+18
|
* Cleaning up after some warnings, adding slightly higher-level tests.Pat Allan2012-06-171-3/+3
|
* One line db:create/db:drop tasks.Pat Allan2012-06-171-0/+46
| | | | | | 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.
* db:drop and some of db:test:purge.Pat Allan2012-06-171-2/+13
|
* db:create for PostgreSQL pulled out into a class.Pat Allan2012-06-171-1/+1
|
* db:create for MySQL now much cleaner.Pat Allan2012-06-171-7/+12
|
* A beginning of sorts.Pat Allan2012-06-171-0/+14
Minimal implementation that supports db:create SQLite replacement