<commit_before>package model

import (
	"time"

	_ "github.com/jinzhu/gorm/dialects/mysql"
)

type User struct {
	UserID         string `gorm:"primary_key" json:"user_id"`
	Token         string `gorm:"unique" json:"token"`
	Name          string `gorm:"unique" json:"name"`
	AvatarURL        string `gorm:"avatar" json:"avatar_url"`
	CreatedAt     time.Time `json:"created_at"`
	UpdatedAt     time.Time `json:"updated_at"`
	DeletedAt     *time.Time `sql:"index" json:"deleted_at`
	CreatedEvents []Event `gorm:"ForeignKey:OwnerID" json:"created_events"`
	JoinedEvents  []Event `gorm:"many2many:user_joined_events"`
}

type Category struct {
	ID     uint `gorm:"primary_key" json:"id"`
	Title  string `gorm:"not null;unique" json:"title"`
	Events []Event `gorm:"ForeignKey:CategoryID" json:"related_events"`
}

type Place struct {
	PlaceTitle     string `json:"place_title"`
	PlaceLatitude  float64 `json:"place_lat"`
	PlaceLongitude float64 `json:"place_lon"`
}

type Datetime struct {
	DateStart *time.Time `json:"datetime_start"`
	DateEnd   *time.Time `json:"datetime_end"`
}

type Event struct {
	ID          uint `gorm:"primary_key" json:"id"`
	CreatedAt   time.Time `json:"created_at"`
	UpdatedAt   time.Time `json:"updated_at"`
	DeletedAt   *time.Time `sql:"index" json:"deleted_at`
	Place
	Datetime
	Title       string `gorm:"not null" json:"event_title"`
	Description string `json:"description"`
	OwnerToken  string `json:"-"`
	CategoryID  uint `json:"category_id"`
	Comments    []Comment `gorm:"ForeignKey:EventID" json:"comments"`
}

type Comment struct {
	ID          uint `gorm:"primary_key" json:"id"`
	Content     string `json:"content"`
	WriterToken string `json:"-"`
	EventID     uint `json:"event_id"`
}<commit_msg>Update the models<commit_after>package model

import (
	"time"

	_ "github.com/jinzhu/gorm/dialects/mysql"
)

type User struct {
	UserID        string `gorm:"primary_key" json:"user_id"`
	Token         string `gorm:"unique" json:"token"`
	Name          string `gorm:"unique" json:"name"`
	AvatarURL     string `gorm:"avatar" json:"avatar_url"`
	CreatedAt     *time.Time `json:"created_at"`
	UpdatedAt     *time.Time `json:"updated_at"`
	CreatedEvents []Event `gorm:"ForeignKey:OwnerToken" json:"created_events"`
	JoinedEvents  []Event `gorm:"many2many:user_joined_events"`
}

type Category struct {
	ID     uint `gorm:"primary_key" json:"id"`
	Title  string `gorm:"not null;unique" json:"title"`
	Events []Event `gorm:"ForeignKey:CategoryID" json:"related_events"`
}

type Place struct {
	PlaceTitle     string `json:"place_title"`
	PlaceLatitude  float64 `json:"place_lat"`
	PlaceLongitude float64 `json:"place_lon"`
}

type Datetime struct {
	DateStart *time.Time `json:"datetime_start"`
	DateEnd   *time.Time `json:"datetime_end"`
}

type Event struct {
	ID           uint `gorm:"primary_key" json:"id"`
	Title        string `gorm:"not null" json:"title"`
	Description  string `json:"description"`
	Place
	Datetime
	CategoryID   uint `json:"category_id"`
	OwnerToken   string `json:"-"`
	CreatedAt    *time.Time `json:"created_at"`
	UpdatedAt    *time.Time `json:"updated_at"`
	Participants []User `gorm:"many2many:user_joined_events json:"participants"`
	Comments     []Comment `gorm:"ForeignKey:EventID" json:"comments"`
}

type Comment struct {
	ID          uint `gorm:"primary_key" json:"id"`
	Content     string `json:"content"`
	EventID     uint `json:"event_id"`
	WriterToken string `json:"-"`
	CreatedAt   *time.Time `json:"created_at"`
	UpdatedAt   *time.Time `json:"updated_at"`
}
{'fraction_non_alphanumeric': 0.14078910019869428, 'fraction_numerical': 0.003122338915696849, 'mean_word_length': 4.758169934640523, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6155663', 'n_tokens_mistral': 1197, 'n_tokens_neox': 1186, 'n_words': 266}