feat(budget): rename description to name
All checks were successful
Build and Push Docker Image / Build-And-Push-Docker-Image (push) Successful in 1m25s
All checks were successful
Build and Push Docker Image / Build-And-Push-Docker-Image (push) Successful in 1m25s
This commit is contained in:
@@ -27,9 +27,9 @@ func NewDbSqlite(db *sqlx.DB) *DbSqlite {
|
||||
|
||||
func (db DbSqlite) Insert(ctx context.Context, budget Budget) (*Budget, error) {
|
||||
r, err := db.db.ExecContext(ctx, `
|
||||
INSERT INTO budget (id, user_id, description, value, created_at, created_by, updated_at, updated_by)
|
||||
INSERT INTO budget (id, user_id, name, value, created_at, created_by, updated_at, updated_by)
|
||||
VALUES (?, ?, ?, ?, ?, ?, ?, ?)`,
|
||||
budget.Id, budget.UserId, budget.Description, budget.Value, budget.CreatedAt, budget.CreatedBy, budget.UpdatedAt, budget.UpdatedBy,
|
||||
budget.Id, budget.UserId, budget.Name, budget.Value, budget.CreatedAt, budget.CreatedBy, budget.UpdatedAt, budget.UpdatedBy,
|
||||
)
|
||||
err = core.TransformAndLogDbError(ctx, "budget", r, err)
|
||||
if err != nil {
|
||||
@@ -42,13 +42,13 @@ func (db DbSqlite) Insert(ctx context.Context, budget Budget) (*Budget, error) {
|
||||
func (db DbSqlite) Update(ctx context.Context, budget Budget) (*Budget, error) {
|
||||
_, err := db.db.ExecContext(ctx, `
|
||||
UPDATE budget
|
||||
SET description = ?,
|
||||
SET name = ?,
|
||||
value = ?,
|
||||
updated_at = ?,
|
||||
updated_by = ?
|
||||
WHERE user_id = ?
|
||||
AND id = ?`,
|
||||
budget.Description, budget.Value, budget.UpdatedAt, budget.UpdatedBy, budget.UserId, budget.Id)
|
||||
budget.Name, budget.Value, budget.UpdatedAt, budget.UpdatedBy, budget.UserId, budget.Id)
|
||||
|
||||
if err != nil {
|
||||
slog.ErrorContext(ctx, "SQL error UpdateUser", "err", err)
|
||||
|
||||
Reference in New Issue
Block a user