Skip to content

Commit

Permalink
Remove autoCreateTime and autoUpdateTime
Browse files Browse the repository at this point in the history
  • Loading branch information
moyomogi committed Oct 7, 2023
1 parent 4ad0dc8 commit 007143c
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 16 deletions.
4 changes: 2 additions & 2 deletions domain/domain_article.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ import (
// https://zenn.dev/skanehira/articles/2020-09-19-go-echo-bind-tips
type Article struct {
ID uuid.UUID `gorm:"type:char(36);primary_key;not null" param:"id" json:"id"`
CreatedAt time.Time `gorm:"type:char(6);autoCreateTime" json:"created_at"`
UpdatedAt time.Time `gorm:"type:char(6);autoUpdateTime" json:"updated_at"`
CreatedAt time.Time `gorm:"type:char(6)" json:"created_at"`
UpdatedAt time.Time `gorm:"type:char(6)" json:"updated_at"`
EventId string `gorm:"type:char(36);not null" validate:"required" json:"event_id"`
Title string `gorm:"type:text" validate:"required" json:"title"`
Body string `gorm:"type:text" validate:"required" json:"body"`
Expand Down
4 changes: 2 additions & 2 deletions domain/domain_article_comment.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import (

type ArticleComment struct {
ID uuid.UUID `gorm:"type:char(36);primaryKey;not null" json:"id"`
CreatedAt time.Time `gorm:"type:char(6);autoCreateTime" json:"created_at"`
UpdatedAt time.Time `gorm:"type:char(6);autoUpdateTime" json:"updated_at"`
CreatedAt time.Time `gorm:"type:char(6)" json:"created_at"`
UpdatedAt time.Time `gorm:"type:char(6)" json:"updated_at"`
ArticleID uuid.UUID `gorm:"type:char(36);not null" json:"article_id"`
Body string `gorm:"type:text" validate:"required" json:"body"`
Rate int `validate:"required,gte=1,lte=5" json:"rate"` // 1-5
Expand Down
4 changes: 2 additions & 2 deletions domain/domain_article_game_content.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import (
type ArticleGameContent struct {
// ArticleID
ID uuid.UUID `gorm:"type:char(36);primaryKey;not null" json:"id"`
CreatedAt time.Time `gorm:"type:char(6);autoCreateTime" json:"created_at"`
UpdatedAt time.Time `gorm:"type:char(6);autoUpdateTime" json:"updated_at"`
CreatedAt time.Time `gorm:"type:char(6)" json:"created_at"`
UpdatedAt time.Time `gorm:"type:char(6)" json:"updated_at"`
ExecPath string `gorm:"type:text" validate:"required" json:"exec_path"`
ZipURL string `gorm:"type:text" validate:"required" json:"zip_url"`
}
Expand Down
4 changes: 2 additions & 2 deletions domain/domain_user.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import (

type User struct {
ID uuid.UUID `gorm:"type:char(36);primary_key;not null" json:"id"`
CreatedAt time.Time `gorm:"type:char(6);autoCreateTime" json:"created_at"`
UpdatedAt time.Time `gorm:"type:char(6);autoUpdateTime" json:"updated_at"`
CreatedAt time.Time `gorm:"type:char(6)" json:"created_at"`
UpdatedAt time.Time `gorm:"type:char(6)" json:"updated_at"`
GoogleID string `gorm:"type:char(28);not null" json:"google_id"`
Role string `gorm:"type:text" validate:"required" json:"role"`
Name string `gorm:"type:text" validate:"required" json:"name"`
Expand Down
16 changes: 8 additions & 8 deletions migration/version/v20230830.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ func (*v20230830ArticleNewColumn) TableName() string {

type v20230830ArticleComment struct {
ID uuid.UUID `gorm:"type:char(36);primaryKey;not null" json:"id"`
CreatedAt time.Time `gorm:"type:char(6);autoCreateTime" json:"created_at"`
UpdatedAt time.Time `gorm:"type:char(6);autoUpdateTime" json:"updated_at"`
CreatedAt time.Time `gorm:"type:char(6)" json:"created_at"`
UpdatedAt time.Time `gorm:"type:char(6)" json:"updated_at"`
ArticleID uuid.UUID `gorm:"type:char(36);not null" json:"article_id"`
Body string `gorm:"type:text" validate:"required" json:"body"`
Rate int `validate:"required,gte=1,lte=5" json:"rate"` // 1-5
Expand All @@ -30,8 +30,8 @@ func (*v20230830ArticleComment) TableName() string {
type v20230830ArticleGameContent struct {
// ArticleID
ID uuid.UUID `gorm:"type:char(36);primaryKey;not null" json:"id"`
CreatedAt time.Time `gorm:"type:char(6);autoCreateTime" json:"created_at"`
UpdatedAt time.Time `gorm:"type:char(6);autoUpdateTime" json:"updated_at"`
CreatedAt time.Time `gorm:"type:char(6)" json:"created_at"`
UpdatedAt time.Time `gorm:"type:char(6)" json:"updated_at"`
ExecPath string `gorm:"type:text" validate:"required" json:"exec_path"`
ZipURL string `gorm:"type:text" validate:"required" json:"zip_url"`
}
Expand Down Expand Up @@ -71,8 +71,8 @@ func (*v20230830ArticleTag) TableName() string {

type v20230830Article struct {
ID uuid.UUID `gorm:"type:char(36);primary_key;not null" param:"id" json:"id"`
CreatedAt time.Time `gorm:"type:char(6);autoCreateTime" json:"created_at"`
UpdatedAt time.Time `gorm:"type:char(6);autoUpdateTime" json:"updated_at"`
CreatedAt time.Time `gorm:"type:char(6)" json:"created_at"`
UpdatedAt time.Time `gorm:"type:char(6)" json:"updated_at"`
EventId string `gorm:"type:char(36);not null" validate:"required" json:"event_id"`
Title string `gorm:"type:text" validate:"required" json:"title"`
Body string `gorm:"type:text" validate:"required" json:"body"`
Expand All @@ -94,8 +94,8 @@ func (*v20230830Article) TableName() string {

type v20230830User struct {
ID uuid.UUID `gorm:"type:char(36);primary_key;not null" json:"id"`
CreatedAt time.Time `gorm:"type:char(6);autoCreateTime" json:"created_at"`
UpdatedAt time.Time `gorm:"type:char(6);autoUpdateTime" json:"updated_at"`
CreatedAt time.Time `gorm:"type:char(6)" json:"created_at"`
UpdatedAt time.Time `gorm:"type:char(6)" json:"updated_at"`
GoogleID string `gorm:"type:char(28);not null" json:"google_id"`
Role string `gorm:"type:text" validate:"required" json:"role"`
Name string `gorm:"type:text" validate:"required" json:"name"`
Expand Down

0 comments on commit 007143c

Please sign in to comment.