diff --git a/sevenkeys/cli/mainui.go b/sevenkeys/cli/mainui.go index 94a0a9f..fa25038 100644 --- a/sevenkeys/cli/mainui.go +++ b/sevenkeys/cli/mainui.go @@ -112,7 +112,7 @@ func MainCliLoop(db *sql.DB) { if todo == "r" { logic.RemoveFromStorage(db, location) } else if todo == "n" { - continue + break } else { fmt.Printf("Unrecognized option: %s\n", todo) } diff --git a/sevenkeys/database/remove.go b/sevenkeys/database/remove.go index 5af37cd..5d64d93 100644 --- a/sevenkeys/database/remove.go +++ b/sevenkeys/database/remove.go @@ -3,7 +3,7 @@ package database import "database/sql" func RemoveFromBinder(db *sql.DB, location LocateCardResult) error { - query := `UPDATE CardStorageLocation SET CardPrintingId = NULL WHERE Id = ?;` + query := `UPDATE CardLocation SET CardPrintingId = NULL WHERE Id = ?;` update, err := db.Prepare(query) defer update.Close() @@ -20,7 +20,7 @@ func RemoveFromBinder(db *sql.DB, location LocateCardResult) error { } func RemoveFromBox(db *sql.DB, location LocateCardResult) error { - deleteQuery := `DELETE FROM CardStorageLocation WHERE Id = ?;` + deleteQuery := `DELETE FROM CardLocation WHERE Id = ?;` del, err := db.Prepare(deleteQuery) defer del.Close() @@ -33,7 +33,7 @@ func RemoveFromBox(db *sql.DB, location LocateCardResult) error { return err } - updateQuery := `UPDATE CardStorageLocation SET Position = Position - 1 WHERE Position > ? AND StorageAreaId = ?;` + updateQuery := `UPDATE CardLocation SET Position = Position - 1 WHERE Position > ? AND StorageAreaId = ?;` update, err := db.Prepare(updateQuery) defer update.Close()