Draft
Conversation
Takeno-hito
reviewed
Jul 6, 2025
Member
Takeno-hito
left a comment
There was a problem hiding this comment.
遅くなりましたがレビュー返したので確認お願いします…!
| ) | ||
|
|
||
| // v40 スレッド通知を管理するテーブルを追加 | ||
| func v40() *gormigrate.Migration { |
Member
There was a problem hiding this comment.
めっちゃ申し訳ないんだけどここ threadV1 とかに名前変えたりってできます?
というのも、スレッド系はマージする際にまとめて1マイグレーションにしちゃいたいと思ってて、今は開発用で管理するために名前を分けたいです!
| IsForced bool `gorm:"type:boolean;not null;default:false;index:idx_channel_channels_id_is_public_is_forced,priority:3"` | ||
| IsPublic bool `gorm:"type:boolean;not null;default:false;index:idx_channel_channels_id_is_public_is_forced,priority:2"` | ||
| IsVisible bool `gorm:"type:boolean;not null;default:false"` | ||
| IsThread bool `gorm:"type:boolean;not null;default:false"` |
Member
There was a problem hiding this comment.
lint 落ちてるので直してほしいです!間がハードタブになってるかな
| ChannelSubscribeLevelMark | ||
| // ChannelSubscribeLevelMarkAndNotify レベル:未読管理+通知 | ||
| ChannelSubscribeLevelMarkAndNotify | ||
| // ChannelSubscribeLevelMarkAndNotify |
| type ChannelSubscriptionQuery struct { | ||
| UserID optional.Of[uuid.UUID] | ||
| ChannelID optional.Of[uuid.UUID] | ||
| ThreadParentID optional.Of[uuid.UUID] |
Contributor
Author
There was a problem hiding this comment.
現段階では使われていなくて、あるチャンネル以下で通知を有効にしているスレッドを取れるようする意図で書いていました
一旦削除しました
| } | ||
|
|
||
| // UserGroupRepository ユーザーグループリポジトリ | ||
| //test |
| } | ||
| if query.IsSubscriberAtMarkLevelOf.Valid { | ||
| tx = tx.Joins("INNER JOIN users_subscribe_channels ON users_subscribe_channels.user_id = users.id AND users_subscribe_channels.channel_id = ? AND users_subscribe_channels.mark = true", query.IsSubscriberAtMarkLevelOf.V) | ||
| tx = tx.Where("users.id IN (SELECT user_id FROM users_subscribe_threads WHERE channel_id = ? AND mark = true UNION SELECT user_id FROM users_subscribe_channels WHERE channel_id = ? AND mark = true)", query.IsSubscriberAtMarkLevelOf.V, query.IsSubscriberAtMarkLevelOf.V) |
Member
There was a problem hiding this comment.
ここの explain 結果が欲しいかも ( Adminer で explain [sql文] ででた結果を貼ってほしいです
| // GetThreadSubscriptions implements ChannelRepository interface. | ||
| func (repo *Repository) GetThreadSubscriptions(query repository.ChannelSubscriptionQuery) ([]*model.UserSubscribeThread, error) { | ||
|
|
||
| subQuery := repo.db.Table("channels"). |
Member
There was a problem hiding this comment.
ここも explain 結果が欲しいかも ( Adminer で explain [sql文] ででた結果を貼ってほしいです
Takeno-hito
approved these changes
Aug 11, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


close #2706
編集は未実装です。