mirror of
https://github.com/zitadel/zitadel.git
synced 2024-12-12 11:04:25 +00:00
26 lines
485 B
Go
26 lines
485 B
Go
|
package target
|
||
|
|
||
|
import (
|
||
|
"github.com/zitadel/zitadel/internal/eventstore"
|
||
|
)
|
||
|
|
||
|
const (
|
||
|
UniqueTarget = "target"
|
||
|
DuplicateTarget = "Errors.Target.AlreadyExists"
|
||
|
)
|
||
|
|
||
|
func NewAddUniqueConstraint(name string) *eventstore.UniqueConstraint {
|
||
|
return eventstore.NewAddEventUniqueConstraint(
|
||
|
UniqueTarget,
|
||
|
name,
|
||
|
DuplicateTarget,
|
||
|
)
|
||
|
}
|
||
|
|
||
|
func NewRemoveUniqueConstraint(name string) *eventstore.UniqueConstraint {
|
||
|
return eventstore.NewRemoveUniqueConstraint(
|
||
|
UniqueTarget,
|
||
|
name,
|
||
|
)
|
||
|
}
|