Ver código fonte

重命名文件并更新模型定义

将 `src/database/module.go` 重命名为 `src/database/model.go`,并移除了 `CreatedAt` 和 `UpdatedAt` 字段的 `primarykey` 标签。
SongZihuan 2 meses atrás
pai
commit
0d90130e5e
1 arquivos alterados com 2 adições e 2 exclusões
  1. 2 2
      src/database/model.go

+ 2 - 2
src/database/module.go → src/database/model.go

@@ -8,8 +8,8 @@ import (
 // Model gorm.Model的仿写,明确了键名
 type Model struct {
 	ID        uint           `gorm:"column:id;primarykey"`
-	CreatedAt time.Time      `gorm:"column:created_at;autoCreateTime;primarykey"`
-	UpdatedAt time.Time      `gorm:"column:updated_at;autoUpdateTime;primarykey"`
+	CreatedAt time.Time      `gorm:"column:created_at;autoCreateTime"`
+	UpdatedAt time.Time      `gorm:"column:updated_at;autoUpdateTime"`
 	DeletedAt gorm.DeletedAt `gorm:"column:deleted_at;index"`
 }