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

`rails db:migrate`を使わない スキーマ変更を経験して学んだこと

596ee6e13572bbc630d8004e3b77230b?s=47 shinji.uyama
February 27, 2019

`rails db:migrate`を使わない スキーマ変更を経験して学んだこと

2019/02/27 Meguro.rb#24 at ドリコム

596ee6e13572bbc630d8004e3b77230b?s=128

shinji.uyama

February 27, 2019
Tweet

Transcript

  1. ASBJMTECNJHSBUFAΛ࢖Θͳ͍ εΩʔϚมߋΛܦݧֶͯ͠Μͩ͜ͱ .FHVSPSCBUυϦίϜ TIJOKJVZBNB

  2. Ӊࢁ৻ೋ6ZBNB4IJOKJ 'SPOUFOE4FSWFSTJEF&OHJOFFS TIJOKJVZBNB !V@TIJOKJ ΞσΟογϡגࣜձࣾ

  3. ࠓ೔࿩͢Δ͜ͱ w ͳͥASBJMTECNJHSBUFAΛ࢖Θͳ͍εΩʔϚมߋΛͨ͠ʁ w ͦͷࡍʹֶΜͩ͜ͱ

  4. ͳͥASBJMTECNJHSBUFAΛ࢖Θͳ͍ εΩʔϚมߋΛߦͬͨͷ͔ʁ

  5. ࣄͷൃ୺ ֎෦੍໿ΩʔͷมߋΛ͔ͨͬͨ͠

  6. ࣄͷൃ୺ ˢ࣮ߦ͞ΕΔ42-จ ֎෦੍໿ΩʔͷมߋΛ͔ͨͬͨ͠

  7. ͦͷ݁Ռʜ

  8. ςʔϒϧϩοΫ͕ൃੜ

  9. ֎෦੍໿Ωʔ௥Ճ͸௨ৗςʔϒϧϩοΫ͞ΕΔ IUUQTEFWNZTRMDPNEPDSFGNBOKBJOOPECDSFBUFJOEFYPWFSWJFXIUNM ࢀর .Z42-ϦϑΝϨϯεɿΦϯϥΠϯ%%-

  10. ςʔϒϧϩοΫͤ͞ͳ͍Α͏ʹ͢ΔͨΊʹ ASBJMTECNJHSBUFAΛ࢖Θͳ͍εΩʔϚมߋ͔ΒֶΜͩ͜ͱ

  11. ֶͼ w ATDIFNB@NJHSBUJPOTAςʔϒϧͷ໾ׂ w ASBJMTECNJHSBUFAͰ࡞ΒΕΔΠϯσοΫεͷ໊લ

  12. ςʔϒϧϩοΫ͞ΕΔ໰୊ͷରԠ͸ʁ

  13. ରԠࡦ ઐ༻ͷϚΠάϨʔγϣϯπʔϧΛ࢖͏͜ͱͰ ςʔϒϧϩοΫΛ͠ͳ͍ঢ়ଶͰεΩʔϚมߋ

  14. ରԠϑϩʔ #VJME %#.JHSBUJPO %FQMPZNFOU ಛผରԠ࣌ͷσϓϩΠϑϩʔ πʔϧΛ࢖ͬͨ %#.JHSBUJPO 3BJMTͷ%#.JHSBUJPOΛεΩοϓ ࣗಈσϓϩΠ खಈରԠ

  15. ಛఆͷ%#.JHSBUJPOΛͲ͏΍ͬͯεΩοϓ͢Δͷʁ

  16. ATDIFNB@NJHSBUJPOTAςʔϒϧ %#.JHSBUJPOͷ؅ཧΛߦ͏ςʔϒϧ

  17. ATDIFNB@NJHSBUJPOTAςʔϒϧ %#.JHSBUJPOͷ؅ཧΛߦ͏ςʔϒϧ ಛఆͷ%#ϚΠάϨʔγϣϯΛεΩοϓ͚ͨ͠Ε͹ɺ ࢦఆͷϑΝΠϧࣝผࢠΛࣄલʹςʔϒϧʹΠϯαʔτ͢Ε͹Α͍ʂ

  18. πʔϧʹΑΔ%#.JHSBUJPOͰɺଞʹ֬ೝ͢΂͖͜ͱ͋Δʁ

  19. πʔϧΛ࢖͏ࡍͷ֬ೝࣄ߲ πʔϧʹΑΔ%#.JHSBUJPO 3BJMTʹΑΔ%#.JHSBUJPO ̎ͭͷํ๏ͷ݁ՌͷؒͰ ςʔϒϧߏ଄ͷҧ͍͕ͳ͍Α͏ʹ͍ͨ͠

  20. Կ΋ߟ͑ͣʹ΍ͬͯΈΔ ֎෦੍໿ͷ௥Ճ

  21. ̎ͭͷํ๏ͷؒͰ͕ࠩੜ·Δ w 3BJMTͷ%#.JHSBUJPOͷ৔߹ɺݻ༗ͷΠϯσοΫε໊ͷࢦఆΛߦͳͬ ͍ͯΔ w 3BJMTͷ%#.JHSBUJPO࣌ͷ໋໊ͱҟͳΔ৔߹ɺTDIFNBSCʹΠϯ σοΫε໊͕දࣔ͞ΕΔ TDIFNBSCͷࠩ෼

  22. ΠϯσοΫε໊ͷࢦఆ͸ඞཁ

  23. ·ͱΊ w ಛఆͷ%#.JHSBUJPOͷεΩοϓ͍ͨ͠৔߹͸ɺ ATDIFNB@NJHSBUJPOTAςʔϒϧ͕໾ཱͭ w ASBJMTECNJHSBUFAҎ֎ͷํ๏ͰΠϯσοΫε࡞੒Λ͢Δ৔߹͸ɺ
 ద੾ͳΠϯσοΫε໊Λࢦఆ͢Δ͜ͱ w A"-5&35"#-&A͢Δࡍ͸ɺςʔϒϧϩοΫʹؾΛ͚ͭͯʜ

  24. ͝੩ௌ͋Γ͕ͱ͏͍͟͝·ͨ͠