package yb_activity_permission

import "time"

// YbActivityPermission 活动的关联权限表
type YbActivityPermission struct {
	ActivityPermissionID uint32    `gorm:"primaryKey;column:activity_permission_id;type:int(9) unsigned;not null" json:"-"`           // 自增id
	ActivityID           uint32    `gorm:"index:idx_activity_id;column:activity_id;type:int(9) unsigned;default:0" json:"activityId"` // 活动id
	PermissionID         uint32    `gorm:"column:permission_id;type:int(9) unsigned;default:0" json:"permissionId"`                   // 关联权限id
	PermissionName       string    `gorm:"column:permission_name;type:varchar(32);default:''" json:"permissionName"`                  // 关联权限名称
	CreateTime           time.Time `gorm:"column:create_time;type:timestamp;default:CURRENT_TIMESTAMP" json:"createTime"`
}

// TableName get sql table name.获取数据库表名
func (m *YbActivityPermission) TableName() string {
	return "yb_activity_permission"
}

// YbActivityPermissionColumns get sql column name.获取数据库列名
var YbActivityPermissionColumns = struct {
	ActivityPermissionID string
	ActivityID           string
	PermissionID         string
	PermissionName       string
	CreateTime           string
}{
	ActivityPermissionID: "activity_permission_id",
	ActivityID:           "activity_id",
	PermissionID:         "permission_id",
	PermissionName:       "permission_name",
	CreateTime:           "create_time",
}
