Use uuid.UUID everywhere and have postgres generate ids
This commit is contained in:
@ -4,22 +4,33 @@ package postgres
|
||||
|
||||
import (
|
||||
"database/sql"
|
||||
"time"
|
||||
|
||||
"github.com/google/uuid"
|
||||
)
|
||||
|
||||
type Budget struct {
|
||||
ID string
|
||||
Name string
|
||||
LastModification sql.NullTime
|
||||
ID uuid.UUID
|
||||
}
|
||||
|
||||
type Transaction struct {
|
||||
ID uuid.UUID
|
||||
BudgetID uuid.UUID
|
||||
Date time.Time
|
||||
Memo sql.NullString
|
||||
Amount string
|
||||
}
|
||||
|
||||
type User struct {
|
||||
ID string
|
||||
Email string
|
||||
Name string
|
||||
Password string
|
||||
ID uuid.UUID
|
||||
}
|
||||
|
||||
type UserBudget struct {
|
||||
UserID string
|
||||
BudgetID string
|
||||
UserID uuid.UUID
|
||||
BudgetID uuid.UUID
|
||||
}
|
||||
|
Reference in New Issue
Block a user