as described here (edit: Hmm. Maybe I should have made this a post over there?) and am getting this error:
Remapping topic_links url
Error: ERROR: value too long for type character varying(500)
The remap has only been partially applied due to the error above. Please re-run the script again.
Looks like it’s a long http://site/new-topic?body=a%20bunch%20of%20stuff that’s to blame. Looks like it go truncated to 500 chars and so when we try to replace HOSTNAME with staging.HOSTNAME we’re out of luck.
P.S. If someone else wants to do that select, first do this:
We could move that column to character varying(2000) (or even text and keep the validation on Ruby) but I’m not sure if it’s worth the hassle of a migration.
Since the remap is smart enough to just skip this line, I guess all is ok in the end?
Remapping topic_links url
Error: ERROR: duplicate key value violates unique constraint "unique_post_links"
DETAIL: Key (topic_id, post_id, url)=(19484, 61049, https://staging.community.rstudio.com/t/birds-of-a-feather-bof-at-rstudio-conf-2019l/19328) already exists.
The remap has only been partially applied due to the error above. Please re-run the script again.
So short of a database migration to make the URL longer. . . maybe add another rescue on duplicate URLs and let them pass? So also add a
I’ll give that a shot. My solution was to add a next if parsed.length > 500 to self.extract_from(post) intopic_link.rb`. It seems like that would fix it for everyone. I think that it worked on the site where I am doing the remapping, but then I’m getting
Error: ERROR: duplicate key value violates unique constraint "unique_post_links"
DETAIL: Key (topic_id, post_id, url)=(19484, 61049, https://staging.community.rstudio.com/t/birds-of-a-feather-bof-at-rstudio-conf-2019l/19328) already exists.
The remap has only been partially applied due to the error above. Please re-run the script again.