mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
SQLite: db:create and drop
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6853 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
This commit is contained in:
parent
2be3a33f32
commit
26f88892a9
1 changed files with 5 additions and 1 deletions
|
@ -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']}"`
|
||||
|
|
Loading…
Reference in a new issue