0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

【Rails】database.ymlについて

Posted at

記事概要

Ruby on RailsのDB環境について、まとめる

前提

  • Ruby on Railsでアプリケーションを作成している

基本情報

ファイルパス

config/database.yml

記載方法

修正箇所のみ、更新する

運用環境

システムをどこで使用するか定められている環境のこと
※運用環境を使い分けることで効率的に作業を行うことが可能

運用環境 通称 概要
development 開発環境 主にアプリケーションを開発をする際に使用する環境
test テスト環境 アプリケーションの動作をテストする際に使用する環境
production 本番環境 アプリケーションを実際にリリースする際に使用する環境

まとめ

データの保存形式を変更

encoding: utf8mb4encoding: utf8に変更する

default: &default
  adapter: mysql2
  # encoding: utf8mb4
  encoding: utf8
  pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
  username: root
  password:
  socket: /tmp/mysql.sock

Ruby on Railsまとめ

DB

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?