<p>I've done just a little research and found that rails does have some support for this.  See activerecord-5.2.3/lib/active_record/connection_adapters/postgresql/schema_statements.rb, line 30.  Though I'm not sure how easy this is to use.</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/openstreetmap/openstreetmap-website/pull/2358?email_source=notifications&email_token=AAK2OLPN3ZAOM4YWJM6VXMDQGK2CJA5CNFSM4IPE2BQKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD5CXHKQ#issuecomment-524645290">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AAK2OLKOU4PZBPLCL5RS5ETQGK2CJANCNFSM4IPE2BQA">mute the thread</a>.<img src="https://github.com/notifications/beacon/AAK2OLMFERF5EQWGEAB6E5DQGK2CJA5CNFSM4IPE2BQKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD5CXHKQ.gif" height="1" width="1" alt="" /></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/openstreetmap/openstreetmap-website/pull/2358?email_source=notifications\u0026email_token=AAK2OLPN3ZAOM4YWJM6VXMDQGK2CJA5CNFSM4IPE2BQKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD5CXHKQ#issuecomment-524645290",
"url": "https://github.com/openstreetmap/openstreetmap-website/pull/2358?email_source=notifications\u0026email_token=AAK2OLPN3ZAOM4YWJM6VXMDQGK2CJA5CNFSM4IPE2BQKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD5CXHKQ#issuecomment-524645290",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>