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

Updated Regexp to handle correctly string values #55

Merged
merged 1 commit into from Mar 17, 2022
Merged

Updated Regexp to handle correctly string values #55

merged 1 commit into from Mar 17, 2022

Conversation

Fulmineo64
Copy link

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

What did this pull request do?

A simple regexp adjustment to improve the handling of string default values.

User Case Description

Let's take as an example a column with a default value of C.

MSSQL would return this default value as ('C') when querying the schema.

With the old regexp the parsed field would be returned as C' (note the extra ' at the end), meaning that every column with a string default value would be updated every time the Automigration triggers.

Debugger result of the example

regex-error

The updated regex solves this issue

@jinzhu jinzhu merged commit 915f678 into go-gorm:master Mar 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

2 participants