diff --git a/backupdb.go b/backupdb.go index 10d1853..d95539e 100644 --- a/backupdb.go +++ b/backupdb.go @@ -35,6 +35,7 @@ func svalbard(dirname string) { if err != nil { elog.Fatalf("can't open backup database") } + _, err = backup.Exec("PRAGMA journal_mode=WAL") for _, line := range strings.Split(sqlSchema, ";") { _, err = backup.Exec(line) if err != nil { @@ -76,16 +77,16 @@ func svalbard(dirname string) { honkids := make(map[int64]bool) for c := range convoys { - rows = qordie(orig, "select honkid, userid, what, honker, xid, rid, dt, url, audience, noise, convoy, whofore, format, precis, oonker, flags from honks where convoy = ?", c) + rows = qordie(orig, "select honkid, userid, what, honker, xid, rid, dt, url, audience, noise, convoy, whofore, format, precis, oonker, flags, plain from honks where convoy = ?", c) for rows.Next() { var honkid, userid int64 - var what, honker, xid, rid, dt, url, audience, noise, convoy string + var what, honker, xid, rid, dt, url, audience, noise, convoy, plain string var whofore int64 var format, precis, oonker string var flags int64 - scanordie(rows, &honkid, &userid, &what, &honker, &xid, &rid, &dt, &url, &audience, &noise, &convoy, &whofore, &format, &precis, &oonker, &flags) + scanordie(rows, &honkid, &userid, &what, &honker, &xid, &rid, &dt, &url, &audience, &noise, &convoy, &whofore, &format, &precis, &oonker, &flags, &plain) honkids[honkid] = true - doordie(tx, "insert into honks (honkid, userid, what, honker, xid, rid, dt, url, audience, noise, convoy, whofore, format, precis, oonker, flags) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", honkid, userid, what, honker, xid, rid, dt, url, audience, noise, convoy, whofore, format, precis, oonker, flags) + doordie(tx, "insert into honks (honkid, userid, what, honker, xid, rid, dt, url, audience, noise, convoy, whofore, format, precis, oonker, flags, plain) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", honkid, userid, what, honker, xid, rid, dt, url, audience, noise, convoy, whofore, format, precis, oonker, flags, plain) } rows.Close() } @@ -169,6 +170,7 @@ func svalbard(dirname string) { if err != nil { elog.Fatalf("can't open backup blob database") } + _, err = blob.Exec("PRAGMA journal_mode=WAL") doordie(blob, "create table filedata (xid text, media text, hash text, content blob)") doordie(blob, "create index idx_filexid on filedata(xid)") doordie(blob, "create index idx_filehash on filedata(hash)")