mirror of
https://github.com/zitadel/zitadel.git
synced 2024-12-12 11:04:25 +00:00
5349d96ce4
* sub queries * fix: tests * add builder to tests * new search query * rename searchquerybuilder to builder * remove comment from code * test with multiple queries * add filters test * fix(contibute): listing * add validate module * fix: search queries * remove unused event type in query * ignore query if error in marshal * go mod tidy * update privacy policy query * update queries Co-authored-by: Livio Amstutz <livio.a@gmail.com>
42 lines
993 B
Go
42 lines
993 B
Go
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
|
|
)
|
|
|
|
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,
|
|
}
|
|
}
|