diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2007-05-26 00:39:18 +0000 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2007-05-26 00:39:18 +0000 |
commit | 26f88892a96cf6297572ca6a644d5fbcbb1f2f10 (patch) | |
tree | fdaa89c5baae04cc3736319c7163d1e7282280f7 | |
parent | 2be3a33f32b43287b692be2cc2550f159b00165e (diff) | |
download | rails-26f88892a96cf6297572ca6a644d5fbcbb1f2f10.tar.gz rails-26f88892a96cf6297572ca6a644d5fbcbb1f2f10.tar.bz2 rails-26f88892a96cf6297572ca6a644d5fbcbb1f2f10.zip |
SQLite: db:create and drop
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6853 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
-rw-r--r-- | railties/lib/tasks/databases.rake | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/railties/lib/tasks/databases.rake b/railties/lib/tasks/databases.rake index a265d3ef32..f382d97174 100644 --- a/railties/lib/tasks/databases.rake +++ b/railties/lib/tasks/databases.rake @@ -17,6 +17,10 @@ namespace :db do ActiveRecord::Base.establish_connection(config) when 'postgresql' `createdb "#{config['database']}" -E utf8` + when 'sqlite' + `sqlite "#{config['database']}"` + when 'sqlite3' + `sqlite3 "#{config['database']}"` end end end @@ -29,7 +33,7 @@ namespace :db do case config['adapter'] when 'mysql' ActiveRecord::Base.connection.drop_database config['database'] - when 'sqlite3' + when /^sqlite/ FileUtils.rm_f File.join(RAILS_ROOT, config['database']) when 'postgresql' `dropdb "#{config['database']}"` |