Skip to content

Commit

Permalink
* Switch to PostgreSQL.
Browse files Browse the repository at this point in the history
  • Loading branch information
donv committed Jan 8, 2015
1 parent fce07b9 commit e2fa1c8
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 44 deletions.
1 change: 1 addition & 0 deletions .gitignore
@@ -1,3 +1,4 @@
*~
/.bundle
/.idea
/db/*.sqlite3
Expand Down
3 changes: 1 addition & 2 deletions Gemfile
Expand Up @@ -5,8 +5,7 @@ ruby '1.9.3', engine: 'jruby', engine_version: '1.7.18'
gem 'rails', '4.1.8'

platform :jruby do
# gem 'activerecord-jdbcpostgresql-adapter'
gem 'activerecord-jdbcsqlite3-adapter'
gem 'activerecord-jdbcpostgresql-adapter'
gem 'therubyrhino'
end

Expand Down
8 changes: 4 additions & 4 deletions Gemfile.lock
Expand Up @@ -23,9 +23,9 @@ GEM
arel (~> 5.0.0)
activerecord-jdbc-adapter (1.3.13)
activerecord (>= 2.2)
activerecord-jdbcsqlite3-adapter (1.3.13)
activerecord-jdbcpostgresql-adapter (1.3.13)
activerecord-jdbc-adapter (~> 1.3.13)
jdbc-sqlite3 (>= 3.7.2, < 3.9)
jdbc-postgres (>= 9.1)
activesupport (4.1.8)
i18n (~> 0.6, >= 0.6.9)
json (~> 1.7, >= 1.7.7)
Expand All @@ -49,7 +49,7 @@ GEM
jbuilder (2.2.6)
activesupport (>= 3.0.0, < 5)
multi_json (~> 1.2)
jdbc-sqlite3 (3.8.7)
jdbc-postgres (9.3.1102)
jquery-rails (3.1.2)
railties (>= 3.0, < 5.0)
thor (>= 0.14, < 2.0)
Expand Down Expand Up @@ -122,7 +122,7 @@ PLATFORMS
ruby

DEPENDENCIES
activerecord-jdbcsqlite3-adapter
activerecord-jdbcpostgresql-adapter
coffee-rails (~> 4.0.0)
jbuilder (~> 2.0)
jquery-rails
Expand Down
10 changes: 4 additions & 6 deletions config/database.yml
@@ -1,19 +1,17 @@
default: &default
adapter: sqlite3
pool: 5
timeout: 5000
adapter: postgresql

development:
<<: *default
database: db/development.sqlite3
database: ruboto_benchmarks_server_development

# 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:
<<: *default
database: db/test.sqlite3
database: ruboto_benchmarks_server_test

production:
<<: *default
database: db/production.sqlite3
database: ruboto_benchmarks_server_production
6 changes: 1 addition & 5 deletions db/migrate/20110830154406_create_startups.rb
@@ -1,5 +1,5 @@
class CreateStartups < ActiveRecord::Migration
def self.up
def change
create_table :startups do |t|
t.integer :startup_time, :null => false
t.string :package, :null => false
Expand All @@ -13,8 +13,4 @@ def self.up
t.timestamps
end
end

def self.down
drop_table :startups
end
end
20 changes: 0 additions & 20 deletions db/migrate/20110830154406_create_startups.rb~

This file was deleted.

10 changes: 3 additions & 7 deletions db/migrate/20110831073158_add_with_image.rb
@@ -1,11 +1,7 @@
class AddWithImage < ActiveRecord::Migration
def self.up
def change
add_column :startups, :with_image, :boolean
execute 'UPDATE startups SET with_image = 1'
change_column :startups, :with_image, :boolean, :null => false
end

def self.down
remove_column :startups, :with_image
execute 'UPDATE startups SET with_image = TRUE'
change_column :startups, :with_image, :boolean, null: false
end
end
3 changes: 3 additions & 0 deletions db/schema.rb
Expand Up @@ -13,6 +13,9 @@

ActiveRecord::Schema.define(version: 20120820172904) do

# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"

create_table "measurements", force: true do |t|
t.integer "duration", null: false
t.string "package", null: false
Expand Down

0 comments on commit e2fa1c8

Please sign in to comment.