Skip to content

Commit

Permalink
changing database config file to specify mysql
Browse files Browse the repository at this point in the history
  • Loading branch information
nnunn committed Nov 1, 2018
1 parent b6facdf commit 66fa50f
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 32 deletions.
4 changes: 1 addition & 3 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
source 'https://rubygems.org'
git_source(:github) { |repo| "https://github.com/#{repo}.git" }

ruby '2.3.4'

# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '~> 5.2.1'
# Use sqlite3 as the database for Active Record
gem 'sqlite3'
gem 'mysql2', '~> 0.4.10'
# Use Puma as the app server
gem 'puma', '~> 3.11'
# Use SCSS for stylesheets
Expand Down
5 changes: 2 additions & 3 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ GEM
minitest (5.11.3)
msgpack (1.2.4)
multi_json (1.13.1)
mysql2 (0.4.10)
nio4r (2.3.1)
nokogiri (1.8.5)
mini_portile2 (~> 2.3.0)
Expand Down Expand Up @@ -251,6 +252,7 @@ DEPENDENCIES
htmlentities
jbuilder (~> 2.5)
listen (>= 3.0.5, < 3.2)
mysql2 (~> 0.4.10)
puma (~> 3.11)
rails (~> 5.2.1)
sass-rails (~> 5.0)
Expand All @@ -263,8 +265,5 @@ DEPENDENCIES
uglifier (>= 1.3.0)
web-console (>= 3.3.0)

RUBY VERSION
ruby 2.3.4p301

BUNDLED WITH
1.16.6
34 changes: 24 additions & 10 deletions config/database.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,39 @@
# SQLite version 3.x
# gem install sqlite3
#
# Ensure the SQLite 3 gem is defined in your Gemfile
# gem 'sqlite3'
# *** WARNING *** Don't change this file !
#
# This file is a placeholder. In Dev/Test/Prod, this file will
# be replaced by ansible, whence we have 3 separate templates, one
# for each environment!
# See:
# [nmacgreg@its004nm2 ansible-dev-master]$ ls -al roles/blacklight-application/templates/database*
# -rwxrwxr-x. 1 nmacgreg nmacgreg 643 Apr 22 09:01 roles/blacklight-application/templates/database.yml
# -rw-rw-r--. 1 nmacgreg nmacgreg 470 May 11 09:45 roles/blacklight-application/templates/database.yml.prod.j2
# -rw-rw-r--. 1 nmacgreg nmacgreg 508 Mar 26 11:07 roles/blacklight-application/templates/database.yml.test.j2

default: &default
adapter: sqlite3
adapter: mysql2
encoding: utf8
pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
timeout: 5000
username: root
password: mysecretpassword
host: 127.0.0.1

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

staging:
# from template database.yml.test.j2
<<: *default
database: cms_staging

production:
# from template database.yml.prod.j2
<<: *default
database: db/production.sqlite3
database: cms_production
32 changes: 16 additions & 16 deletions db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,33 +12,33 @@

ActiveRecord::Schema.define(version: 2018_11_01_154832) do

create_table "comfy_cms_categories", force: :cascade do |t|
create_table "comfy_cms_categories", options: "ENGINE=InnoDB DEFAULT CHARSET=utf8", force: :cascade do |t|
t.integer "site_id", null: false
t.string "label", null: false
t.string "categorized_type", null: false
t.index ["site_id", "categorized_type", "label"], name: "index_cms_categories_on_site_id_and_cat_type_and_label", unique: true
end

create_table "comfy_cms_categorizations", force: :cascade do |t|
create_table "comfy_cms_categorizations", options: "ENGINE=InnoDB DEFAULT CHARSET=utf8", force: :cascade do |t|
t.integer "category_id", null: false
t.string "categorized_type", null: false
t.integer "categorized_id", null: false
t.index ["category_id", "categorized_type", "categorized_id"], name: "index_cms_categorizations_on_cat_id_and_catd_type_and_catd_id", unique: true
end

create_table "comfy_cms_files", force: :cascade do |t|
create_table "comfy_cms_files", options: "ENGINE=InnoDB DEFAULT CHARSET=utf8", force: :cascade do |t|
t.integer "site_id", null: false
t.string "label", default: "", null: false
t.text "description", limit: 2048
t.text "description"
t.integer "position", default: 0, null: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["site_id", "position"], name: "index_comfy_cms_files_on_site_id_and_position"
end

