securities: Don't use 'precision', a MySQL reserved word, in DB

This commit is contained in:
Aaron Lindsay 2017-11-21 05:30:18 -05:00
parent be0d9051d4
commit 4d0b33efee
1 changed files with 2 additions and 2 deletions

View File

@ -38,7 +38,7 @@ type Security struct {
Symbol string
// Number of decimal digits (to the right of the decimal point) this
// security is precise to
Precision int
Precision int `db:"Preciseness"`
Type SecurityType
// AlternateId is CUSIP for Type=Stock, ISO4217 for Type=Currency
AlternateId string
@ -206,7 +206,7 @@ func ImportGetCreateSecurity(tx *Tx, userid int64, security *Security) (*Securit
var securities []*Security
_, err := tx.Select(&securities, "SELECT * from securities where UserId=? AND Type=? AND AlternateId=? AND Precision=?", userid, security.Type, security.AlternateId, security.Precision)
_, err := tx.Select(&securities, "SELECT * from securities where UserId=? AND Type=? AND AlternateId=? AND Preciseness=?", userid, security.Type, security.AlternateId, security.Precision)
if err != nil {
return nil, err
}