<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by MIJIMO 米佶摩 on Medium]]></title>
        <description><![CDATA[Stories by MIJIMO 米佶摩 on Medium]]></description>
        <link>https://medium.com/@mijimoco?source=rss-2d095901e461------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*GPzSLLKGAVSXtuzzXHmO8w.png</url>
            <title>Stories by MIJIMO 米佶摩 on Medium</title>
            <link>https://medium.com/@mijimoco?source=rss-2d095901e461------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 24 Nov 2026 09:06:43 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@mijimoco/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[How to solve migration problems in Rails?]]></title>
            <link>https://medium.com/lecture-notes/how-to-solve-migration-problems-in-rails-5fdf49dabe9b?source=rss-2d095901e461------2</link>
            <guid isPermaLink="false">https://medium.com/p/5fdf49dabe9b</guid>
            <category><![CDATA[ruby-on-rails]]></category>
            <dc:creator><![CDATA[MIJIMO 米佶摩]]></dc:creator>
            <pubDate>Mon, 08 Jan 2018 23:09:16 GMT</pubDate>
            <atom:updated>2018-01-08T23:09:16.458Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OXFUo3wAMP-tD6h43w5mWA.png" /><figcaption>A migration file to alter user</figcaption></figure><p>A problem within a migration file causes the migration to get stuck in the middle.</p><p>What does that mean?</p><p>Let’s say, there’s mistake within your migration file. This could be a typo, or a logical mismatch (trying to rename a non-existing column within a table), or so on. When you run your migration, <strong>rails db:migrate,</strong> all the lines until the mistaken line will be executed successfully, but the migration will fail at that point. Your migration is not fully UP state. It’s somewhere in between.</p><p>You may try to reset migrations <strong>rails db:migrate VERSION=0</strong>, but most likely that will fail either, as the changes you’ve made previously cannot be taken to DOWN state either (because some of the changes you’ve made are UP state, but not all).</p><p>Your migration gets stuck in middle state, neither UP nor DOWN.</p><h3>Here’s how to solve such a migration problem:</h3><ol><li>First fix the mistaken line (obviously)</li><li>Temporarily comment out the lines that were executed successfully with a #</li><li>Run the migration again</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/839/1*gRAGvVpe6Gh8aoq96apMbw.png" /><figcaption>First 3 lines are commented out</figcaption></figure><p>You will be able to run the missing migration lines, and all of the migration will be UP state. Now you can reset back to VERSION=0 if you’d like.</p><h3>Suggestions</h3><p>There are some piece of advice to consider:</p><h4>Make migration files small and concise</h4><p>Do not put 6 different table modifications into 1 migration file. Instead, create separate migration files for each.</p><h4>Make sure migration files are correct</h4><p>Especially before moving to production stage, make sure you have your migration files are 100% flawless.</p><h4>Fix the database directly</h4><p>That’s a possible option either. If you’re confident with working on databases (a good grab of SQL), you can directly modify the errors on the database. Although you still need to fix the errors on your migration file, if you’re planning to use it later.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5fdf49dabe9b" width="1" height="1" alt=""><hr><p><a href="https://medium.com/lecture-notes/how-to-solve-migration-problems-in-rails-5fdf49dabe9b">How to solve migration problems in Rails?</a> was originally published in <a href="https://medium.com/lecture-notes">Lecture Notes</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Büyüdükçe düşlerimizi unuttuk.]]></title>
            <link>https://medium.com/@mijimoco/b%C3%BCy%C3%BCd%C3%BCk%C3%A7e-d%C3%BC%C5%9Flerimizi-unuttuk-20c20f47e3d?source=rss-2d095901e461------2</link>
            <guid isPermaLink="false">https://medium.com/p/20c20f47e3d</guid>
            <category><![CDATA[hayaller]]></category>
            <dc:creator><![CDATA[MIJIMO 米佶摩]]></dc:creator>
            <pubDate>Fri, 26 Aug 2016 04:17:26 GMT</pubDate>
            <atom:updated>2016-08-26T04:17:26.182Z</atom:updated>
            <content:encoded><![CDATA[<p>Büyüdükçe düşlerimizi unuttuk.<br>Düşlerimiz olmadan silik olmaya mahkûmuz.<br>Bizi biz yapan, bizi kendimize yakın tutan şey düşlerimizdir, çünkü.<br>Çocukluk fotoğraflarındaki gibi içten gülemiyorsan nedeni budur.</p><p>16 Kasım 2011, Taichung.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=20c20f47e3d" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>