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: fix migrator recognizing nextval('"table_column_seq"'::regclass) #304

Merged
merged 1 commit into from
Mar 26, 2025

Conversation

ifrvn
Copy link
Contributor

@ifrvn ifrvn commented Mar 14, 2025

  • Do only one thing
  • Non breaking API changes
  • Tested

What did this pull request do?

Using SERIAL to create an auto-incrementing integer column will set the default value as nextval('"table_column_seq"'::regclass) which contains double quotes. Current codes only check cases without double quotes. This PR should fix the problem.

User Case Description

CREATE TABLE public."User" (
	id serial NOT NULL,
	CONSTRAINT user_pk PRIMARY KEY (id)
);

The default value of the id column would be nextval('"User_id_seq"'::regclass)

Related issue go-gorm/gen#1272

@jinzhu jinzhu merged commit 84224ec into go-gorm:master Mar 26, 2025
1 check 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.

2 participants