repos / pico

pico services - prose.sh, pastes.sh, imgs.sh, feeds.sh, pgs.sh
git clone https://github.com/picosh/pico.git

commit
2abdb12
parent
d3089f9
author
Eric Bower
date
2022-07-28 14:20:11 +0000 UTC
fix: prose public keys were not always being added
1 files changed,  +12, -6
M cmd/migrate/migrate.go
+12, -6
 1@@ -155,6 +155,18 @@ func main() {
 2 		if err != nil {
 3 			panic(err)
 4 		}
 5+
 6+		proseKeys, err := proseDb.FindKeysForUser(proseUser)
 7+		if err != nil {
 8+			panic(err)
 9+		}
10+
11+		for _, prosePK := range proseKeys {
12+			err = insertPublicKey(tx, prosePK)
13+			if err != nil {
14+				panic(err)
15+			}
16+		}
17 	}
18 
19 	noconflicts := []*ConflictData{}
20@@ -190,11 +202,6 @@ func main() {
21 			pkMap := map[string]bool{}
22 			for _, prosePK := range proseKeys {
23 				pkMap[prosePK.Key] = true
24-
25-				err = insertPublicKey(tx, prosePK)
26-				if err != nil {
27-					panic(err)
28-				}
29 			}
30 
31 			conflicted := false
32@@ -274,7 +281,6 @@ func main() {
33 				post.Space = "lists"
34 				err = insertPost(tx, post)
35 				if err != nil {
36-					fmt.Println(post.Filename)
37 					panic(err)
38 				}
39 				updated = true