tenseleyflow/shithub / cd0fd78

Browse files

Add profile pin persistence

Authored by espadonne
SHA
cd0fd7847285aca92728d482988f3f96aa304d5f
Parents
042883c
Tree
6230a05

18 changed files

StatusFile+-
M internal/admin/sqlc/models.go 14 0
M internal/auth/policy/sqlc/models.go 14 0
M internal/checks/sqlc/models.go 14 0
M internal/issues/sqlc/models.go 14 0
M internal/meta/sqlc/models.go 14 0
A internal/migrationsfs/migrations/0040_profile_pins.sql 46 0
M internal/notif/sqlc/models.go 14 0
M internal/orgs/sqlc/models.go 14 0
M internal/pulls/sqlc/models.go 14 0
M internal/ratelimit/sqlc/models.go 14 0
M internal/repos/queries/repos.sql 35 0
M internal/repos/sqlc/models.go 14 0
M internal/repos/sqlc/querier.go 8 0
M internal/repos/sqlc/repos.sql.go 111 0
M internal/social/sqlc/models.go 14 0
M internal/users/sqlc/models.go 14 0
M internal/webhook/sqlc/models.go 14 0
M internal/worker/sqlc/models.go 14 0
internal/admin/sqlc/models.gomodified
@@ -1629,6 +1629,20 @@ type Principal struct {
16291629
 	ID   int64
16301630
 }
16311631
 
