Add CardCondition to database code
This commit is contained in:
parent
a6f1587612
commit
b7263a4bd6
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue