Skip to content

Commit

Permalink
refs #130 create environment for mysql
Browse files Browse the repository at this point in the history
  • Loading branch information
8398a7 committed Jul 3, 2015
1 parent 9c2a3df commit b76e89e
Show file tree
Hide file tree
Showing 6 changed files with 76 additions and 145 deletions.
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ gem 'newrelic_rpm'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails'
# Use postgresql as the database for Active Record
gem 'pg'
gem 'mysql2'
# Use SCSS for stylesheets
gem 'sass-rails'
# Use Uglifier as compressor for JavaScript assets
Expand Down
4 changes: 2 additions & 2 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,7 @@ GEM
multi_json (1.11.1)
multi_xml (0.5.5)
multipart-post (2.0.0)
mysql2 (0.3.18)
naught (1.0.0)
nested_form (0.3.2)
net-http-digest_auth (1.4)
Expand All @@ -245,7 +246,6 @@ GEM
orm_adapter (0.5.0)
parser (2.2.2.5)
ast (>= 1.1, < 3.0)
pg (0.18.2)
polyamorous (1.2.0)
activerecord (>= 3.0)
powerpack (0.1.1)
Expand Down Expand Up @@ -501,10 +501,10 @@ DEPENDENCIES
launchy
lazy_high_charts
mechanize
mysql2
newrelic_rpm
nokogiri
nprogress-rails
pg
pry-byebug
pry-rails
quiet_assets
Expand Down
82 changes: 8 additions & 74 deletions config/database.yml
Original file line number Diff line number Diff line change
@@ -1,85 +1,19 @@
# PostgreSQL. Versions 8.2 and up are supported.
#
# Install the pg driver:
# gem install pg
# On OS X with Homebrew:
# gem install pg -- --with-pg-config=/usr/local/bin/pg_config
# On OS X with MacPorts:
# gem install pg -- --with-pg-config=/opt/local/lib/postgresql84/bin/pg_config
# On Windows:
# gem install pg
# Choose the win32 build.
# Install PostgreSQL and put its /bin directory on your path.
#
# Configure Using Gemfile
# gem 'pg'
#
default: &default
adapter: postgresql
encoding: unicode
# For details on connection pooling, see rails configuration guide
# http://guides.rubyonrails.org/configuring.html#database-pooling
adapter: mysql2
encoding: utf8
pool: 5
username: abilitysheet

development:
<<: *default
database: abilitysheet-iidx_development
database: abilitysheet_development

# The specified database role being used to connect to postgres.
# To create additional roles in postgres see `$ createuser --help`.
# When left blank, postgres will use the default role. This is
# the same name as the operating system user that initialized the database.
#username: abilitysheet-iidx

# The password associated with the postgres role (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

# The TCP port the server listens on. Defaults to 5432.
# If your server runs on a different port number, change accordingly.
#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:
<<: *default
database: abilitysheet-iidx_test
database: abilitysheet_test

# As with config/secrets.yml, you never want to store sensitive information,
# like your database password, in your source code. If your source code is
# ever seen by anyone, they now have access to your database.
#
# Instead, provide the password as a unix environment variable when you boot
# the app. Read http://guides.rubyonrails.org/configuring.html#configuring-a-database
# for a full rundown on how to provide these environment variables in a
# production deployment.
#
# On Heroku and other platform providers, you may have a full connection URL
# available as an environment variable. For example:
#
# DATABASE_URL="postgres://myuser:mypass@localhost/somedatabase"
#
# You can use this database configuration with:
#
# production:
# url: <%= ENV['DATABASE_URL'] %>
#
production:
<<: *default
database: abilitysheet-iidx_production
username: abilitysheet-iidx
password: <%= ENV['ABILITYSHEET-IIDX_DATABASE_PASSWORD'] %>
database: abilitysheet_production
username: abilitysheet
password: <%= ENV['ABILITYSHEET_DATABASE_PASSWORD'] %>
4 changes: 2 additions & 2 deletions db/migrate/20141110224245_devise_create_users.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ def change
t.integer :sign_in_count, default: 0, null: false
t.datetime :current_sign_in_at
t.datetime :last_sign_in_at
t.inet :current_sign_in_ip
t.inet :last_sign_in_ip
t.string :current_sign_in_ip
t.string :last_sign_in_ip

# Original
t.string :iidxid, null: false
Expand Down
2 changes: 1 addition & 1 deletion db/migrate/20141116172112_create_messages.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ def change
create_table :messages do |t|
t.string :body
t.string :email
t.inet :ip, null: false
t.string :ip, null: false
t.integer :user_id
t.boolean :state, default: false

Expand Down
127 changes: 62 additions & 65 deletions db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,107 +13,104 @@

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

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

