Allow for media cover deletion
#387
병합
Plume_migration_agent
delete-cover
에서 master
로 2 commits 를 머지했습니다 5 년 전
리뷰어
Request review
No reviewers
레이블
레이블 초기화
Related to the REST API
Code running on the server
Stuff related to Federation
Related to the front-end
Translations, and related code
More about project management or code than the project itself
The building, or installation process of Plume
Something isn't working
We need to talk
New feature or request
This is a new feature
Compatibility with different browsers, readers and OS
Related to an external package that Plume uses
UI/UX related issues and PRs
Good for newcomers
Extra attention is needed
Issues affecting only mobile UX
How elements're rendered out for the end user
Something else needs to be fixed first
This issue or pull request already exists
This PR is not complete yet
Issues concern a limited number of instances
This doesn't seem right
Need to be discussed by the community (on Loomio)
This PR is ready to be reviewed
Proposed ideas worth considering
This is issue has been created after a vote on Loomio
This will not be worked on
Apply labels
A: API
Related to the REST API
A: Backend
Code running on the server
A: Federation
Stuff related to Federation
A: Front-End
Related to the front-end
A: I18N
Translations, and related code
A: Meta
More about project management or code than the project itself
A: Security
Build
The building, or installation process of Plume
C: Bug
Something isn't working
C: Discussion
We need to talk
C: Enhancement
New feature or request
C: Feature
This is a new feature
Compatibility
Compatibility with different browsers, readers and OS
Dependency
Related to an external package that Plume uses
Design
UI/UX related issues and PRs
Documentation
Good first issue
Good for newcomers
Help welcome
Extra attention is needed
Mobile
Issues affecting only mobile UX
Rendering
How elements're rendered out for the end user
S: Blocked
Something else needs to be fixed first
S: Duplicate
This issue or pull request already exists
S: Incomplete
This PR is not complete yet
S: Instance specific
Issues concern a limited number of instances
S: Invalid
This doesn't seem right
S: Needs Voting/Discussion
Need to be discussed by the community (on Loomio)
S: Ready for review
This PR is ready to be reviewed
Suggestion
Proposed ideas worth considering
S: Voted on Loomio
This is issue has been created after a vote on Loomio
S: Wontfix
This will not be worked on
레이블 없음
A: API
A: Backend
A: Federation
A: Front-End
A: I18N
A: Meta
A: Security
Build
C: Bug
C: Discussion
C: Enhancement
C: Feature
Compatibility
Dependency
Design
Documentation
Good first issue
Help welcome
Mobile
Rendering
S: Blocked
S: Duplicate
S: Incomplete
S: Instance specific
S: Invalid
S: Needs Voting/Discussion
S: Ready for review
Suggestion
S: Voted on Loomio
S: Wontfix
마일스톤
Set milestone
마일스톤 초기화
No items
마일스톤 없음
담당자
Assign users
담당자 초기화
담당자 없음
참여자 2명
알림
마감일
기한이 올바르지 않거나 범위를 벗어났습니다. 'yyyy-mm-dd'형식을 사용해주십시오.
마감일이 설정되지 않았습니다.
의존성
No dependencies set.
Reference: Plume/Plume#387
Reference in New Issue
아직 콘텐츠가 없습니다.
'delete-cover' 브랜치 삭제
Deleting a branch is permanent. It CANNOT be undone. Continue?
아니오
예
Fix #356
sssiiiighqlite 🙀
unfortunately, you cannot drop or add constraints on sqlite tables without doing the create temporary table dance
Travis made me notice it. I knew for columns, I through it worked at least for constraints (it's only drop, add work just fine if I remember well)
Maybe this change should be integrated in the migrations that introduced constraints, because when you run migrations on an instance with illustrated articles, you get this error:
(After seeing this error on baptiste.gelez.xyz I tried to manually fix it, but it just ended in an instance reset 😬)
(I don't think it is a good idea to change previous migrations, but we don't really have choice…)
@BaptisteGelez I don't understand, what error did you run into? Is it when an article from before
2018-12-08-175515_constraints
reference a no longer existing media?It seem to happen when a media is used both as avatar and post cover. This query deletes it: https://github.com/Plume-org/Plume/blob/master/migrations/postgres/2018-12-08-175515_constraints/up.sql#L51 but it fails because it is used on a post.
Edit: actually, the media doesn't need to be used as avatar. If it owned by a duplicate user, the query will fail.
Edit 2: the user doesn't even need to be duplicated. For instance, some user have an empty
followers_endpoint
property, because they were created at a time this property didn't exist.Codecov Report
Travis is happy, I think we can safely merge that. Thanks!
I'm facing the same issue described by @BaptisteGelez while applying this migration, and I cannot afford to reset my instance. Is there anything to do to manually fix the issue? I can run SQL by hand if needed :)
@EliotBerriot try to find user with empty
followers_endpoint
withSELECT id, username FROM users WHERE followers_endpoint = '';
and if anything is returned, edit the follower endpoint so that it has a value (it can be anything as long as it is not null, nor already used by another user). If I remember correctly, that's how I fixed it on fediverse.blog. Sorry for the bug… 😕If it still doesn't work, try to check
users.ap_url
,user.inbox_url
anduser.outbox_url
too.@BaptisteGelez
SELECT id, username FROM users WHERE followers_endpoint = ''; returned a bunch of users, and I updated it w ith
UPDATE users SET followers_endpoint='noop' WHERE followers_endpoint = '';`This is the current returns for all the attributes you mentions:
Unfortunately, applying the migrations return the same error again:
The issues seems to lie within the medias/posts relation, so I'm not sure what it has to do with users?
Anyway, don't be sorry for this: I know the software was still in development and I could face this kind of bug, that was part of the deal :)
Okay, so maybe try to reset the post covers (it will not impact your articles as you didn't used them for Funkwhale's blog), with
UPDATE posts SET cover_id = null;
. I don't know if it will fix the issue, but it is worth a try.@BaptisteGelez at least with the
cover_id
thing I get another error:The issues is withing the
comments_in_response_to_id_fkey
constraint nowI made this script that should delete comments with invalid ActivityPub URLs, and their replies.
I didn't tested it, but it should only delete broken comments (and hopefully fix the migrations).
@BaptisteGelez unfortunately, this doesn't fix it (for me):
리뷰어
aa72334dc6
.Step 1:
From your project repository, check out a new branch and test the changes.Step 2:
Merge the changes and update on Forgejo.