feat: migrate unique constraints v1 to v2 (#1274)

* fix: unique migration

* fix: unique migration

* fix: remove migrations

* fix: member events
This commit is contained in:
Fabi
2021-02-15 13:31:24 +01:00
committed by GitHub
parent 3bc3ef1f2c
commit ee86eb4399
47 changed files with 630 additions and 173 deletions
@@ -11,7 +11,7 @@ import (
)
const (
uniqueAppNameType = "appname"
UniqueAppNameType = "appname"
applicationEventTypePrefix = projectEventTypePrefix + "application."
ApplicationAddedType = applicationEventTypePrefix + "added"
ApplicationChangedType = applicationEventTypePrefix + "changed"
@@ -22,14 +22,14 @@ const (
func NewAddApplicationUniqueConstraint(name, projectID string) *eventstore.EventUniqueConstraint {
return eventstore.NewAddEventUniqueConstraint(
uniqueAppNameType,
UniqueAppNameType,
fmt.Sprintf("%s:%s", name, projectID),
"Errors.Project.App.AlreadyExists")
}
func NewRemoveApplicationUniqueConstraint(name, projectID string) *eventstore.EventUniqueConstraint {
return eventstore.NewRemoveEventUniqueConstraint(
uniqueAppNameType,
UniqueAppNameType,
fmt.Sprintf("%s:%s", name, projectID))
}