-
-
Notifications
You must be signed in to change notification settings - Fork 185
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
distinguish between schema.Time and tag time #133
Conversation
|
Before v1.5.0 , https://github.com/go-gorm/gorm/blob/e9637024d3780dba4de755e6f5879150f43e8390/tests/serializer_test.go#L25` Now it will be I suggest specifying CreatedTime int64 `gorm:"serializer:unixtime;type:datetime"` // store time in db, use int as field type If you want forward compatibility, don't upgrade 1.5.0 for now. At present, the sqlite3 has been fixed but no new version has been released. |
I've already tried, but then another problem came up. postgres won't support https://github.com/go-gorm/gorm/actions/runs/4676407423/jobs/8282677859#step:6:1512 |
umm... but why is it still 1.4.4 in go.mod but your mr uses 1.5.0... Or we split this test? |
Due to the utilization of the I have considered spliting it, but I don't believe it to be a viable solution. |
But we do want to use the type given by the user. |
It is ok for me to separate this test. When the user specifies the type through the tag, it must be guaranteed to work in the corresponding database. We do not need to check whether the type is legal, because from the current use, the user not only specifies the type through the tag type, and many other attributes (like a hack but allowed because we can't support all attributes). |
Having type `time` causes timestamps to be returned as strings rather than the intended `time.Time` in our serializer. go-gorm/sqlite#133 (comment)
What did this pull request do?
fix go-gorm/gorm#6033
User Case Description