back interdiff of round #1 and #0

appview/db: split star subjects #824

merged
opened by boltless.me targeting master from sl/uzmtowmlwkvz

renamed starred_by_did column to did

remove foreign key constraints from repo_at column to support targetting non-ingested repository or sh.tangled.string. the column isn't renamed yet because I'm afraid to break somewhere with that rename. We really need some test code here.

Signed-off-by: Seongmin Lee git@boltless.me

files
appview
db
models
notify
db
posthog
pages
templates
timeline
fragments
state
ERROR
appview/db/db.go

Failed to calculate interdiff for this file.

ERROR
appview/db/star.go

Failed to calculate interdiff for this file.

ERROR
appview/db/timeline.go

Failed to calculate interdiff for this file.

ERROR
appview/ingester.go

Failed to calculate interdiff for this file.

ERROR
appview/models/star.go

Failed to calculate interdiff for this file.

ERROR
appview/notify/db/db.go

Failed to calculate interdiff for this file.

ERROR
appview/notify/posthog/notifier.go

Failed to calculate interdiff for this file.

ERROR
appview/pages/templates/timeline/fragments/timeline.html

Failed to calculate interdiff for this file.

ERROR
appview/state/profile.go

Failed to calculate interdiff for this file.

ERROR
appview/state/star.go

Failed to calculate interdiff for this file.

NEW
appview/db/repos.go
···
starCountQuery := fmt.Sprintf(
`select
-
repo_at, count(1)
from stars
-
where repo_at in (%s)
-
group by repo_at`,
inClause,
)
rows, err = e.Query(starCountQuery, args...)
···
starCountQuery := fmt.Sprintf(
`select
+
subject_at, count(1)
from stars
+
where subject_at in (%s)
+
group by subject_at`,
inClause,
)
rows, err = e.Query(starCountQuery, args...)
NEW
appview/models/timeline.go
···
type TimelineEvent struct {
*Repo
*Follow
-
*Star
EventAt time.Time
···
type TimelineEvent struct {
*Repo
*Follow
+
*RepoStar
EventAt time.Time