Monorepo for Tangled tangled.org

appview/db: remove foreign key constraint between collections #995

open opened by boltless.me targeting master from sl/sqkrqopzkvoo

Appview cannot modify the user-owned record on repository deletion

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

Labels

None yet.

assignee

None yet.

Participants 1
AT URI
at://did:plc:xasnlahkri4ewmbuzly2rlc5/sh.tangled.repo.pull/3mcsfwwhtn622
+23
Diff #1
+23
appview/db/db.go
··· 1181 1181 return err 1182 1182 }) 1183 1183 1184 + // we cannot modify user-owned record on repository delete 1185 + orm.RunMigration(conn, logger, "remove-foreign-key-profile_pinned_repositories-and-repos", func(tx *sql.Tx) error { 1186 + _, err := tx.Exec(` 1187 + create table profile_pinned_repositories_new ( 1188 + did text not null, 1189 + 1190 + -- data 1191 + at_uri text not null, 1192 + 1193 + -- constraints 1194 + unique(did, at_uri), 1195 + foreign key (did) references profile(did) on delete cascade 1196 + ); 1197 + 1198 + insert into profile_pinned_repositories_new (did, at_uri) 1199 + select did, at_uri from profile_pinned_repositories; 1200 + 1201 + drop table profile_pinned_repositories; 1202 + alter table profile_pinned_repositories_new rename to profile_pinned_repositories; 1203 + `) 1204 + return err 1205 + }) 1206 + 1184 1207 return &DB{ 1185 1208 db, 1186 1209 logger,

History

2 rounds 0 comments
sign up or login to add to the discussion
1 commit
expand
appview/db: remove foreign key constraint between collections
2/3 failed, 1/3 success
expand
merge conflicts detected
expand
  • appview/pages/markup/markdown.go:47
  • appview/pages/pages.go:57
expand 0 comments
1 commit
expand
appview/db: remove foreign key constraint between collections
3/3 failed
expand
expand 0 comments