1632
+type ProfilePin struct {
1633
+	SetID    int64
1634
+	RepoID   int64
1635
+	Position int32
1636
+	PinnedAt pgtype.Timestamptz
1637
+}
1638
+
1639
+type ProfilePinSet struct {
1640
+	ID          int64
1641
+	OwnerUserID pgtype.Int8
1642
+	OwnerOrgID  pgtype.Int8
1643
+	UpdatedAt   pgtype.Timestamptz
1644
+}
1645
+
16321646
 type PullRequest struct {
16331647
 	IssueID            int64
16341648
 	BaseRef            string
internal/auth/policy/sqlc/models.gomodified
@@ -1629,6 +1629,20 @@ type Principal struct {
16291629
 	ID   int64
16301630
 }
16311631
 
1632
+type ProfilePin struct {
1633
+	SetID    int64
1634
+	RepoID   int64
1635
+	Position int32
1636
+	PinnedAt pgtype.Timestamptz
1637
+}
1638
+
1639
+type ProfilePinSet struct {
1640
+	ID          int64
1641
+	OwnerUserID pgtype.Int8
1642
+	OwnerOrgID  pgtype.Int8
1643
+	UpdatedAt   pgtype.Timestamptz
1644
+}
1645
+
16321646
 type PullRequest struct {
16331647
 	IssueID            int64
16341648
 	BaseRef            string
internal/checks/sqlc/models.gomodified
@@ -1629,6 +1629,20 @@ type Principal struct {
16291629
 	ID   int64
16301630
 }
16311631
 
1632
+type ProfilePin struct {
1633
+	SetID    int64
1634
+	RepoID   int64
1635
+	Position int32
1636
+	PinnedAt pgtype.Timestamptz
1637
+}
1638
+
1639
+type ProfilePinSet struct {
1640
+	ID          int64
1641
+	OwnerUserID pgtype.Int8
1642
+	OwnerOrgID  pgtype.Int8
1643
+	UpdatedAt   pgtype.Timestamptz
1644
+}
1645
+
16321646
 type PullRequest struct {
16331647
 	IssueID            int64
16341648
 	BaseRef            string
internal/issues/sqlc/models.gomodified
@@ -1629,6 +1629,20 @@ type Principal struct {
16291629
 	ID   int64
16301630
 }
16311631
 
1632
+type ProfilePin struct {
1633
+	SetID    int64
1634
+	RepoID   int64
1635
+	Position int32
1636
+	PinnedAt pgtype.Timestamptz
1637
+}
1638
+
1639
+type ProfilePinSet struct {
1640
+	ID          int64
1641
+	OwnerUserID pgtype.Int8
1642
+	OwnerOrgID  pgtype.Int8
1643
+	UpdatedAt   pgtype.Timestamptz
1644
+}
1645
+
16321646
 type PullRequest struct {
16331647
 	IssueID            int64
16341648
 	BaseRef            string
internal/meta/sqlc/models.gomodified
@@ -1629,6 +1629,20 @@ type Principal struct {
16291629
 	ID   int64
16301630
 }
16311631
 
1632
+type ProfilePin struct {
1633
+	SetID    int64
1634
+	RepoID   int64
1635
+	Position int32
1636
+	PinnedAt pgtype.Timestamptz
1637
+}
1638
+
1639
+type ProfilePinSet struct {
1640
+	ID          int64
1641
+	OwnerUserID pgtype.Int8
1642
+	OwnerOrgID  pgtype.Int8
1643
+	UpdatedAt   pgtype.Timestamptz
1644
+}
1645
+
16321646
 type PullRequest struct {
16331647
 	IssueID            int64
16341648
 	BaseRef            string
internal/migrationsfs/migrations/0040_profile_pins.sqladded
@@ -0,0 +1,46 @@
1
+-- SPDX-License-Identifier: AGPL-3.0-or-later
2
+--
3
+-- Profile and organization pinned repositories.
4
+--
5
+-- A pin set records that the owner has customized their pinned
6
+-- repositories. The separate row lets us distinguish "never customized"
7
+-- from "customized to zero pins" while keeping the ordered pins table
8
+-- normalized and easy to replace transactionally.
9
+
10
+-- +goose Up
11
+CREATE TABLE profile_pin_sets (
12
+    id            bigserial   PRIMARY KEY,
13
+    owner_user_id bigint      REFERENCES users(id) ON DELETE CASCADE,
14
+    owner_org_id  bigint      REFERENCES orgs(id) ON DELETE CASCADE,
15
+    updated_at    timestamptz NOT NULL DEFAULT now(),
16
+
17
+    CONSTRAINT profile_pin_sets_owner_xor CHECK (
18
+        (owner_user_id IS NOT NULL AND owner_org_id IS NULL)
19
+     OR (owner_user_id IS NULL     AND owner_org_id IS NOT NULL)
20
+    )
21
+);
22
+
23
+CREATE UNIQUE INDEX profile_pin_sets_owner_user_uq
24
+    ON profile_pin_sets (owner_user_id)
25
+    WHERE owner_user_id IS NOT NULL;
26
+
27
+CREATE UNIQUE INDEX profile_pin_sets_owner_org_uq
28
+    ON profile_pin_sets (owner_org_id)
29
+    WHERE owner_org_id IS NOT NULL;
30
+
31
+CREATE TABLE profile_pins (
32
+    set_id    bigint      NOT NULL REFERENCES profile_pin_sets(id) ON DELETE CASCADE,
33
+    repo_id   bigint      NOT NULL REFERENCES repos(id) ON DELETE CASCADE,
34
+    position  integer     NOT NULL,
35
+    pinned_at timestamptz NOT NULL DEFAULT now(),
36
+
37
+    PRIMARY KEY (set_id, repo_id),
38
+    CONSTRAINT profile_pins_position_range CHECK (position BETWEEN 1 AND 6),
39
+    CONSTRAINT profile_pins_set_position_uq UNIQUE (set_id, position)
40
+);
41
+
42
+CREATE INDEX profile_pins_repo_idx ON profile_pins (repo_id);
43
+
44
+-- +goose Down
45
+DROP TABLE IF EXISTS profile_pins;
46
+DROP TABLE IF EXISTS profile_pin_sets;
internal/notif/sqlc/models.gomodified
@@ -1629,6 +1629,20 @@ type Principal struct {
16291629
 	ID   int64
16301630
 }
16311631
 
1632
+type ProfilePin struct {
1633
+	SetID    int64
1634
+	RepoID   int64
1635
+	Position int32
1636
+	PinnedAt pgtype.Timestamptz
1637
+}
1638
+
1639
+type ProfilePinSet struct {
1640
+	ID          int64
1641
+	OwnerUserID pgtype.Int8
1642
+	OwnerOrgID  pgtype.Int8
1643
+	UpdatedAt   pgtype.Timestamptz
1644
+}
1645
+
16321646
 type PullRequest struct {
16331647
 	IssueID            int64
16341648
 	BaseRef            string
internal/orgs/sqlc/models.gomodified
@@ -1629,6 +1629,20 @@ type Principal struct {
16291629
 	ID   int64
16301630
 }
16311631
 
1632
+type ProfilePin struct {
1633
+	SetID    int64
1634
+	RepoID   int64
1635
+	Position int32
1636
+	PinnedAt pgtype.Timestamptz
1637
+}
1638
+
1639
+type ProfilePinSet struct {
1640
+	ID          int64
1641
+	OwnerUserID pgtype.Int8
1642
+	OwnerOrgID  pgtype.Int8
1643
+	UpdatedAt   pgtype.Timestamptz
1644
+}
1645
+
16321646
 type PullRequest struct {
16331647
 	IssueID            int64
16341648
 	BaseRef            string
internal/pulls/sqlc/models.gomodified
@@ -1629,6 +1629,20 @@ type Principal struct {
16291629
 	ID   int64
16301630
 }
16311631
 
1632
+type ProfilePin struct {
1633
+	SetID    int64
1634
+	RepoID   int64
1635
+	Position int32
1636
+	PinnedAt pgtype.Timestamptz
1637
+}
1638
+
1639
+type ProfilePinSet struct {
1640
+	ID          int64
1641
+	OwnerUserID pgtype.Int8
1642
+	OwnerOrgID  pgtype.Int8
1643
+	UpdatedAt   pgtype.Timestamptz
1644
+}
1645
+
16321646
 type PullRequest struct {
16331647
 	IssueID            int64
16341648
 	BaseRef            string
internal/ratelimit/sqlc/models.gomodified
@@ -1629,6 +1629,20 @@ type Principal struct {
16291629
 	ID   int64
16301630
 }
16311631
 
1632
+type ProfilePin struct {
1633
+	SetID    int64
1634
+	RepoID   int64
1635
+	Position int32
1636
+	PinnedAt pgtype.Timestamptz
1637
+}
1638
+
1639
+type ProfilePinSet struct {
1640
+	ID          int64
1641
+	OwnerUserID pgtype.Int8
1642
+	OwnerOrgID  pgtype.Int8
1643
+	UpdatedAt   pgtype.Timestamptz
1644
+}
1645
+
16321646
 type PullRequest struct {
16331647
 	IssueID            int64
16341648
 	BaseRef            string
internal/repos/queries/repos.sqlmodified
@@ -125,6 +125,41 @@ UPDATE repos
125125
 -- name: ListRepoTopics :many
126126
 SELECT topic FROM repo_topics WHERE repo_id = $1 ORDER BY topic ASC;
127127
 
128
+-- ─── profile/org pinned repositories ───────────────────────────────
129
+
130
+-- name: GetProfilePinSetForUser :one
131
+SELECT id FROM profile_pin_sets WHERE owner_user_id = $1;
132
+
133
+-- name: GetProfilePinSetForOrg :one
134
+SELECT id FROM profile_pin_sets WHERE owner_org_id = $1;
135
+
136
+-- name: UpsertProfilePinSetForUser :one
137
+INSERT INTO profile_pin_sets (owner_user_id)
138
+VALUES ($1)
139
+ON CONFLICT (owner_user_id) WHERE owner_user_id IS NOT NULL
140
+DO UPDATE SET updated_at = now()
141
+RETURNING id;
142
+
143
+-- name: UpsertProfilePinSetForOrg :one
144
+INSERT INTO profile_pin_sets (owner_org_id)
145
+VALUES ($1)
146
+ON CONFLICT (owner_org_id) WHERE owner_org_id IS NOT NULL
147
+DO UPDATE SET updated_at = now()
148
+RETURNING id;
149
+
150
+-- name: ListProfilePinsForSet :many
151
+SELECT repo_id, position
152
+FROM profile_pins
153
+WHERE set_id = $1
154
+ORDER BY position ASC;
155
+
156
+-- name: DeleteProfilePinsForSet :exec
157
+DELETE FROM profile_pins WHERE set_id = $1;
158
+
159
+-- name: InsertProfilePin :exec
160
+INSERT INTO profile_pins (set_id, repo_id, position)
161
+VALUES ($1, $2, $3);
162
+
128163
 -- name: ReplaceRepoTopics :exec
129164
 -- Atomic full-replace: callers compose the new topic set in Go,
130165
 -- then replace the existing rows in one tx (DELETE + INSERT). The
internal/repos/sqlc/models.gomodified
@@ -1629,6 +1629,20 @@ type Principal struct {
16291629
 	ID   int64
16301630
 }
16311631
 
1632
+type ProfilePin struct {
1633
+	SetID    int64
1634
+	RepoID   int64
1635
+	Position int32
1636
+	PinnedAt pgtype.Timestamptz
1637
+}
1638
+
1639
+type ProfilePinSet struct {
1640
+	ID          int64
1641
+	OwnerUserID pgtype.Int8
1642
+	OwnerOrgID  pgtype.Int8
1643
+	UpdatedAt   pgtype.Timestamptz
1644
+}
1645
+
16321646
 type PullRequest struct {
16331647
 	IssueID            int64
16341648
 	BaseRef            string
internal/repos/sqlc/querier.gomodified
@@ -31,6 +31,7 @@ type Querier interface {
3131
 	CreateRepo(ctx context.Context, db DBTX, arg CreateRepoParams) (Repo, error)
3232
 	DeclineTransferRequest(ctx context.Context, db DBTX, id int64) error
3333
 	DeleteBranchProtectionRule(ctx context.Context, db DBTX, id int64) error
34
+	DeleteProfilePinsForSet(ctx context.Context, db DBTX, setID int64) error
3435
 	// Used by the rename compensator: drop a single redirect row when
3536
 	// the rename has to be rolled back due to a filesystem failure. We
3637
 	// avoided raw SQL here at the audit's request (S00-S25, M).
@@ -45,6 +46,9 @@ type Querier interface {
4546
 	// offers past their expires_at to the expired terminal state.
4647
 	ExpirePendingTransfers(ctx context.Context, db DBTX) (int64, error)
4748
 	GetBranchProtectionRule(ctx context.Context, db DBTX, id int64) (BranchProtectionRule, error)
49
+	GetProfilePinSetForOrg(ctx context.Context, db DBTX, ownerOrgID pgtype.Int8) (int64, error)
50
+	// ─── profile/org pinned repositories ───────────────────────────────
51
+	GetProfilePinSetForUser(ctx context.Context, db DBTX, ownerUserID pgtype.Int8) (int64, error)
4852
 	GetRepoByID(ctx context.Context, db DBTX, id int64) (Repo, error)
4953
 	// S30: org-owner mirror of GetRepoByOwnerUserAndName. The (owner_org_id,
5054
 	// name) partial unique index from 0017 backs this lookup with the same
@@ -57,6 +61,7 @@ type Querier interface {
5761
 	GetRepoOwnerUsernameByID(ctx context.Context, db DBTX, id int64) (GetRepoOwnerUsernameByIDRow, error)
5862
 	GetTransferRequest(ctx context.Context, db DBTX, id int64) (RepoTransferRequest, error)
5963
 	HardDeleteRepo(ctx context.Context, db DBTX, id int64) error
64
+	InsertProfilePin(ctx context.Context, db DBTX, arg InsertProfilePinParams) error
6065
 	// ─── redirects ─────────────────────────────────────────────────────────
6166
 	// Both old-owner FKs are nullable; pass exactly one. The CHECK
6267
 	// constraint on the table enforces the xor shape.
@@ -79,6 +84,7 @@ type Querier interface {
7984
 	ListForksOfRepoForRepack(ctx context.Context, db DBTX, forkOfRepoID pgtype.Int8) ([]ListForksOfRepoForRepackRow, error)
8085
 	// Inbox view: pending offers a user can act on.
8186
 	ListPendingTransfersForUser(ctx context.Context, db DBTX, toPrincipalID int64) ([]RepoTransferRequest, error)
87
+	ListProfilePinsForSet(ctx context.Context, db DBTX, setID int64) ([]ListProfilePinsForSetRow, error)
8288
 	// ─── soft-delete sweep query ───────────────────────────────────────────
8389
 	// The repo:hard_delete enqueuer queries this to find rows ready for
8490
 	// destruction. The 7-day grace is hard-coded here; if we add a config
@@ -158,6 +164,8 @@ type Querier interface {
158164
 	UpdateRepoGeneralSettings(ctx context.Context, db DBTX, arg UpdateRepoGeneralSettingsParams) error
159165
 	UpdateRepoMergeSettings(ctx context.Context, db DBTX, arg UpdateRepoMergeSettingsParams) error
160166
 	UpsertBranchProtectionRule(ctx context.Context, db DBTX, arg UpsertBranchProtectionRuleParams) (int64, error)
167
+	UpsertProfilePinSetForOrg(ctx context.Context, db DBTX, ownerOrgID pgtype.Int8) (int64, error)
168
+	UpsertProfilePinSetForUser(ctx context.Context, db DBTX, ownerUserID pgtype.Int8) (int64, error)
161169
 }
162170
 
163171
 var _ Querier = (*Queries)(nil)
internal/repos/sqlc/repos.sql.gomodified
@@ -185,6 +185,15 @@ func (q *Queries) CreateRepo(ctx context.Context, db DBTX, arg CreateRepoParams)
185185
 	return i, err
186186
 }
187187
 
188
+const deleteProfilePinsForSet = `-- name: DeleteProfilePinsForSet :exec
189
+DELETE FROM profile_pins WHERE set_id = $1
190
+`
191
+
192
+func (q *Queries) DeleteProfilePinsForSet(ctx context.Context, db DBTX, setID int64) error {
193
+	_, err := db.Exec(ctx, deleteProfilePinsForSet, setID)
194
+	return err
195
+}
196
+
188197
 const existsRepoForOwnerOrg = `-- name: ExistsRepoForOwnerOrg :one
189198
 SELECT EXISTS(
190199
     SELECT 1 FROM repos
@@ -223,6 +232,30 @@ func (q *Queries) ExistsRepoForOwnerUser(ctx context.Context, db DBTX, arg Exist
223232
 	return exists, err
224233
 }
225234
 
235
+const getProfilePinSetForOrg = `-- name: GetProfilePinSetForOrg :one
236
+SELECT id FROM profile_pin_sets WHERE owner_org_id = $1
237
+`
238
+
239
+func (q *Queries) GetProfilePinSetForOrg(ctx context.Context, db DBTX, ownerOrgID pgtype.Int8) (int64, error) {
240
+	row := db.QueryRow(ctx, getProfilePinSetForOrg, ownerOrgID)
241
+	var id int64
242
+	err := row.Scan(&id)
243
+	return id, err
244
+}
245
+
246
+const getProfilePinSetForUser = `-- name: GetProfilePinSetForUser :one
247
+
248
+SELECT id FROM profile_pin_sets WHERE owner_user_id = $1
249
+`
250
+
251
+// ─── profile/org pinned repositories ───────────────────────────────
252
+func (q *Queries) GetProfilePinSetForUser(ctx context.Context, db DBTX, ownerUserID pgtype.Int8) (int64, error) {
253
+	row := db.QueryRow(ctx, getProfilePinSetForUser, ownerUserID)
254
+	var id int64
255
+	err := row.Scan(&id)
256
+	return id, err
257
+}
258
+
226259
 const getRepoByID = `-- name: GetRepoByID :one
227260
 SELECT id, owner_user_id, owner_org_id, name, description, visibility,
228261
        default_branch, is_archived, archived_at, deleted_at,
@@ -402,6 +435,22 @@ func (q *Queries) GetRepoOwnerUsernameByID(ctx context.Context, db DBTX, id int6
402435
 	return i, err
403436
 }
404437
 
438
+const insertProfilePin = `-- name: InsertProfilePin :exec
439
+INSERT INTO profile_pins (set_id, repo_id, position)
440
+VALUES ($1, $2, $3)
441
+`
442
+
443
+type InsertProfilePinParams struct {
444
+	SetID    int64
445
+	RepoID   int64
446
+	Position int32
447
+}
448
+
449
+func (q *Queries) InsertProfilePin(ctx context.Context, db DBTX, arg InsertProfilePinParams) error {
450
+	_, err := db.Exec(ctx, insertProfilePin, arg.SetID, arg.RepoID, arg.Position)
451
+	return err
452
+}
453
+
405454
 const insertRepoTopic = `-- name: InsertRepoTopic :exec
406455
 INSERT INTO repo_topics (repo_id, topic)
407456
 VALUES ($1, $2)
@@ -559,6 +608,38 @@ func (q *Queries) ListForksOfRepoForRepack(ctx context.Context, db DBTX, forkOfR
559608
 	return items, nil
560609
 }
561610
 
611
+const listProfilePinsForSet = `-- name: ListProfilePinsForSet :many
612
+SELECT repo_id, position
613
+FROM profile_pins
614
+WHERE set_id = $1
615
+ORDER BY position ASC
616
+`
617
+
618
+type ListProfilePinsForSetRow struct {
619
+	RepoID   int64
620
+	Position int32
621
+}
622
+
623
+func (q *Queries) ListProfilePinsForSet(ctx context.Context, db DBTX, setID int64) ([]ListProfilePinsForSetRow, error) {
624
+	rows, err := db.Query(ctx, listProfilePinsForSet, setID)
625
+	if err != nil {
626
+		return nil, err
627
+	}
628
+	defer rows.Close()
629
+	items := []ListProfilePinsForSetRow{}
630
+	for rows.Next() {
631
+		var i ListProfilePinsForSetRow
632
+		if err := rows.Scan(&i.RepoID, &i.Position); err != nil {
633
+			return nil, err
634
+		}
635
+		items = append(items, i)
636
+	}
637
+	if err := rows.Err(); err != nil {
638
+		return nil, err
639
+	}
640
+	return items, nil
641
+}
642
+
562643
 const listRepoTopics = `-- name: ListRepoTopics :many
563644
 
564645
 SELECT topic FROM repo_topics WHERE repo_id = $1 ORDER BY topic ASC
@@ -900,3 +981,33 @@ func (q *Queries) UpdateRepoMergeSettings(ctx context.Context, db DBTX, arg Upda
900981
 	)
901982
 	return err
902983
 }
984
+
985
+const upsertProfilePinSetForOrg = `-- name: UpsertProfilePinSetForOrg :one
986
+INSERT INTO profile_pin_sets (owner_org_id)
987
+VALUES ($1)
988
+ON CONFLICT (owner_org_id) WHERE owner_org_id IS NOT NULL
989
+DO UPDATE SET updated_at = now()
990
+RETURNING id
991
+`
992
+
993
+func (q *Queries) UpsertProfilePinSetForOrg(ctx context.Context, db DBTX, ownerOrgID pgtype.Int8) (int64, error) {
994
+	row := db.QueryRow(ctx, upsertProfilePinSetForOrg, ownerOrgID)
995
+	var id int64
996
+	err := row.Scan(&id)
997
+	return id, err
998
+}
999
+
1000
+const upsertProfilePinSetForUser = `-- name: UpsertProfilePinSetForUser :one
1001
+INSERT INTO profile_pin_sets (owner_user_id)
1002
+VALUES ($1)
1003
+ON CONFLICT (owner_user_id) WHERE owner_user_id IS NOT NULL
1004
+DO UPDATE SET updated_at = now()
1005
+RETURNING id
1006
+`
1007
+
1008
+func (q *Queries) UpsertProfilePinSetForUser(ctx context.Context, db DBTX, ownerUserID pgtype.Int8) (int64, error) {
1009
+	row := db.QueryRow(ctx, upsertProfilePinSetForUser, ownerUserID)
1010
+	var id int64
1011
+	err := row.Scan(&id)
1012
+	return id, err
1013
+}
internal/social/sqlc/models.gomodified
@@ -1629,6 +1629,20 @@ type Principal struct {
16291629
 	ID   int64
16301630
 }
16311631
 
1632
+type ProfilePin struct {
1633
+	SetID    int64
1634
+	RepoID   int64
1635
+	Position int32
1636
+	PinnedAt pgtype.Timestamptz
1637
+}
1638
+
1639
+type ProfilePinSet struct {
1640
+	ID          int64
1641
+	OwnerUserID pgtype.Int8
1642
+	OwnerOrgID  pgtype.Int8
1643
+	UpdatedAt   pgtype.Timestamptz
1644
+}
1645
+
16321646
 type PullRequest struct {
16331647
 	IssueID            int64
16341648
 	BaseRef            string
internal/users/sqlc/models.gomodified
@@ -1629,6 +1629,20 @@ type Principal struct {
16291629
 	ID   int64
16301630
 }
16311631
 
1632
+type ProfilePin struct {
1633
+	SetID    int64
1634
+	RepoID   int64
1635
+	Position int32
1636
+	PinnedAt pgtype.Timestamptz
1637
+}
1638
+
1639
+type ProfilePinSet struct {
1640
+	ID          int64
1641
+	OwnerUserID pgtype.Int8
1642
+	OwnerOrgID  pgtype.Int8
1643
+	UpdatedAt   pgtype.Timestamptz
1644
+}
1645
+
16321646
 type PullRequest struct {
16331647
 	IssueID            int64
16341648
 	BaseRef            string
internal/webhook/sqlc/models.gomodified
@@ -1629,6 +1629,20 @@ type Principal struct {
16291629
 	ID   int64
16301630
 }
16311631
 
1632
+type ProfilePin struct {
1633
+	SetID    int64
1634
+	RepoID   int64
1635
+	Position int32
1636
+	PinnedAt pgtype.Timestamptz
1637
+}
1638
+
1639
+type ProfilePinSet struct {
1640
+	ID          int64
1641
+	OwnerUserID pgtype.Int8
1642
+	OwnerOrgID  pgtype.Int8
1643
+	UpdatedAt   pgtype.Timestamptz
1644
+}
1645
+
16321646
 type PullRequest struct {
16331647
 	IssueID            int64
16341648
 	BaseRef            string
internal/worker/sqlc/models.gomodified
@@ -1629,6 +1629,20 @@ type Principal struct {
16291629
 	ID   int64
16301630
 }
16311631
 
1632
+type ProfilePin struct {
1633
+	SetID    int64
1634
+	RepoID   int64
1635
+	Position int32
1636
+	PinnedAt pgtype.Timestamptz
1637
+}
1638
+
1639
+type ProfilePinSet struct {
1640
+	ID          int64
1641
+	OwnerUserID pgtype.Int8
1642
+	OwnerOrgID  pgtype.Int8
1643
+	UpdatedAt   pgtype.Timestamptz
1644
+}
1645
+
16321646
 type PullRequest struct {
16331647
 	IssueID            int64
16341648
 	BaseRef            string