Monorepo for Tangled tangled.org
858
fork

Configure Feed

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

appview/db,models: add repo_did columns and update model structs #272

open opened by oyster.cafe targeting master from lt/repo-rename-by-rkey
Labels

None yet.

assignee

None yet.

Participants 1
AT URI
at://did:plc:3fwecdnvtcscjnrx2p4n7alz/sh.tangled.repo.pull/3mjm6w2jguo22
+52 -58
Interdiff #2 #3
+52 -58
appview/db/db.go
··· 666 666 create index if not exists idx_references_from_at on reference_links(from_at); 667 667 create index if not exists idx_references_to_at on reference_links(to_at); 668 668 create index if not exists idx_webhook_deliveries_webhook_id on webhook_deliveries(webhook_id); 669 - create index if not exists idx_site_deploys_repo_at on site_deploys(repo_at); 670 669 create index if not exists idx_newsletter_prefs_user_did on newsletter_preferences(user_did); 671 670 `) 672 671 if err != nil { ··· 1417 1416 return err 1418 1417 }) 1419 1418 1419 + return &DB{ 1420 + db, 1421 + logger, 1422 + 1423 + 1424 + 1425 + 1426 + 1427 + 1428 + 1429 + 1430 + 1431 + 1432 + 1433 + 1434 + 1435 + 1436 + 1437 + 1438 + 1439 + 1440 + 1441 + 1442 + 1443 + 1444 + 1445 + 1446 + 1447 + 1448 + 1449 + 1450 + 1451 + 1452 + 1453 + 1454 + 1455 + 1456 + 1457 + 1458 + 1459 + 1460 + 1461 + 1462 + return err 1463 + }) 1464 + 1420 1465 orm.RunMigration(conn, logger, "add-repo-renames", func(tx *sql.Tx) error { 1421 1466 res, err := tx.Exec(` 1422 1467 update repos ··· 1512 1557 return err 1513 1558 }) 1514 1559 1515 - orm.RunMigration(conn, logger, "drop-old-repo-at-from-pds-rewrite-status", func(tx *sql.Tx) error { 1516 - _, err := tx.Exec(`ALTER TABLE pds_rewrite_status DROP COLUMN old_repo_at`) 1517 - return err 1518 - }) 1519 - 1520 1560 orm.RunMigration(conn, logger, "backfill-pds-rewrites-star-issue-pull-collab", func(tx *sql.Tx) error { 1521 1561 type source struct { 1522 1562 userDidCol string ··· 1533 1573 1534 1574 for _, src := range sources { 1535 1575 _, err := tx.Exec(fmt.Sprintf(` 1536 - INSERT INTO pds_rewrite_status (user_did, repo_did, record_nsid, record_rkey, status) 1537 - SELECT t.%s, r.repo_did, '%s', t.rkey, 'pending' 1576 + INSERT INTO pds_migration (name, did, collection, rkey, status) 1577 + SELECT 'add-repo-did', t.%s, '%s', t.rkey, 'pending' 1538 1578 FROM %s t 1539 1579 JOIN repos r ON r.at_uri = t.%s 1540 1580 WHERE r.repo_did IS NOT NULL AND r.repo_did != '' 1541 - ON CONFLICT(user_did, record_nsid, record_rkey) DO NOTHING 1581 + ON CONFLICT(name, did, collection, rkey) DO NOTHING 1542 1582 `, src.userDidCol, src.nsid, src.table, src.fkCol)) 1543 1583 if err != nil { 1544 1584 return fmt.Errorf("backfill pds rewrites for %s: %w", src.table, err) ··· 1550 1590 1551 1591 orm.RunMigration(conn, logger, "backfill-pds-rewrites-profiles", func(tx *sql.Tx) error { 1552 1592 _, err := tx.Exec(` 1553 - INSERT INTO pds_rewrite_status (user_did, repo_did, record_nsid, record_rkey, status) 1554 - SELECT DISTINCT pp.did, r.repo_did, 'sh.tangled.actor.profile', 'self', 'pending' 1593 + INSERT INTO pds_migration (name, did, collection, rkey, status) 1594 + SELECT DISTINCT 'add-repo-did', pp.did, 'sh.tangled.actor.profile', 'self', 'pending' 1555 1595 FROM profile_pinned_repositories pp 1556 1596 JOIN repos r ON r.at_uri = pp.pin 1557 1597 WHERE pp.pin LIKE 'at://%' 1558 1598 AND r.repo_did IS NOT NULL AND r.repo_did != '' 1559 - ON CONFLICT(user_did, record_nsid, record_rkey) DO NOTHING 1599 + ON CONFLICT(name, did, collection, rkey) DO NOTHING 1560 1600 `) 1561 1601 if err != nil { 1562 1602 return fmt.Errorf("backfill pds rewrites for profiles: %w", err) ··· 1837 1877 1838 1878 return &DB{ 1839 1879 db, 1840 - logger, 1841 - 1842 - 1843 - 1844 - 1845 - 1846 - 1847 - 1848 - 1849 - 1850 - 1851 - 1852 - 1853 - 1854 - 1855 - 1856 - 1857 - 1858 - 1859 - 1860 - 1861 - 1862 - 1863 - 1864 - 1865 - 1866 - 1867 - 1868 - 1869 - 1870 - 1871 - 1872 - 1873 - 1874 - 1875 - 1876 - 1877 - 1878 - 1879 - 1880 - 1881 - return err 1882 - }) 1883 - 1884 - return &DB{ 1885 - db, 1886 1880 logger,
appview/models/artifact.go

This file has not been changed.

appview/models/collaborator.go

This file has not been changed.

appview/models/issue.go

This file has not been changed.

appview/models/language.go

This file has not been changed.

appview/models/pull.go

This file has not been changed.

appview/models/repo.go

This file has not been changed.

appview/models/repo_test.go

This file has not been changed.

appview/models/search.go

This file has not been changed.

appview/models/search_test.go

This file has not been changed.

appview/models/site_deploy.go

This file has not been changed.

appview/models/sites.go

This file has not been changed.

appview/models/star.go

This file has not been changed.

appview/models/webhook.go

This file has not been changed.

orm/orm.go

This file has not been changed.

History

9 rounds 0 comments
sign up or login to add to the discussion
1 commit
expand
appview/db,models: add repo_did columns and update model structs
merge conflicts detected
expand
  • api/tangled/cbor_gen.go:866
  • api/tangled/feedstar.go:5
  • api/tangled/gitrefUpdate.go:29
  • api/tangled/repocollaborator.go:19
  • api/tangled/repoissue.go:22
  • api/tangled/repopull.go:39
  • api/tangled/tangledrepo.go:24
  • cmd/cborgen/cborgen.go:17
  • knotserver/xrpc/merge.go:118
  • lexicons/feed/star.json:10
  • lexicons/git/refUpdate.json:11
  • lexicons/issue/issue.json:9
  • lexicons/pulls/pull.json:65
  • lexicons/repo/collaborator.json:11
  • lexicons/repo/repo.json:6
expand 0 comments
1 commit
expand
appview/db,models: add repo_did columns and update model structs
expand 0 comments
1 commit
expand
appview/db,models: add repo_did columns and update model structs
expand 0 comments
1 commit
expand
appview/db,models: add repo_did columns and update model structs
expand 0 comments
1 commit
expand
appview/db,models: add repo_did columns and update model structs
expand 0 comments
1 commit
expand
appview/db,models: add repo_did columns and update model structs
expand 0 comments
1 commit
expand
appview/db,models: add repo_did columns and update model structs
expand 0 comments
1 commit
expand
appview/db,models: add repo_did columns and update model structs
expand 0 comments
1 commit
expand
appview/db,models: add repo_did columns and update model structs
expand 0 comments