You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you have a model with custom type and you create the table using NewCreateTable().Model() the type created in the db will be for type of the property rather than the underlying type that is produced.
it will create the column with the type for a struct. This is fine when you're using sqllite as the underlying type is a string, but when you switch over to postgres the underlying type is jsonb. Which leads to a serialisation failure.
Currently (as best as I can tell) the only option is to use annotations of the model to specify the db type.
Would it be possible to extend the custom types to be able support something like:
If you have a model with custom type and you create the table using
NewCreateTable().Model()
the type created in the db will be for type of the property rather than the underlying type that is produced.e.g
And when I do the following:
it will create the column with the type for a struct. This is fine when you're using sqllite as the underlying type is a string, but when you switch over to postgres the underlying type is jsonb. Which leads to a serialisation failure.
Currently (as best as I can tell) the only option is to use annotations of the model to specify the db type.
Would it be possible to extend the custom types to be able support something like:
or perhaps to be able to register a specific mapping for migrations?
Happy to take a stab at implementing. thoughts?
The text was updated successfully, but these errors were encountered: