Update task delegation table migration #183

Merged
romanskijdev merged 1 commits from fix-permissions into main 2026-10-13 15:26:02 +03:00
1 changed files with 2 additions and 11 deletions

View File

@ -1,22 +1,13 @@
package tablesmigration
import (
"bitrix_balancer_api/core/typescore"
"gorm.io/gorm"
"time"
)
// Вспомогательная структура для автомиграции, чтобы не тянуть зависимости
type LocalTaskDelegation struct {
ID *uint64 `gorm:"column:id;primaryKey;autoIncrement"`
DelegatorID *uint64 `gorm:"column:delegator_id;not null"`
DelegateID *uint64 `gorm:"column:delegate_id;not null"`
ValidUntil *time.Time `gorm:"column:valid_until;not null"`
IsActive *bool `gorm:"column:is_active;not null;default:true"`
NotifiedDay *bool `gorm:"column:notified_day;not null;default:false"`
Notified2h *bool `gorm:"column:notified_2h;not null;default:false"`
CreatedAt *time.Time `gorm:"column:created_at;default:CURRENT_TIMESTAMP"`
UpdatedAt *time.Time `gorm:"column:updated_at;default:CURRENT_TIMESTAMP"`
}
type LocalTaskDelegation typescore.TaskDelegation
func (LocalTaskDelegation) TableName() string {
return "task_delegations"