diff --git a/.gitignore b/.gitignore index 25a742d..62919ed 100644 --- a/.gitignore +++ b/.gitignore @@ -1,9 +1,3 @@ -# See http://help.github.com/ignore-files/ for more about ignoring files. -# -# If you find yourself ignoring temporary files generated by your text editor -# or operating system, you probably want to add a global ignore instead: -# git config --global core.excludesfile '~/.gitignore_global' - # Ignore bundler config. /.bundle @@ -14,3 +8,6 @@ # Ignore all logfiles and tempfiles. /log/*.log /tmp + +# Ignore database config file +config/database.yml diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..fe2676a --- /dev/null +++ b/.travis.yml @@ -0,0 +1,12 @@ +language: ruby +rvm: + - 1.9.3 + +env: + - DB=sqlite + +script: + - RAILS_ENV=test bundle exec rake --trace db:migrate test + +before_script: + - mysql -e 'create database test' diff --git a/config/database.travis.yml b/config/database.travis.yml new file mode 100644 index 0000000..a9e3cdc --- /dev/null +++ b/config/database.travis.yml @@ -0,0 +1,31 @@ +sqlite: &sqlite + adapter: sqlite3 + database: db/<%= Rails.env %>.sqlite3 + +mysql: &mysql + adapter: mysql2 + username: root + password: + database: allpro_<%= Rails.env %> + +postgresql: &postgresql + adapter: postgresql + username: postgres + password: + database: allpro_<%= Rails.env %> + min_messages: ERROR + +defaults: &defaults + pool: 5 + timeout: 5000 + host: localhost + <<: *<%= ENV['DB'] || "postgresql" %> + +development: + <<: *defaults + +test: + <<: *defaults + +production: + <<: *defaults diff --git a/config/database.yml b/config/database.yml deleted file mode 100644 index 51a4dd4..0000000 --- a/config/database.yml +++ /dev/null @@ -1,25 +0,0 @@ -# SQLite version 3.x -# gem install sqlite3 -# -# Ensure the SQLite 3 gem is defined in your Gemfile -# gem 'sqlite3' -development: - adapter: sqlite3 - database: db/development.sqlite3 - pool: 5 - timeout: 5000 - -# Warning: The database defined as "test" will be erased and -# re-generated from your development database when you run "rake". -# Do not set this db to the same as development or production. -test: - adapter: sqlite3 - database: db/test.sqlite3 - pool: 5 - timeout: 5000 - -production: - adapter: sqlite3 - database: db/production.sqlite3 - pool: 5 - timeout: 5000 diff --git a/config/database.yml.sample b/config/database.yml.sample new file mode 100644 index 0000000..5002692 --- /dev/null +++ b/config/database.yml.sample @@ -0,0 +1,17 @@ +development: + adapter: sqlite3 + database: db/development.sqlite3 + pool: 5 + timeout: 5000 + +test: + adapter: sqlite3 + database: db/test.sqlite3 + pool: 5 + timeout: 5000 + +production: + adapter: sqlite3 + database: db/production.sqlite3 + pool: 5 + timeout: 5000