Skip to content

unsupported data type: &[], a model can't be migrated #149

Answered by oxisto
raliqala asked this question in Q&A
Discussion options

You must be logged in to vote

I was able to reproduce this. This is tricky, the error is produced because of the new type jwt.ClaimsStrings, which is necessary because aud can either be a string or an array of strings (according to the JWT spec). This was incorrectly handled in our previous claims struct. The problem is, that the postgres driver cannot handle a structure which contains an array on its own. What I recommend would be to store the claims as a string rather than a struct in the database. Alternatively, there might be a way to configure/override the way gorm migrates the model using a custom function.

Beware, that storing any kind of credentials (and claims are credentials) on a database or other "persiste…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@raliqala
Comment options

Answer selected by raliqala
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants