@@ -709,6 +709,49 @@ func (ns NullTransferStatus) Value() (driver.Value, error) { |
| 709 | 709 | return string(ns.TransferStatus), nil |
| 710 | 710 | } |
| 711 | 711 | |
| 712 | +type WatchLevel string |
| 713 | + |
| 714 | +const ( |
| 715 | + WatchLevelAll WatchLevel = "all" |
| 716 | + WatchLevelParticipating WatchLevel = "participating" |
| 717 | + WatchLevelIgnore WatchLevel = "ignore" |
| 718 | +) |
| 719 | + |
| 720 | +func (e *WatchLevel) Scan(src interface{}) error { |
| 721 | + switch s := src.(type) { |
| 722 | + case []byte: |
| 723 | + *e = WatchLevel(s) |
| 724 | + case string: |
| 725 | + *e = WatchLevel(s) |
| 726 | + default: |
| 727 | + return fmt.Errorf("unsupported scan type for WatchLevel: %T", src) |
| 728 | + } |
| 729 | + return nil |
| 730 | +} |
| 731 | + |
| 732 | +type NullWatchLevel struct { |
| 733 | + WatchLevel WatchLevel |
| 734 | + Valid bool // Valid is true if WatchLevel is not NULL |
| 735 | +} |
| 736 | + |
| 737 | +// Scan implements the Scanner interface. |
| 738 | +func (ns *NullWatchLevel) Scan(value interface{}) error { |
| 739 | + if value == nil { |
| 740 | + ns.WatchLevel, ns.Valid = "", false |
| 741 | + return nil |
| 742 | + } |
| 743 | + ns.Valid = true |
| 744 | + return ns.WatchLevel.Scan(value) |
| 745 | +} |
| 746 | + |
| 747 | +// Value implements the driver Valuer interface. |
| 748 | +func (ns NullWatchLevel) Value() (driver.Value, error) { |
| 749 | + if !ns.Valid { |
| 750 | + return nil, nil |
| 751 | + } |
| 752 | + return string(ns.WatchLevel), nil |
| 753 | +} |
| 754 | + |
| 712 | 755 | type AuthAuditLog struct { |
| 713 | 756 | ID int64 |
| 714 | 757 | ActorID pgtype.Int8 |
@@ -774,6 +817,18 @@ type CheckSuite struct { |
| 774 | 817 | UpdatedAt pgtype.Timestamptz |
| 775 | 818 | } |
| 776 | 819 | |
| 820 | +type DomainEvent struct { |
| 821 | + ID int64 |
| 822 | + ActorUserID pgtype.Int8 |
| 823 | + Kind string |
| 824 | + RepoID pgtype.Int8 |
| 825 | + SourceKind string |
| 826 | + SourceID int64 |
| 827 | + Public bool |
| 828 | + Payload []byte |
| 829 | + CreatedAt pgtype.Timestamptz |
| 830 | +} |
| 831 | + |
| 777 | 832 | type EmailVerification struct { |
| 778 | 833 | ID int64 |
| 779 | 834 | UserEmailID int64 |
@@ -1026,6 +1081,8 @@ type Repo struct { |
| 1026 | 1081 | AllowRebaseMerge bool |
| 1027 | 1082 | AllowMergeCommit bool |
| 1028 | 1083 | DefaultMergeMethod PrMergeMethod |
| 1084 | + StarCount int64 |
| 1085 | + WatcherCount int64 |
| 1029 | 1086 | } |
| 1030 | 1087 | |
| 1031 | 1088 | type RepoCollaborator struct { |
@@ -1064,6 +1121,12 @@ type RepoTransferRequest struct { |
| 1064 | 1121 | CanceledAt pgtype.Timestamptz |
| 1065 | 1122 | } |
| 1066 | 1123 | |
| 1124 | +type Star struct { |
| 1125 | + UserID int64 |
| 1126 | + RepoID int64 |
| 1127 | + StarredAt pgtype.Timestamptz |
| 1128 | +} |
| 1129 | + |
| 1067 | 1130 | type User struct { |
| 1068 | 1131 | ID int64 |
| 1069 | 1132 | Username string |
@@ -1161,6 +1224,13 @@ type UsernameRedirect struct { |
| 1161 | 1224 | ChangedAt pgtype.Timestamptz |
| 1162 | 1225 | } |
| 1163 | 1226 | |
| 1227 | +type Watch struct { |
| 1228 | + UserID int64 |
| 1229 | + RepoID int64 |
| 1230 | + Level WatchLevel |
| 1231 | + UpdatedAt pgtype.Timestamptz |
| 1232 | +} |
| 1233 | + |
| 1164 | 1234 | type WebhookEventsPending struct { |
| 1165 | 1235 | ID int64 |
| 1166 | 1236 | RepoID int64 |