<div dir="ltr"><div dir="ltr">Hi Stuart<div><div><br></div><div>I use the gem "fix-db-schema-conflicts" -- ever since adding that to my Gemfile on each project it ensures that all schema changes are alphabetised (and otherwise normalised) and git diffs are much easier to read.</div></div><div><br></div><div>I agree with Ed that whatever the extra support (like the fix-db-schema-conflicts gem), the individual committer should be responsible for adjusting their commits.<br><div><div><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><br></div><div dir="ltr">all the best</div><div dir="ltr"><br></div><div dir="ltr">Tim<br></div><div dir="ltr"><br></div></div></div></div></div></div></div></div></div><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, 1 Mar 2021 at 08:15, Ed James <<a href="mailto:ed.james.spam@gmail.com">ed.james.spam@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div style="overflow-wrap: break-word;">The only reliable “solution” I’ve come across is to ensure your team treat the “schema.rb” file the same way they treat their own own when raising a pull request i.e. if I add a migration the schema file should <i>only reflect my change</i> - if it doesn’t that is a signal to me that I need to rebuild my database:<div><br></div><div><font face="Courier New">rails db:drop db:create db:schema:load db:seed</font></div><div><br></div><div>Once your colleagues get used to this (and it’s pretty easy really) you’ll find you have very little churn on your schema file.</div><div><br></div><div>Good luck!<br><div>
<br>
<hr style="display:block;height:1px;border-width:1px 0px 0px;border-right-style:initial;border-bottom-style:initial;border-left-style:initial;border-right-color:initial;border-bottom-color:initial;border-left-color:initial;border-top-style:dotted;border-top-color:rgb(204,204,204);margin:5px 0px;padding:0px">
<br>
<table border="0" cellpadding="0" width="100%">
  <tbody>
    <tr>
      <td valign="top" width="70">
        <img height="60" src="http://ej-public.s3.amazonaws.com/images/rubbish.png" style="margin: 8px 8px 0px 0px;">
      </td>
      <td style="font-family:"Lucida Grande",sans-serif">
          <span style="font-weight:bold;color:rgb(51,51,51);font-size:18px;line-height:30px">Ed James</span>
          <br>
          <span style="font-weight:normal;color:rgb(153,153,153);font-size:12px;line-height:16px">
              <a href="mailto:ed.james.spam@gmail.com" style="color:rgb(153,153,153);text-decoration:none" target="_blank">I will respect your spam</a>
          </span>
      </td>
    </tr>
  </tbody>
</table>

</div>
<div><br><blockquote type="cite"><div>On 1 Mar 2021, at 08:09, Stuart Harrison <<a href="mailto:pezholio@gmail.com" target="_blank">pezholio@gmail.com</a>> wrote:</div><br><div><div dir="ltr"><div>Morning LRUG</div><div><br></div><div>I wanted to share an annoyance I've had on multiple projects, and wondered if anyone had any fixes for it? <br></div><div><br></div><div>If there are multiple devs on a project committing a bunch of migrations and running `db:migrate`, it seems that, over time, the order of columns in the schema.rb file jumps around every time the command is run. <br></div><div><br></div><div>I can get around this by only committing the relevant line(s) when I run a migration, but this does get annoying. <br></div><div><br></div><div>I'm sure there is a solution, but it's disappeared out of my head, and seems to be an ungoogleable problem, so was wondering if anyone had come across a solution?</div><div><br></div><div>Cheers</div><div><br></div><div>Stu<br></div></div>
_______________________________________________<br>Chat mailing list<br><a href="mailto:Chat@lists.lrug.org" target="_blank">Chat@lists.lrug.org</a><br>Archives: <a href="http://lists.lrug.org/pipermail/chat-lrug.org" target="_blank">http://lists.lrug.org/pipermail/chat-lrug.org</a><br>Manage your subscription: <a href="http://lists.lrug.org/options.cgi/chat-lrug.org" target="_blank">http://lists.lrug.org/options.cgi/chat-lrug.org</a><br>List info: <a href="http://lists.lrug.org/listinfo.cgi/chat-lrug.org" target="_blank">http://lists.lrug.org/listinfo.cgi/chat-lrug.org</a><br></div></blockquote></div><br></div></div>_______________________________________________<br>
Chat mailing list<br>
<a href="mailto:Chat@lists.lrug.org" target="_blank">Chat@lists.lrug.org</a><br>
Archives: <a href="http://lists.lrug.org/pipermail/chat-lrug.org" rel="noreferrer" target="_blank">http://lists.lrug.org/pipermail/chat-lrug.org</a><br>
Manage your subscription: <a href="http://lists.lrug.org/options.cgi/chat-lrug.org" rel="noreferrer" target="_blank">http://lists.lrug.org/options.cgi/chat-lrug.org</a><br>
List info: <a href="http://lists.lrug.org/listinfo.cgi/chat-lrug.org" rel="noreferrer" target="_blank">http://lists.lrug.org/listinfo.cgi/chat-lrug.org</a><br>
</blockquote></div></div>