diff options
Diffstat (limited to '')
-rw-r--r-- | model/models.go | 31 |
1 files changed, 15 insertions, 16 deletions
diff --git a/model/models.go b/model/models.go index be09076..eba1207 100644 --- a/model/models.go +++ b/model/models.go @@ -5,36 +5,35 @@ package model import ( - "database/sql" - "time" + "github.com/jackc/pgx/v5/pgtype" ) type Category struct { ID int32 Name string - ParentID sql.NullInt32 + ParentID pgtype.Int4 UserID int32 } type ConstExpense struct { ID int32 - Description sql.NullString - Expense string - Months uint8 - Start time.Time - End time.Time - PrevID sql.NullInt32 + Description pgtype.Text + Expense pgtype.Numeric + Months int16 + Start pgtype.Date + End pgtype.Date + PrevID pgtype.Int4 CategoryID int32 UserID int32 } type SingleExpense struct { - ID int32 - Description sql.NullString - Expense string - Year uint16 - Month uint8 - Day uint8 + ID int64 + Description pgtype.Text + Expense pgtype.Numeric + Year int16 + Month int16 + Day int16 CategoryID int32 UserID int32 } @@ -43,5 +42,5 @@ type User struct { ID int32 Name string Pwd string - Description sql.NullString + Description pgtype.Text } |