Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions backend/core/models/migrationscripts/archived/base.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ package archived

import (
"time"

"golang.org/x/exp/constraints"
)

type DomainEntity struct {
Expand All @@ -44,7 +42,14 @@ type ScopeConfig struct {
Entities []string `gorm:"type:json;serializer:json" json:"entities" mapstructure:"entities"`
}

type GenericModel[T string | constraints.Unsigned] struct {
// unsignedInteger matches all unsigned integer types, replacing
// golang.org/x/exp/constraints.Unsigned to avoid a transitive dependency
// on that module which requires Go 1.23+ in recent versions.
type unsignedInteger interface {
~uint | ~uint8 | ~uint16 | ~uint32 | ~uint64 | ~uintptr
}

type GenericModel[T string | unsignedInteger] struct {
ID T `gorm:"primaryKey" json:"id"`
CreatedAt time.Time `json:"createdAt"`
UpdatedAt time.Time `json:"updatedAt"`
Expand Down