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
+3 -3
View File
@@ -10,7 +10,7 @@ import (
)
var (
uniqueGrantType = "project_Grant"
UniqueGrantType = "project_grant"
grantEventTypePrefix = projectEventTypePrefix + "grant."
GrantAddedType = grantEventTypePrefix + "added"
GrantChangedType = grantEventTypePrefix + "changed"
@@ -22,14 +22,14 @@ var (
func NewAddProjectGrantUniqueConstraint(grantedOrgID, projectID string) *eventstore.EventUniqueConstraint {
return eventstore.NewAddEventUniqueConstraint(
uniqueRoleType,
UniqueRoleType,
fmt.Sprintf("%s:%s", grantedOrgID, projectID),
"Errors.Project.Grant.AlreadyExists")
}
func NewRemoveProjectGrantUniqueConstraint(grantedOrgID, projectID string) *eventstore.EventUniqueConstraint {
return eventstore.NewRemoveEventUniqueConstraint(
uniqueRoleType,
UniqueRoleType,
fmt.Sprintf("%s:%s", grantedOrgID, projectID))
}