Duplicate key error during migration #331
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
When running migration scripts as of
9b76c805ec
:Hmm, I don't think it should happen that two notes have the same URL. Can you provide the result of the following query please:
what this query does
Select the creation date,
url
(link to human readable representation) anduri
(link to machine readable representation) from notes where theurl
occurs more than once.Hmm, I think this use of the
url
field is incorrect. I have raised an issue with Friendica which many of the cases seem to come from, see https://github.com/friendica/friendica/issues/12753. I'm not sure how to best resolve this.see also https://github.com/LemmyNet/lemmy/issues/2676
Can you try running this query manually and then rerun the migration:
This should remove a
url
(i.e. set it to null) from all but the earliest note where it occurs.If the migration works afterwards I'll add this to the migration itself.
That is a very slow query. Been running for almost 10 minutes now…
Yeah this isn’t gonna finish anytime soon. Figure out a better query.
In the meantime, I’ve run
which completed within 2 seconds. The migration that introduces the index was successful.
I don’t think there’s a problem with discarding these URLs altogether 🤷♀️