Use table name constant in Cols for type safety

This commit is contained in:
2026-03-29 15:29:39 +02:00
parent 0cfddddccb
commit a53e24c5b8
315 changed files with 13092 additions and 5 deletions

View File

@@ -0,0 +1,37 @@
// Code generated by gorm.io/gen. DO NOT EDIT.
// Code generated by gorm.io/gen. DO NOT EDIT.
// Code generated by gorm.io/gen. DO NOT EDIT.
package dbmodel
import "git.ma-al.com/goc_marek/gormcol"
const TableNamePsAttachment = "ps_attachment"
// PsAttachment mapped from table <ps_attachment>
type PsAttachment struct {
IDAttachment int32 `gorm:"column:id_attachment;primaryKey;autoIncrement:true" json:"id_attachment"`
File string `gorm:"column:file;not null" json:"file"`
FileName string `gorm:"column:file_name;not null" json:"file_name"`
FileSize int64 `gorm:"column:file_size;not null" json:"file_size"`
Mime string `gorm:"column:mime;not null" json:"mime"`
}
// TableName PsAttachment's table name
func (*PsAttachment) TableName() string {
return TableNamePsAttachment
}
var PsAttachmentCols = struct {
IDAttachment gormcol.Field
File gormcol.Field
FileName gormcol.Field
FileSize gormcol.Field
Mime gormcol.Field
}{
IDAttachment: gormcol.Field{Table: TableNamePsAttachment, Column: "id_attachment"},
File: gormcol.Field{Table: TableNamePsAttachment, Column: "file"},
FileName: gormcol.Field{Table: TableNamePsAttachment, Column: "file_name"},
FileSize: gormcol.Field{Table: TableNamePsAttachment, Column: "file_size"},
Mime: gormcol.Field{Table: TableNamePsAttachment, Column: "mime"},
}