diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2005-01-03 23:15:22 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2005-01-03 23:15:22 +0000 |
commit | 02c21bc9868762e29edece16ad91d46c39a4dac1 (patch) | |
tree | ab680ade893f60e9b66daa914fdd6ff914d1f93a /railties | |
parent | d9e900cd9dfb408f0a3987bdf63b036f24be0b4d (diff) | |
download | rails-02c21bc9868762e29edece16ad91d46c39a4dac1.tar.gz rails-02c21bc9868762e29edece16ad91d46c39a4dac1.tar.bz2 rails-02c21bc9868762e29edece16ad91d46c39a4dac1.zip |
Added support for SQLite in the auto-dumping/importing of schemas for development -> test #416
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@325 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'railties')
-rw-r--r-- | railties/CHANGELOG | 2 | ||||
-rwxr-xr-x | railties/fresh_rakefile | 6 |
2 files changed, 8 insertions, 0 deletions
diff --git a/railties/CHANGELOG b/railties/CHANGELOG index f10ab87e09..6027d52a67 100644 --- a/railties/CHANGELOG +++ b/railties/CHANGELOG @@ -1,5 +1,7 @@ *SVN* +* Added support for SQLite in the auto-dumping/importing of schemas for development -> test #416 + * Fixed problems with dependency caching and controller hierarchies on Ruby 1.8.2 in development mode #351 * Added automated rewriting of the shebang lines on installs through the gem rails command #379 [Manfred Stienstra] diff --git a/railties/fresh_rakefile b/railties/fresh_rakefile index 437c999522..87263c4bff 100755 --- a/railties/fresh_rakefile +++ b/railties/fresh_rakefile @@ -81,6 +81,8 @@ task :clone_development_structure_to_test => [ :db_structure_dump, :purge_test_d end elsif ActiveRecord::Base.configurations["test"]["adapter"] == "postgresql" `psql -U #{ActiveRecord::Base.configurations["test"]["username"]} -f db/development_structure.sql #{ActiveRecord::Base.configurations["test"]["database"]}` + elsif ActiveRecord::Base.configurations["test"]["adapter"] == "sqlite" + `sqlite #{ActiveRecord::Base.configurations["test"]["dbfile"]} < db/development_structure.sql` end end @@ -91,6 +93,8 @@ task :db_structure_dump do File.open("db/development_structure.sql", "w+") { |f| f << ActiveRecord::Base.connection.structure_dump } elsif ActiveRecord::Base.configurations["development"]["adapter"] == "postgresql" `pg_dump -U #{ActiveRecord::Base.configurations["development"]["username"]} -s -f db/development_structure.sql #{ActiveRecord::Base.configurations["development"]["database"]}` + elsif ActiveRecord::Base.configurations["development"]["adapter"] == "sqlite" + `sqlite #{ActiveRecord::Base.configurations["development"]["dbfile"]} .schema > db/development_structure.sql` end end @@ -102,5 +106,7 @@ task :purge_test_database do elsif ActiveRecord::Base.configurations["test"]["adapter"] == "postgresql" `dropdb -U #{ActiveRecord::Base.configurations["test"]["username"]} #{ActiveRecord::Base.configurations["test"]["database"]}` `createdb -U #{ActiveRecord::Base.configurations["test"]["username"]} #{ActiveRecord::Base.configurations["test"]["database"]}` + elsif ActiveRecord::Base.configurations["test"]["adapter"] == "sqlite" + File.delete(ActiveRecord::Base.configurations["test"]["dbfile"]) if File.exist?(ActiveRecord::Base.configurations["test"]["dbfile"]) end end |