skip to Main Content

Postgresql – Gorm NOT NULL constraints STILL PASSES FOR NULL values in the database Golang

In my struct, i have the following type Task struct { gorm.Model Id int `json:"id" gorm:"primaryKey;AUTO_INCREMENT"` UserId int `json:"user_id" gorm:"Index;not null" validate:"required"` TaskId int `json:"task_id" gorm:"Index;not null" validate:"required"` JobId int `json:"job_id" gorm:"not null" validate:"required"` Latitude float64 `json:"latitude" gorm:"not null" validate:"required"`…

VIEW QUESTION
Back To Top
Search