Monorepo for Tangled tangled.org
5

Configure Feed

Select the types of activity you want to include in your feed.

appview/db: add migration to fix incorrect pipeline statuses

fixes duplications in our DB from an unfortunate spindle deploy. on the
offchance that there are other spindle instances out there that deployed
master, this should fix all ingested statuses.

Signed-off-by: oppiliappan <me@oppi.li>

author
oppiliappan
date (Jun 12, 2026, 12:06 PM +0300) commit 82694c35 parent f7936804 change-id qxnlpktz
+16
+16
appview/db/db.go
··· 2192 2192 return err 2193 2193 }) 2194 2194 2195 + orm.RunMigration(conn, logger, "delete-unused-pipeline-statuses", func(tx *sql.Tx) error { 2196 + _, err := tx.Exec(` 2197 + delete from pipeline_statuses as p 2198 + where p.status = 'pending' 2199 + and exists ( 2200 + select 1 from pipeline_statuses as q 2201 + where q.pipeline_knot = p.pipeline_knot 2202 + and q.pipeline_rkey = p.pipeline_rkey 2203 + and q.workflow = p.workflow 2204 + and q.status = 'pending' 2205 + and q.created < p.created 2206 + ); 2207 + `) 2208 + return err 2209 + }) 2210 + 2195 2211 return &DB{ 2196 2212 db, 2197 2213 logger,