UpdateUUID updates the uuid of a book
(db *DB, newUUID string)
| 140 | |
| 141 | // UpdateUUID updates the uuid of a book |
| 142 | func (b *Book) UpdateUUID(db *DB, newUUID string) error { |
| 143 | _, err := db.Exec("UPDATE books SET uuid = ? WHERE uuid = ?", newUUID, b.UUID) |
| 144 | |
| 145 | if err != nil { |
| 146 | return errors.Wrapf(err, "updating book uuid from '%s' to '%s'", b.UUID, newUUID) |
| 147 | } |
| 148 | |
| 149 | b.UUID = newUUID |
| 150 | |
| 151 | return nil |
| 152 | } |
| 153 | |
| 154 | // Expunge hard-deletes the book from the database |
| 155 | func (b Book) Expunge(db *DB) error { |