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

ignore generated columns when [recreateTable] #109

Merged
merged 6 commits into from Oct 8, 2022
Merged

ignore generated columns when [recreateTable] #109

merged 6 commits into from Oct 8, 2022

Conversation

zakaria-chahboun
Copy link
Contributor

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

What did this pull request do?

This pull request fix this issue:
go-gorm/gorm#5590

cannot INSERT into generated column

I just created another method for ddl called getSafeColumns. It did the exact work of getColumns except it ignore the GENERATED COLUMNS.

User Case Description

This is important for recreateTable of the Migrator.

// Old
columns := createDDL.getColumns()
// New
columns := createDDL.getSafeColumns()

@jinzhu
Copy link
Member

jinzhu commented Oct 7, 2022

Hi @zakaria-chahboun

Can you just update the getColumns method to this?

Thank you.

@jinzhu jinzhu merged commit 2573b11 into go-gorm:master Oct 8, 2022
@zakaria-chahboun
Copy link
Contributor Author

zakaria-chahboun commented Oct 9, 2022

You're welcome
what about the gorm-sqlite-cipher ?
It should also be updated with this solution

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