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

fix: primary key unique key simultaneously exist cacheIdPrefix duplicate #3763

Merged
merged 1 commit into from
Dec 11, 2023

Conversation

testwill
Copy link
Contributor

@testwill testwill commented Dec 7, 2023

CREATE TABLE k8s_api_events (
id int NOT NULL AUTO_INCREMENT,
create_at timestamp NULL DEFAULT CURRENT_TIMESTAMP,
status int DEFAULT '0',
operate int DEFAULT '0',
PRIMARY KEY (id),
UNIQUE KEY id_UNIQUE (id),
KEY gid_idx (gid),
KEY rid_idx (rule_id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

goctl model mysql ddl -c
result:

var (
k8sApiEventsFieldNames = builder.RawFieldNames(&K8sApiEvents{})
k8sApiEventsRows = strings.Join(k8sApiEventsFieldNames, ",")
k8sApiEventsRowsExpectAutoSet = strings.Join(stringx.Remove(k8sApiEventsFieldNames, "id", "create_at", "create_time", "created_at", "update_at", "update_time", "updated_at"), ",")
k8sApiEventsRowsWithPlaceHolder = strings.Join(stringx.Remove(k8sApiEventsFieldNames, "id", "create_at", "create_time", "created_at", "update_at", "update_time", "updated_at"), "=?,") + "=?"

    cacheK8sApiEventsIdPrefix = "cache:k8sApiEvents:id:"
    cacheK8sApiEventsIdPrefix = "cache:k8sApiEvents:id:"

)

@kevwan kevwan force-pushed the goctl branch 2 times, most recently from cd4b656 to f60847f Compare December 9, 2023 14:54
Copy link
Collaborator

@kesonan kesonan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Signed-off-by: guoguangwu <guoguangwu@magic-shield.com>
@kevwan kevwan merged commit 05020a9 into zeromicro:master Dec 11, 2023
@testwill testwill deleted the goctl branch December 12, 2023 00:40
WqyJh pushed a commit to WqyJh/go-zero that referenced this pull request Dec 21, 2023
…ate (zeromicro#3763)

Signed-off-by: guoguangwu <guoguangwu@magic-shield.com>
dongmeng199 pushed a commit to dongmeng199/go-zero that referenced this pull request Dec 24, 2023
…ate (zeromicro#3763)

Signed-off-by: guoguangwu <guoguangwu@magic-shield.com>
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

3 participants