mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-11 19:07:30 +00:00
fix: move v2 pkgs (#1331)
* fix: move eventstore pkgs * fix: move eventstore pkgs * fix: remove v2 view * fix: remove v2 view
This commit is contained in:
43
internal/eventstore/unique_constraint.go
Normal file
43
internal/eventstore/unique_constraint.go
Normal file
@@ -0,0 +1,43 @@
|
||||
package eventstore
|
||||
|
||||
type EventUniqueConstraint struct {
|
||||
// UniqueType is the table name for the unique constraint
|
||||
UniqueType string
|
||||
//UniqueField is the unique key
|
||||
UniqueField string
|
||||
//Action defines if unique constraint should be added or removed
|
||||
Action UniqueConstraintAction
|
||||
//ErrorMessage defines the translation file key for the error message
|
||||
ErrorMessage string
|
||||
}
|
||||
|
||||
type UniqueConstraintAction int32
|
||||
|
||||
const (
|
||||
UniqueConstraintAdd UniqueConstraintAction = iota
|
||||
UniqueConstraintRemove
|
||||
|
||||
uniqueConstraintActionCount
|
||||
)
|
||||
|
||||
func NewAddEventUniqueConstraint(
|
||||
uniqueType,
|
||||
uniqueField,
|
||||
errMessage string) *EventUniqueConstraint {
|
||||
return &EventUniqueConstraint{
|
||||
UniqueType: uniqueType,
|
||||
UniqueField: uniqueField,
|
||||
ErrorMessage: errMessage,
|
||||
Action: UniqueConstraintAdd,
|
||||
}
|
||||
}
|
||||
|
||||
func NewRemoveEventUniqueConstraint(
|
||||
uniqueType,
|
||||
uniqueField string) *EventUniqueConstraint {
|
||||
return &EventUniqueConstraint{
|
||||
UniqueType: uniqueType,
|
||||
UniqueField: uniqueField,
|
||||
Action: UniqueConstraintRemove,
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user