Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(backend): Set comment to NULL instead of Denormalized #13966

Closed
wants to merge 1 commit into from

Conversation

Mar0xy
Copy link
Contributor

@Mar0xy Mar0xy commented Jun 11, 2024

What

The DROP migration listed setting the comment on the channelId column to the same as the UP migration which is invalid.

It should be NULL instead to clear out the comment

Initial concern about this was raised here https://activitypub.software/TransFem-org/Sharkey/-/merge_requests/537#note_3712

Why

(Look at the text above)

Checklist

@github-actions github-actions bot added the packages/backend Server side specific issue/PR label Jun 11, 2024
@Mar0xy Mar0xy changed the title fix: Set comment to NULL instead of Denormalized fix(backend): Set comment to NULL instead of Denormalized Jun 11, 2024
Copy link
Contributor

このPRによるapi.jsonの差分

差分はこちら

Get diff files from Workflow Page

Copy link

codecov bot commented Jun 11, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 65.24%. Comparing base (9849aab) to head (b2da70a).
Report is 297 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff              @@
##           develop   #13966       +/-   ##
============================================
- Coverage    77.84%   65.24%   -12.61%     
============================================
  Files          185     1009      +824     
  Lines        25600   115425    +89825     
  Branches       487     5496     +5009     
============================================
+ Hits         19929    75306    +55377     
- Misses        5664    38677    +33013     
- Partials         7     1442     +1435     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@anatawa12 anatawa12 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://github.com/typeorm/typeorm/blob/e7649d2746f907ff36b1efb600402dedd5f5a499/src/driver/postgres/PostgresQueryRunner.ts#L1138-L1151

It looks this is behavior of typeorm and there are meny similar down migrations so I think we don't have to fix this (if down migration works)

これはtypeormの実装起因っぽいですしすでにいろいろ似てるのあるし、(down migrationが動くなら)直さなくていい気がします

async down(queryRunner) {
await queryRunner.query(`COMMENT ON COLUMN "user"."alsoKnownAs" IS 'URIs the user is known as too'`);
await queryRunner.query(`ALTER TABLE "user" DROP COLUMN "alsoKnownAs"`);
await queryRunner.query(`COMMENT ON COLUMN "user"."movedToUri" IS 'The URI of the new account of the User'`);
await queryRunner.query(`ALTER TABLE "user" DROP COLUMN "movedToUri"`);
}

async down(queryRunner) {
await queryRunner.query(`DROP INDEX "IDX_d5a1b83c7cab66f167e6888188"`);
await queryRunner.query(`COMMENT ON COLUMN "user"."isExplorable" IS 'Whether the User is explorable.'`);
await queryRunner.query(`ALTER TABLE "user" DROP COLUMN "isExplorable"`);
}

@Mar0xy
Copy link
Contributor Author

Mar0xy commented Aug 18, 2024

I would have done t his just to keep consistency but oh well

@Mar0xy Mar0xy closed this Aug 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
packages/backend Server side specific issue/PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants