<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">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 class="">only reflect my change</i> - if it doesn’t that is a signal to me that I need to rebuild my database:<div class=""><br class=""></div><div class=""><font face="Courier New" class="">rails db:drop db:create db:schema:load db:seed</font></div><div class=""><br class=""></div><div class="">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 class=""><br class=""></div><div class="">Good luck!<br class=""><div class="">
<br class="">
<hr style="display: block; height: 1px; border: 0; border-top: 1px dotted #ccc; margin: 5px 0; padding: 0;" class="">
<br class="">
<table border="0" cellpadding="0" width="100%" class="">
<tbody class="">
<tr class="">
<td valign="top" width="70" class="">
<img height="60" src="http://ej-public.s3.amazonaws.com/images/rubbish.png" style="margin: 8px 8px 0 0;" class="">
</td>
<td style="font-family:'Lucida Grande',sans-serif" class="">
<span style="font-weight:bold; color: #333333; font-size: 18px; line-height:30px;" class="">Ed James</span>
<br class="">
<span style="font-weight:normal; color: #999; font-size: 12px; line-height:16px;" class="">
<a href="mailto:ed.james.spam@gmail.com" style="color:#999; text-decoration:none" target="_blank" class="">I will respect your spam</a>
</span>
</td>
</tr>
</tbody>
</table>
</div>
<div><br class=""><blockquote type="cite" class=""><div class="">On 1 Mar 2021, at 08:09, Stuart Harrison <<a href="mailto:pezholio@gmail.com" class="">pezholio@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class=""><div class="">Morning LRUG</div><div class=""><br class=""></div><div class="">I wanted to share an annoyance I've had on multiple projects, and wondered if anyone had any fixes for it? <br class=""></div><div class=""><br class=""></div><div class="">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 class=""></div><div class=""><br class=""></div><div class="">I can get around this by only committing the relevant line(s) when I run a migration, but this does get annoying. <br class=""></div><div class=""><br class=""></div><div class="">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 class=""><br class=""></div><div class="">Cheers</div><div class=""><br class=""></div><div class="">Stu<br class=""></div></div>
_______________________________________________<br class="">Chat mailing list<br class=""><a href="mailto:Chat@lists.lrug.org" class="">Chat@lists.lrug.org</a><br class="">Archives: http://lists.lrug.org/pipermail/chat-lrug.org<br class="">Manage your subscription: http://lists.lrug.org/options.cgi/chat-lrug.org<br class="">List info: http://lists.lrug.org/listinfo.cgi/chat-lrug.org<br class=""></div></blockquote></div><br class=""></div></body></html>