1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
Commit graph

23 commits

Author SHA1 Message Date
Grace Liu
148c50b49a fixed support for DATABASE_URL for rake db tasks
- 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).
2012-09-11 20:40:13 -07:00
kennyj
df9e135281 Use configuration['encoding'], because database configuration use not charset but encoding. 2012-09-12 02:54:56 +09:00
kennyj
ccc6910cb0 Use native mysqldump command for 'rake db:structure:dump'. 2012-09-12 02:17:04 +09:00
Seamus Abshere
ece23b5fa0 Use the 'mysql' binary for 'rake db:structure:load'.
The previous implementation had the strange requirement that db/structure.sql contain only CREATE TABLE sql statements, one per table, separated by double newlines. SQLite3 and PostgreSQL database tasks, on the other hand, simply spawn 'sqlite3' and 'psql' binaries to load the file directly. The new implementation follows this and attempts to respect all current MySQL configuration settings.
2012-09-05 11:10:15 -05:00
Xavier Noria
447b6a4e67 removes usage of Object#in? from the code base (the method remains defined 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

    5ea6b0df9a

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.
2012-08-06 00:30:02 +02:00
Carlos Antonio da Silva
84b97813f6 Merge pull request #6838 from kennyj/added_registration_task
Allow to register database tasks from different adapters
2012-07-07 05:58:01 -07:00
Rafael Mendonça França
aafa00f4c1 Unify the collation API for the database adpters 2012-07-01 12:58:41 -03:00
kennyj
bece59e36d Extract collation tasks to database tasks. 2012-07-01 00:56:50 +09:00
kennyj
188d671f14 Added a feature to add a database task. e.g. OracleDatabaseTasks 2012-06-24 22:18:43 +09:00
kennyj
19911959d9 Refactor db:structure:load task. 2012-06-21 01:35:26 +09:00
kennyj
d8dfcacd44 Refactor db:structure:dump task. 2012-06-20 01:28:44 +09:00
Simon Jefford
363ab88216 Refactor db:charset task
In a similar vein to Pat's work on create, drop etc, the db:charset
task is now a one liner in databases.rake
2012-06-19 15:15:47 +01:00
Carlos Antonio da Silva
b5fc47caf9 Make DatabaseTasks a module with real private methods 2012-06-18 21:14:17 -03:00
Francesco Rodriguez
7fd7747497 fix invalid syntax and sqlite rake failing tests 2012-06-18 01:44:15 -05:00
Francesco Rodriguez
588e80fd13 add :nodoc: to AR::Tasks and update to follow the coding conventions 2012-06-18 01:16:44 -05:00
Francesco Rodriguez
b6d2997669 check if sqlite3 file exists before remove 2012-06-18 00:37:02 -05:00
Pat Allan
55f8dfd99e Rails is the default (but now override able) source for environment and path. 2012-06-17 22:16:45 +02:00
Pat Allan
8d5710c898 Cleaning up after some warnings, adding slightly higher-level tests. 2012-06-17 21:37:44 +02:00
Pat Allan
4422e03426 One line db:create/db:drop tasks.
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.
2012-06-17 18:09:20 +02:00
Pat Allan
bca52b05af db:drop and some of db:test:purge. 2012-06-17 17:39:12 +02:00
Pat Allan
e678d413bc db:create for PostgreSQL pulled out into a class. 2012-06-17 14:03:32 +02:00
Pat Allan
d29727235a db:create for MySQL now much cleaner. 2012-06-17 13:43:24 +02:00
Pat Allan
619453d594 A beginning of sorts.
Minimal implementation that supports db:create SQLite replacement
2012-06-17 01:51:33 +02:00