GORM Playground Link

https://github.com/go-gorm/playground/pull/1

Description

type Student struct {
    Name    string     `gorm:"default:'abc';size:10;not null"`
    LastSync  time.Time  `gorm:"default:'1970-01-01 08:00:00+08';not null"`
}
 `name` varchar(10) NOT NULL DEFAULT '111',
 `last_sync` datetime DEFAULT CURRENT_TIMESTAMP,

When I create a record

db.Create(&Student{})

the debug sql like this, and there is no last_sync field.

INSERT INTO `student` (`name`) VALUES ('abc');

Why last_sync default 1970-01-01 08:00:00+08 is invalid in debug sql, but name default abc is valid ? How to set use go default value or use mysql default value only ?

Comment From: github-actions[bot]

The issue has been automatically marked as stale as it missing playground pull request link, which is important to help others understand your issue effectively and make sure the issue hasn't been fixed on latest master, checkout https://github.com/go-gorm/playground for details. it will be closed in 30 days if no further activity occurs. if you are asking question, please use the Question template, most likely your question already answered https://github.com/go-gorm/gorm/issues or described in the document https://gorm.io ✨ Search Before Asking