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: quote index when creating table #5331

Merged
merged 1 commit into from May 17, 2022
Merged

fix: quote index when creating table #5331

merged 1 commit into from May 17, 2022

Conversation

black-06
Copy link
Contributor

@black-06 black-06 commented May 12, 2022

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

What did this pull request do?

quote index when creating table, just like CreateIndex

User Case Description

before

CREATE TABLE `quoted_index_structs` (
	`id` BIGINT UNSIGNED AUTO_INCREMENT,
	`name` VARCHAR ( 255 ),
	PRIMARY KEY ( `id` ),
  INDEX AS ( `name` ) 
)

after

CREATE TABLE `quoted_index_structs` (
	`id` BIGINT UNSIGNED AUTO_INCREMENT,
	`name` VARCHAR ( 255 ),
	PRIMARY KEY ( `id` ),
  INDEX `AS` ( `name` ) 
)

@jinzhu jinzhu merged commit f5e77aa into go-gorm:master May 17, 2022
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