Permalink
Browse files

Fix support for postgresql

- add postgresql driver to Gemfile
- copy migration from engine that fixes #19
- add sample database.yml configs for mysql and postgresql
  • Loading branch information...
talbright committed Jan 26, 2014
1 parent 44a9b1f commit 0205fa60afa1bfe7bf75f09b586f3add2e880142
View
@@ -24,8 +24,8 @@ gem 'turbolinks'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 1.2'
# gem 'rearview', :path => '~/workspaces/rearview-engine'
gem 'rearview', '1.1.2'
gem 'rearview', :path => '~/workspaces/rearview-engine'
# gem 'rearview', '1.1.2'
gem 'omniauth'
gem 'omniauth-google-oauth2'
gem 'rspec-rails'
@@ -35,6 +35,7 @@ gem 'puma'
platforms :jruby do
gem 'activerecord-jdbcmysql-adapter'
gem 'activerecord-jdbcpostgresql-adapter'
gem 'jruby-openssl', :require => false
end
View
@@ -1,3 +1,18 @@
PATH
remote: ~/workspaces/rearview-engine
specs:
rearview (1.1.2-java)
ancestry (~> 2.0.0)
broach (~> 0.3.0)
celluloid (~> 0.14.1)
devise (~> 3.2.2)
httparty (~> 0.12.0)
jbuilder (~> 1.5.2)
protected_attributes (~> 1.0.5)
rails (~> 4.0.2)
state_machine (~> 1.2.0)
statsd-ruby (~> 1.2.1)
GEM
remote: http://rubygems.org/
specs:
@@ -24,6 +39,9 @@ GEM
activerecord-jdbcmysql-adapter (1.3.4)
activerecord-jdbc-adapter (~> 1.3.4)
jdbc-mysql (>= 5.1.22)
activerecord-jdbcpostgresql-adapter (1.3.4)
activerecord-jdbc-adapter (~> 1.3.4)
jdbc-postgres (>= 9.1)
activesupport (4.0.2)
i18n (~> 0.6, >= 0.6.4)
minitest (~> 4.2)
@@ -78,6 +96,7 @@ GEM
activesupport (>= 3.0.0)
multi_json (>= 1.2.0)
jdbc-mysql (5.1.27)
jdbc-postgres (9.3.1100)
jquery-rails (3.0.4)
railties (>= 3.0, < 5.0)
thor (>= 0.14, < 2.0)
@@ -141,17 +160,6 @@ GEM
rake (10.1.1)
rdoc (3.12.2)
json (~> 1.4)
rearview (1.1.2-java)
ancestry (~> 2.0.0)
broach (~> 0.3.0)
celluloid (~> 0.14.1)
devise (~> 3.2.2)
httparty (~> 0.12.0)
jbuilder (~> 1.5.2)
protected_attributes (~> 1.0.5)
rails (~> 4.0.2)
state_machine (~> 1.2.0)
statsd-ruby (~> 1.2.1)
rspec-core (2.14.7)
rspec-expectations (2.14.4)
diff-lcs (>= 1.1.3, < 2.0)
@@ -211,6 +219,7 @@ PLATFORMS
DEPENDENCIES
activerecord-jdbcmysql-adapter
activerecord-jdbcpostgresql-adapter
coffee-rails (~> 4.0.0)
foreman
jbuilder (~> 1.2)
@@ -221,7 +230,7 @@ DEPENDENCIES
pry
puma
rails (= 4.0.2)
rearview (= 1.1.2)
rearview!
rspec-rails
sass-rails (~> 4.0.0)
sdoc
View
@@ -27,15 +27,16 @@ Getting Started
[Download](https://github.com/livingsocial/rearview/archive/v1.1.2.zip) the latest release.
### If not running mysql
### Database Support
Select a supported jdbc driver and add it to the Gemfile and bundle install. See [activerecord-jdbc-adapter](https://github.com/jruby/activerecord-jdbc-adapter) site for more details.
The installation defaults to the jdbc/mysql adapter, which is already included, so this step is not necessary if you are using mysql.
Rearview comes with drivers for both mysql and postgresql. If you wish to use a differenct database select a supported
jdbc driver and add it to the Gemfile and bundle install. See [activerecord-jdbc-adapter](https://github.com/jruby/activerecord-jdbc-adapter) site for more details.
### Edit config/database.yml
Configure per your selected database driver and database connection settings. See [Configuring Rails](http://guides.rubyonrails.org/configuring.html#configuring-active-record) for more details.
Configure per your selected database driver and database connection settings. See [Configuring Rails](http://guides.rubyonrails.org/configuring.html#configuring-active-record) for more details. The installation defaults to common settings for mysql.
Sample configurations for both mysql (config/database.jdbcmysql.yml) and postgresql (config/database.jdbcpostgresql.yml) are available.
### Run the setup script
@@ -0,0 +1,20 @@
development:
adapter: mysql
database: rearview_development
username: root
password:
host: localhost
test:
adapter: mysql
database: rearview_test
username: root
password:
host: localhost
production:
adapter: mysql
database: rearview_production
username: root
password:
host: localhost
@@ -0,0 +1,43 @@
# PostgreSQL. Versions 8.2 and up are supported.
#
# Configure Using Gemfile
# gem 'activerecord-jdbcpostgresql-adapter'
development:
adapter: postgresql
encoding: unicode
database: rearview_development
username:
password:
# Connect on a TCP socket. Omitted by default since the client uses a
# domain socket that doesn't need configuration. Windows does not have
# domain sockets, so uncomment these lines.
#host: localhost
#port: 5432
# Schema search path. The server defaults to $user,public
#schema_search_path: myapp,sharedapp,public
# Minimum log levels, in increasing order:
# debug5, debug4, debug3, debug2, debug1,
# log, notice, warning, error, fatal, and panic
# Defaults to warning.
#min_messages: notice
# 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: postgresql
encoding: unicode
database: rearview_test
username:
password:
production:
adapter: postgresql
encoding: unicode
database: rearview_production
username:
password:
@@ -18,13 +18,13 @@ def up
t.integer "job_id", :default => 0, :null => false
t.datetime "created_at"
t.datetime "updated_at"
t.text "data", :limit => 2147483647, :null => false
t.text "data", :limit => 1073741823, :null => false
end
create_table "job_errors", :force => true do |t|
t.integer "job_id"
t.datetime "created_at"
t.text "message", :limit => 2147483647
t.text "message", :limit => 1073741823
t.string "status"
t.datetime "last_alerted_at"
t.datetime "updated_at"
View
@@ -11,7 +11,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema.define(version: 20140107173034) do
ActiveRecord::Schema.define(version: 20140126035210) do
create_table "applications", force: true do |t|
t.integer "user_id"
@@ -27,18 +27,18 @@
add_index "applications", ["user_id"], name: "user_id", using: :btree
create_table "job_data", force: true do |t|
t.integer "job_id", default: 0, null: false
t.integer "job_id", default: 0, null: false
t.datetime "created_at"
t.datetime "updated_at"
t.text "data", limit: 2147483647, null: false
t.text "data", null: false
end
add_index "job_data", ["job_id"], name: "index_job_data_on_job_id", using: :btree
create_table "job_errors", force: true do |t|
t.integer "job_id"
t.datetime "created_at"
t.text "message", limit: 2147483647
t.text "message"
t.string "status"
t.datetime "last_alerted_at"
t.datetime "updated_at"
Binary file not shown.
View
Binary file not shown.

0 comments on commit 0205fa6

Please sign in to comment.