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/gdb_model_soft_time: fix soft-time support fieldType:LocalTypeUint64 in Insert/Update perations #3551

Merged
merged 1 commit into from
Apr 29, 2024

Conversation

muddydog
Copy link
Contributor

当数据库(mysql)表结构定义类似:

CREATE TABLE `example`
(
    `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT 'ID',
    `created_at`  bigint(20) unsigned NOT NULL DEFAULT 0 COMMENT 'created timestamp',
    `updated_at` bigint(20) unsigned NOT NULL DEFAULT 0 COMMENT 'latest updated timestamp',
    PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

gf框架会将created_at与updated_at识别为soft-time可自动填充的字段,同时字段类型会被识别为:LocalTypeUint64。

但是在insert和update操作自动填充字段值的时候,不支持 LocalTypeUint64 类型的自动填充。

本PR补全了 LocalTypeUint64 类型的默认值填充逻辑。

@gqcn gqcn changed the title database/gdb/gdb_model_soft_time: soft-time should support fieldType:LocalTypeUint64 database/gdb/gdb_model_soft_time: fix soft-time support fieldType:LocalTypeUint64 in Insert/Update perations Apr 29, 2024
@gqcn gqcn merged commit 9aa426a into gogf:master Apr 29, 2024
23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants