package schema

import "gorm.io/gorm"

type PrivateLinkService struct {
	gorm.Model

	ClusterId      uint64 `gorm:"not null;index"`
	TidbGroupId    uint64 `gorm:"not null;index;primaryKey"`
	ServiceName    string `gorm:"type:VARCHAR(255)"`
	ServiceHost    string `gorm:"type:VARCHAR(255)"`
	ServicePort    int    `gorm:"not null;default:0"`
	AvailableZones string `gorm:"type:VARCHAR(255)"`
}

type PrivateLinkConnection struct {
	gorm.Model

	ClusterId            uint64  `gorm:"not null;index"`
	EndpointId           string  `gorm:"not null;type:VARCHAR(255);index"`
	EndpointType         string  `gorm:"type:ENUM('dbaas','customer');not null;default:'customer'"`
	TidbGroupId          uint64  `gorm:"not null;index;default:0"`
	PrivateIpAddress     *string `gorm:"type:VARCHAR(255)"`
	PrivateLinkServiceId uint64  `gorm:"not null;index"`
	DefaultDomainName    string  `gorm:"type:VARCHAR(255)"`
	Message              string  `gorm:"type:TEXT"`
}
