Files
sm-bm-plugin/models/tag.go
Jakub Zych 1046237771 feat: add the study data models and schema migrations
Courses, meetings, class sessions, deadlines, readings with per-user
progress, materials with tags and file attachments. Timestamps are
stored in UTC and held as Europe/Warsaw text so the admin text inputs
can write them.
2026-10-02 14:26:08 +02:00

29 lines
770 B
Go

// Code generated by summer make. DO NOT EDIT.
package models
import "time"
// Tag labels materials.
type Tag struct {
ID uint `gorm:"column:id;primaryKey"`
Name string `gorm:"column:name"`
Slug string `gorm:"column:slug"`
CreatedAt time.Time `gorm:"column:created_at"`
UpdatedAt time.Time `gorm:"column:updated_at"`
}
// TableName is the plugin table.
func (Tag) TableName() string { return "jz_bm_tags" }
// Fillable lists the columns mass assignment may set.
func (Tag) Fillable() []string { return []string{"name", "slug"} }
// Rules are checked by the admin API on every save.
func (Tag) Rules() map[string]string {
return map[string]string{
"name": "required|max:100",
"slug": "required|max:100|unique:jz_bm_tags",
}
}