create_table "abilities", force: :cascade do |t|
t.integer "sheet_id"
t.float "fc"
t.float "exh"
t.float "h"
t.float "c"
t.float "e"
t.float "aaa"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.integer "sheet_id", limit: 4
t.float "fc", limit: 24
t.float "exh", limit: 24
t.float "h", limit: 24
t.float "c", limit: 24
t.float "e", limit: 24
t.float "aaa", limit: 24
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
end

add_index "abilities", ["sheet_id"], name: "index_abilities_on_sheet_id", using: :btree

create_table "logs", force: :cascade do |t|
t.integer "user_id"
t.integer "sheet_id"
t.integer "pre_state"
t.integer "new_state"
t.integer "pre_score"
t.integer "new_score"
t.integer "pre_bp"
t.integer "new_bp"
t.integer "version"
t.integer "user_id", limit: 4
t.integer "sheet_id", limit: 4
t.integer "pre_state", limit: 4
t.integer "new_state", limit: 4
t.integer "pre_score", limit: 4
t.integer "new_score", limit: 4
t.integer "pre_bp", limit: 4
t.integer "new_bp", limit: 4
t.integer "version", limit: 4
t.date "created_at"
end

add_index "logs", ["sheet_id"], name: "index_logs_on_sheet_id", using: :btree
add_index "logs", ["user_id"], name: "index_logs_on_user_id", using: :btree

create_table "messages", force: :cascade do |t|
t.string "body"
t.string "email"
t.inet "ip", null: false
t.integer "user_id"
t.boolean "state", default: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.string "body", limit: 255
t.string "email", limit: 255
t.string "ip", limit: 255, null: false
t.integer "user_id", limit: 4
t.boolean "state", default: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
end

add_index "messages", ["user_id"], name: "index_messages_on_user_id", using: :btree

create_table "notices", force: :cascade do |t|
t.string "body"
t.integer "state"
t.boolean "active", default: true
t.string "body", limit: 255
t.integer "state", limit: 4
t.boolean "active", default: true
t.date "created_at"
end

create_table "scores", force: :cascade do |t|
t.integer "state", default: 7, null: false
t.integer "score"
t.integer "bp"
t.integer "sheet_id", null: false
t.integer "user_id", null: false
t.integer "version", null: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.integer "state", limit: 4, default: 7, null: false
t.integer "score", limit: 4
t.integer "bp", limit: 4
t.integer "sheet_id", limit: 4, null: false
t.integer "user_id", limit: 4, null: false
t.integer "version", limit: 4, null: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
end

add_index "scores", ["sheet_id"], name: "index_scores_on_sheet_id", using: :btree
add_index "scores", ["updated_at"], name: "index_scores_on_updated_at", using: :btree
add_index "scores", ["user_id"], name: "index_scores_on_user_id", using: :btree

create_table "sheets", force: :cascade do |t|
t.string "title"
t.integer "n_ability"
t.integer "h_ability"
t.integer "version"
t.boolean "active", default: true, null: false
t.string "textage"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.string "title", limit: 255
t.integer "n_ability", limit: 4
t.integer "h_ability", limit: 4
t.integer "version", limit: 4
t.boolean "active", default: true, null: false
t.string "textage", limit: 255
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
end

create_table "users", force: :cascade do |t|
t.string "username", default: "", null: false
t.string "encrypted_password", default: "", null: false
t.string "reset_password_token"
t.string "username", limit: 255, default: "", null: false
t.string "encrypted_password", limit: 255, default: "", null: false
t.string "reset_password_token", limit: 255
t.datetime "reset_password_sent_at"
t.datetime "remember_created_at"
t.integer "sign_in_count", default: 0, null: false
t.integer "sign_in_count", limit: 4, default: 0, null: false
t.datetime "current_sign_in_at"
t.datetime "last_sign_in_at"
t.inet "current_sign_in_ip"
t.inet "last_sign_in_ip"
t.string "iidxid", null: false
t.integer "version", default: 22, null: false
t.string "djname", null: false
t.integer "grade"
t.integer "pref", null: false
t.text "rival"
t.text "reverse_rival"
t.boolean "admin", default: false, null: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.integer "failed_attempts", default: 0, null: false
t.string "unlock_token"
t.string "current_sign_in_ip", limit: 255
t.string "last_sign_in_ip", limit: 255
t.string "iidxid", limit: 255, null: false
t.integer "version", limit: 4, default: 22, null: false
t.string "djname", limit: 255, null: false
t.integer "grade", limit: 4
t.integer "pref", limit: 4, null: false
t.text "rival", limit: 65535
t.text "reverse_rival", limit: 65535
t.boolean "admin", default: false, null: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.integer "failed_attempts", limit: 4, default: 0, null: false
t.string "unlock_token", limit: 255
t.datetime "locked_at"
end

Expand Down

0 comments on commit b76e89e

Please sign in to comment.