create_table "comfy_cms_fragments", force: :cascade do |t|
create_table "comfy_cms_fragments", options: "ENGINE=InnoDB DEFAULT CHARSET=utf8", force: :cascade do |t|
t.string "record_type"
t.integer "record_id"
t.bigint "record_id"
t.string "identifier", null: false
t.string "tag", default: "text", null: false
t.text "content", limit: 16777215
Expand All @@ -52,7 +52,7 @@
t.index ["record_type", "record_id"], name: "index_comfy_cms_fragments_on_record_type_and_record_id"
end

create_table "comfy_cms_layouts", force: :cascade do |t|
create_table "comfy_cms_layouts", options: "ENGINE=InnoDB DEFAULT CHARSET=utf8", force: :cascade do |t|
t.integer "site_id", null: false
t.integer "parent_id"
t.string "app_layout"
Expand All @@ -68,7 +68,7 @@
t.index ["site_id", "identifier"], name: "index_comfy_cms_layouts_on_site_id_and_identifier", unique: true
end

create_table "comfy_cms_pages", force: :cascade do |t|
create_table "comfy_cms_pages", options: "ENGINE=InnoDB DEFAULT CHARSET=utf8", force: :cascade do |t|
t.integer "site_id", null: false
t.integer "layout_id"
t.integer "parent_id"
Expand All @@ -87,15 +87,15 @@
t.index ["site_id", "full_path"], name: "index_comfy_cms_pages_on_site_id_and_full_path"
end

create_table "comfy_cms_revisions", force: :cascade do |t|
create_table "comfy_cms_revisions", options: "ENGINE=InnoDB DEFAULT CHARSET=utf8", force: :cascade do |t|
t.string "record_type", null: false
t.integer "record_id", null: false
t.text "data", limit: 16777215
t.datetime "created_at"
t.index ["record_type", "record_id", "created_at"], name: "index_cms_revisions_on_rtype_and_rid_and_created_at"
end

create_table "comfy_cms_sites", force: :cascade do |t|
create_table "comfy_cms_sites", options: "ENGINE=InnoDB DEFAULT CHARSET=utf8", force: :cascade do |t|
t.string "label", null: false
t.string "identifier", null: false
t.string "hostname", null: false
Expand All @@ -106,7 +106,7 @@
t.index ["hostname"], name: "index_comfy_cms_sites_on_hostname"
end

create_table "comfy_cms_snippets", force: :cascade do |t|
create_table "comfy_cms_snippets", options: "ENGINE=InnoDB DEFAULT CHARSET=utf8", force: :cascade do |t|
t.integer "site_id", null: false
t.string "label", null: false
t.string "identifier", null: false
Expand All @@ -118,7 +118,7 @@
t.index ["site_id", "position"], name: "index_comfy_cms_snippets_on_site_id_and_position"
end

create_table "comfy_cms_translations", force: :cascade do |t|
create_table "comfy_cms_translations", options: "ENGINE=InnoDB DEFAULT CHARSET=utf8", force: :cascade do |t|
t.string "locale", null: false
t.integer "page_id", null: false
t.integer "layout_id"
Expand All @@ -132,19 +132,19 @@
t.index ["page_id"], name: "index_comfy_cms_translations_on_page_id"
end

create_table "friendly_id_slugs", force: :cascade do |t|
create_table "friendly_id_slugs", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8", force: :cascade do |t|
t.string "slug", null: false
t.integer "sluggable_id", null: false
t.string "sluggable_type", limit: 50
t.string "scope"
t.datetime "created_at"
t.index ["slug", "sluggable_type", "scope"], name: "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope", unique: true
t.index ["slug", "sluggable_type"], name: "index_friendly_id_slugs_on_slug_and_sluggable_type"
t.index ["slug", "sluggable_type", "scope"], name: "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope", unique: true, length: { slug: 70, scope: 70 }
t.index ["slug", "sluggable_type"], name: "index_friendly_id_slugs_on_slug_and_sluggable_type", length: { slug: 140 }
t.index ["sluggable_id"], name: "index_friendly_id_slugs_on_sluggable_id"
t.index ["sluggable_type"], name: "index_friendly_id_slugs_on_sluggable_type"
end

create_table "profiles", force: :cascade do |t|
create_table "profiles", options: "ENGINE=InnoDB DEFAULT CHARSET=utf8", force: :cascade do |t|
t.string "first_name"
t.string "last_name"
t.string "job_title"
Expand Down

0 comments on commit 66fa50f

Please sign in to comment.