@@ -20,6 +20,7 @@ type model struct {
2020 Id sql.NullInt64 `db:"id"`
2121
2222 Owner string `db:"owner"`
23+ Platform int `db:"platform"`
2324 Currency string `db:"currency"`
2425 Amount float64 `db:"amount"`
2526 Nonce uuid.UUID `db:"nonce"`
@@ -34,6 +35,7 @@ func toModel(obj *onramp.Record) (*model, error) {
3435
3536 return & model {
3637 Owner : obj .Owner ,
38+ Platform : obj .Platform ,
3739 Currency : obj .Currency ,
3840 Amount : obj .Amount ,
3941 Nonce : obj .Nonce ,
@@ -45,6 +47,7 @@ func fromModel(obj *model) *onramp.Record {
4547 return & onramp.Record {
4648 Id : uint64 (obj .Id .Int64 ),
4749 Owner : obj .Owner ,
50+ Platform : obj .Platform ,
4851 Currency : obj .Currency ,
4952 Amount : obj .Amount ,
5053 Nonce : obj .Nonce ,
@@ -55,9 +58,9 @@ func fromModel(obj *model) *onramp.Record {
5558func (m * model ) dbPut (ctx context.Context , db * sqlx.DB ) error {
5659 return pgutil .ExecuteInTx (ctx , db , sql .LevelDefault , func (tx * sqlx.Tx ) error {
5760 query := `INSERT INTO ` + tableName + `
58- (owner, currency, amount, nonce, created_at)
59- VALUES ($1, $2, $3, $4, $5)
60- RETURNING id, owner, currency, amount, nonce, created_at`
61+ (owner, platform, currency, amount, nonce, created_at)
62+ VALUES ($1, $2, $3, $4, $5, $6 )
63+ RETURNING id, owner, platform, currency, amount, nonce, created_at`
6164
6265 if m .CreatedAt .IsZero () {
6366 m .CreatedAt = time .Now ()
@@ -67,6 +70,7 @@ func (m *model) dbPut(ctx context.Context, db *sqlx.DB) error {
6770 ctx ,
6871 query ,
6972 m .Owner ,
73+ m .Platform ,
7074 m .Currency ,
7175 m .Amount ,
7276 m .Nonce ,
@@ -81,7 +85,7 @@ func dbGet(ctx context.Context, db *sqlx.DB, nonce uuid.UUID) (*model, error) {
8185 res := & model {}
8286
8387 query := `SELECT
84- id, owner, currency, amount, nonce, created_at
88+ id, owner, platform, currency, amount, nonce, created_at
8589 FROM ` + tableName + `
8690 WHERE nonce = $1
8791 LIMIT 1`
0 commit comments