mirror of
				https://github.com/go-gitea/gitea
				synced 2025-11-04 05:18:25 +00:00 
			
		
		
		
	Create issue_watch table
This commit is contained in:
		
							
								
								
									
										20
									
								
								models/issue_watch.go
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										20
									
								
								models/issue_watch.go
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,20 @@
 | 
				
			|||||||
 | 
					package models
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import (
 | 
				
			||||||
 | 
						"time"
 | 
				
			||||||
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					// IssueWatch is connection request for receiving issue notification.
 | 
				
			||||||
 | 
					type IssueWatch struct {
 | 
				
			||||||
 | 
						ID          int64     `xorm:"pk autoincr"`
 | 
				
			||||||
 | 
						UserID      int64     `xorm:"UNIQUE(watch) NOT NULL"`
 | 
				
			||||||
 | 
						IssueID     int64     `xorm:"UNIQUE(watch) NOT NULL"`
 | 
				
			||||||
 | 
						IsWatching  bool      `xorm:"NOT NULL"`
 | 
				
			||||||
 | 
						Created     time.Time `xorm:"-"`
 | 
				
			||||||
 | 
						CreatedUnix int64     `xorm:"NOT NULL"`
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					// BeforeInsert is invoked from XORM before inserting an object of this type.
 | 
				
			||||||
 | 
					func (iw *IssueWatch) BeforeInsert() {
 | 
				
			||||||
 | 
						iw.CreatedUnix = time.Now().Unix()
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
@@ -117,6 +117,7 @@ func init() {
 | 
				
			|||||||
		new(ExternalLoginUser),
 | 
							new(ExternalLoginUser),
 | 
				
			||||||
		new(ProtectedBranch),
 | 
							new(ProtectedBranch),
 | 
				
			||||||
		new(UserOpenID),
 | 
							new(UserOpenID),
 | 
				
			||||||
 | 
							new(IssueWatch),
 | 
				
			||||||
	)
 | 
						)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	gonicNames := []string{"SSL", "UID"}
 | 
						gonicNames := []string{"SSL", "UID"}
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user