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,46 @@
// 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 TableNamePsCurrency = "ps_currency"
// PsCurrency mapped from table <ps_currency>
type PsCurrency struct {
IDCurrency int32 `gorm:"column:id_currency;primaryKey;autoIncrement:true" json:"id_currency"`
Name string `gorm:"column:name;not null" json:"name"`
IsoCode string `gorm:"column:iso_code;not null;index:currency_iso_code,priority:1;default:0" json:"iso_code"`
NumericIsoCode *string `gorm:"column:numeric_iso_code" json:"numeric_iso_code"`
Precision int32 `gorm:"column:precision;not null;default:6" json:"precision"`
ConversionRate float64 `gorm:"column:conversion_rate;not null" json:"conversion_rate"`
Deleted bool `gorm:"column:deleted;not null" json:"deleted"`
Active bool `gorm:"column:active;not null;default:1" json:"active"`
}
// TableName PsCurrency's table name
func (*PsCurrency) TableName() string {
return TableNamePsCurrency
}
var PsCurrencyCols = struct {
IDCurrency gormcol.Field
Name gormcol.Field
IsoCode gormcol.Field
NumericIsoCode gormcol.Field
Precision gormcol.Field
ConversionRate gormcol.Field
Deleted gormcol.Field
Active gormcol.Field
}{
IDCurrency: gormcol.Field{Table: TableNamePsCurrency, Column: "id_currency"},
Name: gormcol.Field{Table: TableNamePsCurrency, Column: "name"},
IsoCode: gormcol.Field{Table: TableNamePsCurrency, Column: "iso_code"},
NumericIsoCode: gormcol.Field{Table: TableNamePsCurrency, Column: "numeric_iso_code"},
Precision: gormcol.Field{Table: TableNamePsCurrency, Column: "precision"},
ConversionRate: gormcol.Field{Table: TableNamePsCurrency, Column: "conversion_rate"},
Deleted: gormcol.Field{Table: TableNamePsCurrency, Column: "deleted"},
Active: gormcol.Field{Table: TableNamePsCurrency, Column: "active"},
}