Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Just a Rails Patch Update

hatsu
September 12, 2024

Just a Rails Patch Update

hatsu

September 12, 2024
Tweet

More Decks by hatsu

Other Decks in Programming

Transcript

  1. ࣗݾ঺հ • Rubyྺ 5೥ = ΤϯδχΞྺ • SHE Inc. •

    React.js / TypeScript / GitHub Actions • Ruby͕Ұ൪޷͖
  2. ٕज़ελοΫ • Backend: Ruby, Ruby on Rails, GraphQL, Sidekiq •

    Frontend: React.js, TypeScript, Next.js • CI: GitHub Actions • Infrastructure: Kubernetes
  3. ฐࣾͰͷϦϦʔεϑϩʔ(ͬ͘͟Γ) 1. Pull RequestΛग़͢ `gh pr create -t “bundle update

    rails —patch” ` 2. Approve΋Β͏ `gh pr review 9999 —approve` 3. MasterʹϚʔδ `gh pr merge 9999 -m -d` 4. εςʔδϯά ϦϦʔε `gh pr create -t “release 2024-09-05” -H master -B release` 5. εςʔδϯά֬ೝ 6. ຊ൪ϦϦʔε `gh pr merge 10000 -m -d`
  4. • ΄ͱΜͲͷςʔϒϧͰ·ͩNJHSBUJPOʹ͔͔࣌ؒΔͱ͔͸ͳ͍ • data_migrateͱ͍͏gemΛར༻͍ͯ͠Δ • data_migrateͷbundle exec rails db:migrate:with_dataίϚϯυΛར༻ •

    Rails7.1.4ʹόʔδϣϯΞοϓ࣌఺(2024.09.03)Ͱ͸࠷৽ͷ data_migrate 9.4.2Λར༻͍ͯͨ͠ • 2024.09.04ʹEBUB_migrate 11.0.0όʔδϣϯ͕ग़͍ͯͨ ฐࣾͷmigrationࣄ৘
  5. • ΄ͱΜͲͷςʔϒϧͰ·ͩNJHSBUJPOʹ͔͔࣌ؒΔͱ͔͸ͳ͍ • data_migrateͱ͍͏gemΛར༻͍ͯ͠Δ • data_migrateͷbundle exec rails db:migrate:with_dataίϚϯυΛར༻ •

    Rails7.1.4ʹόʔδϣϯΞοϓ࣌఺(2024.09.03)Ͱ͸࠷৽ͷ data_migrate 9.4.2Λར༻͍ͯͨ͠ • 2024.09.04ʹEBUB_migrate 11.0.0όʔδϣϯ͕ग़͍ͯͨ ฐࣾͷmigrationࣄ৘ 3BJMTºEBUB@NJHSBUF PS 3BJMTºEBUB@NJHSBUF ͰNJHSBUJPO͕ಈ͔ͳ͍ͱൃ֮😵 ᠘͗͢Δ…
  6. • ΄ͱΜͲͷςʔϒϧͰ·ͩNJHSBUJPOʹ͔͔࣌ؒΔͱ͔͸ͳ͍ • data_migrateͱ͍͏gemΛར༻͍ͯ͠Δ • data_migrateͷbundle exec rails db:migrate:with_dataίϚϯυΛར༻ •

    Rails7.1.4ʹόʔδϣϯΞοϓ࣌఺(2024.09.03)Ͱ͸࠷৽ͷ data_migrate 9.4.2Λར༻͍ͯͨ͠ • 2024.09.04ʹEBUB_migrate 11.0.0όʔδϣϯ͕ग़͍ͯͨ ฐࣾͷmigrationࣄ৘ 3BJMTºEBUB@NJHSBUF PS 3BJMTºEBUB@NJHSBUF ͰNJHSBUJPO͕ಈ͔ͳ͍ͱൃ֮😵 εςʔδϯάͰ͸ɺDBͷmigration͕׬ྃޙʹɺRails7.1.4ʹόʔδϣϯΞοϓ͞Εͨ →͏·͍λΠϛϯάͰɺ໰୊͸ൃ֮͠ͳ͔ͬͨ💡 ᠘͗͢Δ…
  7. ϩʔΧϧͰ࠶ݱͯ͠ΈΔ (Rails 7.1.4 × data_migrate 9.4.2) bundle exec rails db:migrate:with_data

    bundle exec rails db:migrate →migrate͕ಈ͍ͯͳ͍ →migrate͕ಈ͍͍ͯΔ
  8. Rails 7.1.4ͰͷมߋՕॴ ActiveRecord::Tasks::DatabaseTasks.db_con fi gs_with_versions Rails 7.1.3 Rails 7.1.4 →Ҿ਺͸dbͷcon

    fi g৘ใ →Ҿ਺͸dbͷ؀ڥ໊ 3BJMTºEBUB@NJHSBUFͰ΋%#ͷDPO fi H৘ใΛ౉͍ͯͨ͠ ˠ֘౰ͷ؀ڥͷNJHSBUJPO৘ใ͕ͳ͍ ˠNJHSBUF͞Ε͍ͯͳ͍όʔδϣϯͷ৘ใ͕ฦΒͳ͍ ˠNJHSBUF͞Εͳ͍