-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
AutoSubscribe to Issue when create or comment to it #9535
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
Closed
6543
wants to merge
65
commits into
go-gitea:master
from
6543-forks:fix_8243-auto-subscribe-issue-on-interact
Closed
Changes from all commits
Commits
Show all changes
65 commits
Select commit
Hold shift + click to select a range
7cd9881
squash-rebase
6543 39bfe5b
Dont Drop - Alter table column
6543 9e17364
remove is_watching from models completly
6543 038bcef
nit
6543 94171ed
delete if IssueWatchMode = None
6543 5cd8c73
update comments
6543 c6b3ea1
fix test
6543 d6a764b
format code ...
6543 3aa7e09
fix & optimize Create/Update-IW
6543 89e2e6a
tests ...
6543 9c316f6
fix lint
6543 483a212
extend Test
6543 e4a48cd
fix mssql migration
6543 afa745a
NULL as default
6543 bd44ba4
rework api stuff
6543 840f011
extend SET/UNSET issue subscritpion via API
6543 f4f8aef
fix lint
6543 48d30f1
new trick
6543 26acd3d
remove debug msg
6543 757b29b
make migration great again
6543 a162f26
add TEST
6543 d8d2e83
optimize!
6543 c8070d8
update SWAGGER
6543 ad12dd9
dont use IssueWatchModeNone
6543 760a389
Apply suggestions from code review
6543 9b578b4
new migration func
6543 370467c
remove IF EXISTS
6543 0669704
start IssueWatchMode with 1 & remove DEFAULT=1
6543 38c297a
add testcase to fixtures
6543 9482024
no race
6543 51171c2
fix sqlite
6543 893ad5c
Alter table outside a session
6543 2b31fc6
fix SQLite migration
6543 0c7826a
fix CreateOrUpdateIssueWatchMode
6543 f3b0059
fix
6543 1f78c80
now it should work
6543 aedbad5
Update models/migrations/v999.go
6543 7a0c75b
test async
6543 4186279
test Sync2 on sqlite again
6543 9bc4d33
sqlite dont like the dot
6543 f354e61
test
6543 4195f43
wait until async task finished
6543 547b5f9
mssql dont understand IfExist for AlterTable
6543 220cdfe
postgress fix
6543 8ab3f79
update README of integrations
6543 f2e9a75
new atempt
6543 96abc11
easy solution
6543 c3efb3d
some tweeks
6543 04e582e
Merge branch 'master' into fix_8243-auto-subscribe-issue-on-interact
6543 413fa6d
do it within a session
6543 a069ab3
finalize
6543 c5d2cf9
no async
6543 060e28b
no async anymore
6543 d28af72
simple delete
6543 a908156
Revert "remove sleep 1 sec"
6543 6483396
fix deleteIssueWatch
6543 c0399e7
Merge branch 'master' into fix_8243-auto-subscribe-issue-on-interact
6543 9f7148c
seperate docs update
6543 f29de15
Merge branch 'master' into fix_8243-auto-subscribe-issue-on-interact
6543 8e44467
Merge branch 'master' into fix_8243-auto-subscribe-issue-on-interact
6543 f6c9883
do not extend api
6543 e3e1bbd
remove unused
6543 9718787
Merge branch 'master' into fix_8243-auto-subscribe-issue-on-interact
6543 bc0e963
Merge branch 'master' into fix_8243-auto-subscribe-issue-on-interact
6543 e12849d
Merge branch 'master' into fix_8243-auto-subscribe-issue-on-interact
6543 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
// Copyright 2019 The Gitea Authors. All rights reserved. | ||
// Use of this source code is governed by a MIT-style | ||
// license that can be found in the LICENSE file. | ||
|
||
package migrations | ||
|
||
import ( | ||
"fmt" | ||
|
||
"code.gitea.io/gitea/models" | ||
"code.gitea.io/gitea/modules/timeutil" | ||
|
||
"xorm.io/xorm" | ||
) | ||
|
||
func addIssueWatchModes(x *xorm.Engine) error { | ||
type IssueWatch struct { | ||
ID int64 `xorm:"pk autoincr"` | ||
UserID int64 `xorm:"UNIQUE(watch) NOT NULL"` | ||
IssueID int64 `xorm:"UNIQUE(watch) NOT NULL"` | ||
Mode models.IssueWatchMode `xorm:"NOT NULL DEFAULT 1"` | ||
CreatedUnix timeutil.TimeStamp `xorm:"created NOT NULL"` | ||
UpdatedUnix timeutil.TimeStamp `xorm:"updated NOT NULL"` | ||
} | ||
|
||
sess := x.NewSession() | ||
defer sess.Close() | ||
if err := sess.Begin(); err != nil { | ||
return err | ||
} | ||
|
||
if err := sess.Sync2(new(IssueWatch)); err != nil { | ||
return fmt.Errorf("Sync2: %v", err) | ||
} | ||
|
||
if _, err := sess.Where("is_watching = ?", false).Cols("mode").Update(&models.IssueWatch{Mode: models.IssueWatchModeDont}); err != nil { | ||
return err | ||
} | ||
if _, err := sess.Where("is_watching = ?", true).Cols("mode").Update(&models.IssueWatch{Mode: models.IssueWatchModeNormal}); err != nil { | ||
return err | ||
} | ||
|
||
if err := dropTableColumns(sess, "issue_watch", "is_watching"); err != nil { | ||
return err | ||
} | ||
|
||
return sess.Commit() | ||
} |
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.