Add CardCondition to database code
This commit is contained in:
parent
a6f1587612
commit
b7263a4bd6
|
@ -7,6 +7,7 @@ import (
|
||||||
type CardStorageLocation struct {
|
type CardStorageLocation struct {
|
||||||
Id int
|
Id int
|
||||||
CardPrintingId string
|
CardPrintingId string
|
||||||
|
CardCondition string
|
||||||
StorageBox string
|
StorageBox string
|
||||||
Position int
|
Position int
|
||||||
Source string
|
Source string
|
||||||
|
@ -29,15 +30,15 @@ func GetLastPositionInBox(db *sql.DB, storageBox string) (int, error) {
|
||||||
|
|
||||||
func InsertCardStorageLocation(db *sql.DB, storageLocation CardStorageLocation) error {
|
func InsertCardStorageLocation(db *sql.DB, storageLocation CardStorageLocation) error {
|
||||||
query := `INSERT INTO CardStorageLocation
|
query := `INSERT INTO CardStorageLocation
|
||||||
(CardPrintingId, StorageBox, Position, Source)
|
(CardPrintingId, CardCondition, StorageBox, Position, Source)
|
||||||
VALUES (?, ?, ?, ?);`
|
VALUES (?, ?, ?, ?, ?);`
|
||||||
|
|
||||||
insert, err := db.Prepare(query)
|
insert, err := db.Prepare(query)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
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 {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue