Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

database/gdb: FieldsEx feature conflicts with soft time feature in soft time fields updating #3754

Closed
chaseSpace opened this issue Sep 3, 2024 · 2 comments · Fixed by #3773
Assignees
Labels
bug It is confirmed a bug, but don't worry, we'll handle it. done This issue is done, which may be release in next version.

Comments

@chaseSpace
Copy link

chaseSpace commented Sep 3, 2024

Go version

1.21.12

GoFrame version

v2.7.2

Can this bug be reproduced with the latest release?

Option Yes

What did you do?

Snippet: dao.XXX.GetDB(ctx).Where("id", id).FieldsEx("updated_at").Update(XXXObj);

What did you see happen?

This operation will continue to update the updated_at field with value of object. Is this behavior what the designer intended? I suspect it might not be, and I also don't think it's a good idea. Because this behavior is certainly an unexpected for developer. All right, i have to query docs to find a reasonable statement from administrtor, this is not a good experience.

Note that the Unscope API is not under discussion here.

What did you expect to see?

If developer called FieldsEx API to exclude updated_at fields or any other, which all should not be continue to controll with select/save/update operation.

@chaseSpace chaseSpace added the bug It is confirmed a bug, but don't worry, we'll handle it. label Sep 3, 2024
@gqcn gqcn self-assigned this Sep 13, 2024
@gqcn
Copy link
Member

gqcn commented Sep 13, 2024

Interesting! Let me have a little check.

gqcn added a commit that referenced this issue Sep 13, 2024
@gqcn gqcn changed the title gogf/gf/v2/database/gdb: the auto update of updated_at` should not conflict with FieldsEx API database/gdb: FieldsEx feature conflicts with soft time feature in soft time fields updating Sep 13, 2024
@gqcn gqcn added the done This issue is done, which may be release in next version. label Sep 13, 2024
@gqcn gqcn closed this as completed Sep 13, 2024
@chaseSpace
Copy link
Author

Nice!

gqcn added a commit that referenced this issue Sep 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug It is confirmed a bug, but don't worry, we'll handle it. done This issue is done, which may be release in next version.
Projects
None yet
2 participants