Add CardCondition to database code

This commit is contained in:
The Magician 2024-06-11 16:13:42 +01:00
parent a6f1587612
commit b7263a4bd6
1 changed files with 4 additions and 3 deletions

View File

@ -7,6 +7,7 @@ import (
type CardStorageLocation struct {
Id int
CardPrintingId string
CardCondition string
StorageBox string
Position int
Source string
@ -29,15 +30,15 @@ func GetLastPositionInBox(db *sql.DB, storageBox string) (int, error) {
func InsertCardStorageLocation(db *sql.DB, storageLocation CardStorageLocation) error {
query := `INSERT INTO CardStorageLocation
(CardPrintingId, StorageBox, Position, Source)
VALUES (?, ?, ?, ?);`
(CardPrintingId, CardCondition, StorageBox, Position, Source)
VALUES (?, ?, ?, ?, ?);`
insert, err := db.Prepare(query)
if err != nil {
return err
}
_, err = insert.Exec(storageLocation.CardPrintingId, storageLocation.StorageBox, storageLocation.Position, storageLocation.Source)
_, err = insert.Exec(storageLocation.CardPrintingId, storageLocation.CardCondition, storageLocation.StorageBox, storageLocation.Position, storageLocation.Source)
if err != nil {
return err
}