<p><b>@gravitystorm</b> requested changes on this pull request.</p>
<hr>
<p>In <a href="https://github.com/openstreetmap/openstreetmap-website/pull/2034#discussion_r237613096">db/migrate/058_name_unnamed_redactions.rb</a>:</p>
<pre style='color:#555'>> @@ -0,0 +1,19 @@
+class NameUnnamedRedactions < ActiveRecord::Migration[5.0]
+ def self.up
+ # after titles are fixed we change the column so to not be null
+ change_column_null "redactions", "title", false
</pre>
<p>I think you might need to fill in the titles first, and then change the column constraint afterwards.</p>
<hr>
<p>In <a href="https://github.com/openstreetmap/openstreetmap-website/pull/2034#discussion_r237613410">db/migrate/058_name_unnamed_redactions.rb</a>:</p>
<pre style='color:#555'>> @@ -0,0 +1,19 @@
+class NameUnnamedRedactions < ActiveRecord::Migration[5.0]
</pre>
<p>The migration file should use a timestamp in the filename, see recent migrations that start with db/migrate/2018[...]</p>
<hr>
<p>In <a href="https://github.com/openstreetmap/openstreetmap-website/pull/2034#discussion_r237613622">db/migrate/058_name_unnamed_redactions.rb</a>:</p>
<pre style='color:#555'>> @@ -0,0 +1,19 @@
+class NameUnnamedRedactions < ActiveRecord::Migration[5.0]
+ def self.up
+ # after titles are fixed we change the column so to not be null
+ change_column_null "redactions", "title", false
+ # gets each redaction
+ # sets redaction title equal to a string of the id if there is no title
+ Redaction.find_each do |redaction|
+ if redaction.title.empty?
+ redaction.title = redaction.id.to_s
</pre>
<p>There's no need to use <code>.to_s</code> here, rails will take care of the conversion for you.</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/2034#pullrequestreview-179956058">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/ABWnLd-jMBzQATRVojDmYbIgrFJGjiXRks5u0CyQgaJpZM4X3FF3">mute the thread</a>.<img src="https://github.com/notifications/beacon/ABWnLRdi4VsnD-e6S8N4BwAgwFe_mac0ks5u0CyQgaJpZM4X3FF3.gif" height="1" width="1" alt="" /></p>
<script type="application/json" data-scope="inboxmarkup">{"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/openstreetmap/openstreetmap-website","title":"openstreetmap/openstreetmap-website","subtitle":"GitHub repository","main_image_url":"https://assets-cdn.github.com/images/email/message_cards/header.png","avatar_image_url":"https://assets-cdn.github.com/images/email/message_cards/avatar.png","action":{"name":"Open in GitHub","url":"https://github.com/openstreetmap/openstreetmap-website"}},"updates":{"snippets":[{"icon":"PERSON","message":"@gravitystorm requested changes on #2034"}],"action":{"name":"View Pull Request","url":"https://github.com/openstreetmap/openstreetmap-website/pull/2034#pullrequestreview-179956058"}}}</script>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/openstreetmap/openstreetmap-website/pull/2034#pullrequestreview-179956058",
"url": "https://github.com/openstreetmap/openstreetmap-website/pull/2034#pullrequestreview-179956058",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
},
{
"@type": "MessageCard",
"@context": "http://schema.org/extensions",
"hideOriginalBody": "false",
"originator": "AF6C5A86-E920-430C-9C59-A73278B5EFEB",
"title": "@gravitystorm requested changes on 2034",
"sections": [
{
"text": "",
"activityTitle": "**Andy Allan**",
"activityImage": "https://assets-cdn.github.com/images/email/message_cards/avatar.png",
"activitySubtitle": "@gravitystorm",
"facts": [
]
}
],
"potentialAction": [
{
"targets": [
{
"os": "default",
"uri": "https://github.com/openstreetmap/openstreetmap-website/pull/2034#pullrequestreview-179956058"
}
],
"@type": "OpenUri",
"name": "View on GitHub"
},
{
"name": "Unsubscribe",
"@type": "HttpPOST",
"target": "https://api.github.com",
"body": "{\n\"commandName\": \"MuteNotification\",\n\"threadId\": 400314743\n}"
}
],
"themeColor": "26292E"
}
]</script>