My model in Go is:
type Sales_Daily_db struct {
Nation_shipping string
Date datatypes.Date
Impressions int `gorm:"type:integer;"`
Clicks int `gorm:"type:integer;"`
Cost float32
ATB float32
OKL float32
}
When running AutoMigrate() using the above model, I want the impressions and clicks columns in pSQL database to be of type integer. However, even with those gorm tags, they still ended up as type int4. I have tried int2 int4 int8 manually with the tags above, and they all worked accordingly. Additionally, when I try int tag, they are forced into int8. How to fix this behavior and get integer type specifially in pSQL?
Edit: I am using DBeaver to look at the database.
integeris an alias forint4in Postgres - both are exactly the same thing.