Skip to content

Commit

Permalink
Add mysql
Browse files Browse the repository at this point in the history
  • Loading branch information
sakshi-keepworks committed Mar 27, 2017
1 parent 31dd373 commit 7b03648
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 34 deletions.
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ source 'https://rubygems.org'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.2.6'
# Use sqlite3 as the database for Active Record
gem 'sqlite3'
gem 'mysql2', '~> 0.4.0'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 5.0'
# 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 @@ -81,6 +81,7 @@ GEM
minitest (5.10.1)
multi_json (1.12.1)
multipart-post (2.0.0)
mysql2 (0.4.5)
nokogiri (1.7.0.1)
mini_portile2 (~> 2.1.0)
oauth2 (0.8.1)
Expand Down Expand Up @@ -147,7 +148,6 @@ GEM
actionpack (>= 4.0)
activesupport (>= 4.0)
sprockets (>= 3.0.0)
sqlite3 (1.3.13)
thor (0.19.4)
thread_safe (0.3.6)
tilt (2.0.6)
Expand All @@ -173,14 +173,14 @@ DEPENDENCIES
coffee-rails (~> 4.1.0)
jbuilder (~> 2.0)
jquery-rails
mysql2 (~> 0.4.0)
omniauth
omniauth-facebook (= 1.4.0)
rails (= 4.2.6)
rails_autolink
sass-rails (~> 5.0)
sdoc (~> 0.4.0)
spring
sqlite3
turbolinks
uglifier (>= 1.3.0)
web-console (~> 2.0)
Expand Down
11 changes: 7 additions & 4 deletions config/database.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,24 @@
# gem 'sqlite3'
#
default: &default
adapter: sqlite3
adapter: mysql2
encoding: utf8
pool: 5
timeout: 5000
username: root
password:

development:
<<: *default
database: db/development.sqlite3
database: db/vchat_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: db/vchat_test

production:
<<: *default
database: db/production.sqlite3
database: db/vchat_production
54 changes: 27 additions & 27 deletions db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,45 +14,45 @@
ActiveRecord::Schema.define(version: 20170326043021) do

create_table "posts", force: :cascade do |t|
t.integer "user_id"
t.text "blob"
t.integer "vote_id"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.integer "cached_votes_total", default: 0
t.integer "cached_votes_score", default: 0
t.integer "cached_votes_up", default: 0
t.integer "cached_votes_down", default: 0
t.integer "user_id", limit: 4
t.text "blob", limit: 65535
t.integer "vote_id", limit: 4
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.integer "cached_votes_total", limit: 4, default: 0
t.integer "cached_votes_score", limit: 4, default: 0
t.integer "cached_votes_up", limit: 4, default: 0
t.integer "cached_votes_down", limit: 4, default: 0
end

add_index "posts", ["cached_votes_down"], name: "index_posts_on_cached_votes_down"
add_index "posts", ["cached_votes_score"], name: "index_posts_on_cached_votes_score"
add_index "posts", ["cached_votes_total"], name: "index_posts_on_cached_votes_total"
add_index "posts", ["cached_votes_up"], name: "index_posts_on_cached_votes_up"
add_index "posts", ["cached_votes_down"], name: "index_posts_on_cached_votes_down", using: :btree
add_index "posts", ["cached_votes_score"], name: "index_posts_on_cached_votes_score", using: :btree
add_index "posts", ["cached_votes_total"], name: "index_posts_on_cached_votes_total", using: :btree
add_index "posts", ["cached_votes_up"], name: "index_posts_on_cached_votes_up", using: :btree

create_table "users", force: :cascade do |t|
t.string "provider"
t.string "uid"
t.string "name"
t.string "oauth_token"
t.string "provider", limit: 255
t.string "uid", limit: 255
t.string "name", limit: 255
t.string "oauth_token", limit: 255
t.datetime "oauth_expires_at"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
end

create_table "votes", force: :cascade do |t|
t.integer "votable_id"
t.string "votable_type"
t.integer "voter_id"
t.string "voter_type"
t.integer "votable_id", limit: 4
t.string "votable_type", limit: 255
t.integer "voter_id", limit: 4
t.string "voter_type", limit: 255
t.boolean "vote_flag"
t.string "vote_scope"
t.integer "vote_weight"
t.string "vote_scope", limit: 255
t.integer "vote_weight", limit: 4
t.datetime "created_at"
t.datetime "updated_at"
end

add_index "votes", ["votable_id", "votable_type", "vote_scope"], name: "index_votes_on_votable_id_and_votable_type_and_vote_scope"
add_index "votes", ["voter_id", "voter_type", "vote_scope"], name: "index_votes_on_voter_id_and_voter_type_and_vote_scope"
add_index "votes", ["votable_id", "votable_type", "vote_scope"], name: "index_votes_on_votable_id_and_votable_type_and_vote_scope", using: :btree
add_index "votes", ["voter_id", "voter_type", "vote_scope"], name: "index_votes_on_voter_id_and_voter_type_and_vote_scope", using: :btree

end

0 comments on commit 7b03648

Please sign in to comment.