【Rails + MySQL】AWS→herokuの移行
· ☕ 4 分で読めます
環境 Ruby 2.6.6 Rails 5.2.4.4 Vue 2.6.11 MySQL 8.0→5.7 流れ herokuデプロイ用のブランチを作成する 切ったブランチからherokuにデプロイする DNSの設定をする

【SQL】トランザクションの切り方
· ☕ 2 分で読めます
RSpecをctrl + Cで中断したら、その後こんなエラーが。 1 2 3 4 5 6 7 Failures: 1) なんちゃらかんちゃら Failure/Error: create(:user) ActiveRecord::TransactionIsolationConflict: Transaction isolation conflict detected: Lock wait timeout exceeded; try restarting transaction どうやらRSp

【Rails】migrationのオプション
· ☕ 1 分で読めます
null: falseとかlimitとかdefaultとかの書き方。 1 2 3 4 5 create_table :titles do |t| t.string :name, null: false, limit: 2 t.integer :old, default: 10 t.string :address, null: false, default: 'Tokyo' end NOT NULLなどの制約の設定 - Ruby

【Shell】便利なコマンドなど
· ☕ 1 分で読めます
shell $_ 1 2 mkdir hoge cd $_ # cd hoge と同じ 前回の引数を取得して使える。 cd - 1 2 3 cd /tmp cd /home cd - # /tmpに行く 前のディレクトリに行く cd -でこの意味を持つらし