feat: delete organizations (#6083)

* feat: delete organizations

* feat: tests and delete all that depends on org

* fix: grpc delete description

* fix: get back reduce OrgRemovedEvent

* fix: add @muhlemmer review suggestions

* fix: new e2e for add/delete org
This commit is contained in:
Miguel Cabrerizo 2023-09-07 06:54:51 +02:00 committed by GitHub
parent 0f06e84f40
commit dd80109969
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
86 changed files with 166 additions and 495 deletions

View File

@ -170,7 +170,7 @@
<div class="content">
<cnsl-form-field class="formfield">
<cnsl-label>{{ 'ORG_DETAIL.DETAIL.NAME' | translate }}</cnsl-label>
<input cnslInput formControlName="name" />
<input cnslInput formControlName="name" data-e2e="org-name-input" />
</cnsl-form-field>
</div>
@ -182,6 +182,7 @@
class="big-button"
cdkFocusInitial
type="submit"
data-e2e="create-org-button"
>
{{ 'ACTIONS.CREATE' | translate }}
</button>

View File

@ -957,8 +957,7 @@
"STATE": {
"0": "Не е дефинирано",
"1": "Активен",
"2": "Деактивиран",
"3": "Премахнато"
"2": "Деактивиран"
},
"MEMBER": {
"TITLE": "Мениджъри на организации",

View File

@ -963,8 +963,7 @@
"STATE": {
"0": "Nicht definiert",
"1": "Aktiv",
"2": "Inaktiv",
"3": "Entfernt"
"2": "Inaktiv"
},
"MEMBER": {
"TITLE": "Manager der Organisation verwalten",

View File

@ -964,8 +964,7 @@
"STATE": {
"0": "Not defined",
"1": "Active",
"2": "Deactivated",
"3": "Removed"
"2": "Deactivated"
},
"MEMBER": {
"TITLE": "Organization Managers",

View File

@ -964,8 +964,7 @@
"STATE": {
"0": "No definida",
"1": "Activa",
"2": "Desactivada",
"3": "Eliminada"
"2": "Desactivada"
},
"MEMBER": {
"TITLE": "Mánagers de la organización",

View File

@ -963,8 +963,7 @@
"STATE": {
"0": "Non défini",
"1": "Actif",
"2": "Désactivé",
"3": "Supprimé"
"2": "Désactivé"
},
"MEMBER": {
"TITLE": "Gestionnaires de l'organisation",

View File

@ -963,8 +963,7 @@
"STATE": {
"0": "Non definito",
"1": "Attivo",
"2": "Disattivato",
"3": "Rimosso"
"2": "Disattivato"
},
"MEMBER": {
"TITLE": "Manager dell'organizzazione",

View File

@ -964,8 +964,7 @@
"STATE": {
"0": "未定義",
"1": "アクティブ",
"2": "非アクティブ",
"3": "削除"
"2": "非アクティブ"
},
"MEMBER": {
"TITLE": "組織マネージャー",

View File

@ -963,8 +963,7 @@
"STATE": {
"0": "Nieokreślone",
"1": "Aktywne",
"2": "Dezaktywowane",
"3": "Usunięte"
"2": "Dezaktywowane"
},
"MEMBER": {
"TITLE": "Menadżerowie organizacji",

View File

@ -963,8 +963,7 @@
"STATE": {
"0": "未定义",
"1": "启用",
"2": "停用",
"3": "移除"
"2": "停用"
},
"MEMBER": {
"TITLE": "组织管理者",

View File

@ -3,15 +3,38 @@ import { v4 as uuidv4 } from 'uuid';
import { Context } from 'support/commands';
const orgPath = `/org`;
const orgsPath = `/orgs`;
const orgsPathCreate = `/orgs/create`;
const orgNameOnCreation = 'e2eorgrename';
const testOrgNameChange = uuidv4();
const newOrg = uuidv4();
beforeEach(() => {
cy.context().as('ctx');
});
describe('organizations', () => {
describe('add and delete org', () => {
it('should create an org', () => {
cy.visit(orgsPathCreate);
cy.get('[data-e2e="org-name-input"]').focus().clear().type(newOrg);
cy.get('[data-e2e="create-org-button"]').click();
cy.contains('tr', newOrg);
});
it('should delete an org', () => {
cy.visit(orgsPath);
cy.contains('tr', newOrg).click();
cy.get('[data-e2e="actions"]').click();
cy.get('[data-e2e="delete"]', { timeout: 1000 }).should('be.visible').click();
cy.get('[data-e2e="confirm-dialog-input"]').focus().clear().type(newOrg);
cy.get('[data-e2e="confirm-dialog-button"]').click();
cy.shouldConfirmSuccess();
cy.contains('tr', newOrg).should('not.exist');
});
});
describe('rename', () => {
beforeEach(() => {
cy.get<Context>('@ctx').then((ctx) => {

View File

@ -103,8 +103,6 @@ func OrgStateToPb(state domain.OrgState) org_pb.OrgState {
return org_pb.OrgState_ORG_STATE_ACTIVE
case domain.OrgStateInactive:
return org_pb.OrgState_ORG_STATE_INACTIVE
case domain.OrgStateRemoved:
return org_pb.OrgState_ORG_STATE_REMOVED
default:
return org_pb.OrgState_ORG_STATE_UNSPECIFIED
}
@ -116,8 +114,6 @@ func OrgStateToDomain(state org_pb.OrgState) domain.OrgState {
return domain.OrgStateActive
case org_pb.OrgState_ORG_STATE_INACTIVE:
return domain.OrgStateInactive
case org_pb.OrgState_ORG_STATE_REMOVED:
return domain.OrgStateRemoved
case org_pb.OrgState_ORG_STATE_UNSPECIFIED:
fallthrough
default:

View File

@ -1088,34 +1088,6 @@ func TestCommandSide_RemoveOrg(t *testing.T) {
err: errors.IsNotFound,
},
},
{
name: "org already removed, error",
fields: fields{
eventstore: eventstoreExpect(
t,
expectFilter(), // zitadel project check
expectFilter(
eventFromEventPusher(
org.NewOrgAddedEvent(context.Background(),
&org.NewAggregate("org1").Aggregate,
"org"),
),
eventFromEventPusher(
org.NewOrgRemovedEvent(context.Background(),
&org.NewAggregate("org1").Aggregate,
"org", []string{}, false, []string{}, []*domain.UserIDPLink{}, []string{}),
),
),
),
},
args: args{
ctx: context.Background(),
orgID: "org1",
},
res: res{
err: errors.IsNotFound,
},
},
{
name: "push failed, error",
fields: fields{

View File

@ -214,8 +214,10 @@ func (q *Queries) SearchOrgs(ctx context.Context, queries *OrgSearchQueries) (or
query, scan := prepareOrgsQuery(ctx, q.client)
stmt, args, err := queries.toQuery(query).
Where(sq.Eq{
Where(sq.And{
sq.Eq{
OrgColumnInstanceID.identifier(): authz.GetInstance(ctx).InstanceID(),
},
}).ToSql()
if err != nil {
return nil, errors.ThrowInvalidArgument(err, "QUERY-wQ3by", "Errors.Query.InvalidRequest")

View File

@ -17,19 +17,19 @@ import (
)
var (
orgUniqueQuery = "SELECT COUNT(*) = 0 FROM projections.orgs LEFT JOIN projections.org_domains2 ON projections.orgs.id = projections.org_domains2.org_id AND projections.orgs.instance_id = projections.org_domains2.instance_id AS OF SYSTEM TIME '-1 ms' WHERE (projections.org_domains2.is_verified = $1 AND projections.orgs.instance_id = $2 AND (projections.org_domains2.domain ILIKE $3 OR projections.orgs.name ILIKE $4) AND projections.orgs.org_state <> $5)"
orgUniqueQuery = "SELECT COUNT(*) = 0 FROM projections.orgs1 LEFT JOIN projections.org_domains2 ON projections.orgs1.id = projections.org_domains2.org_id AND projections.orgs1.instance_id = projections.org_domains2.instance_id AS OF SYSTEM TIME '-1 ms' WHERE (projections.org_domains2.is_verified = $1 AND projections.orgs1.instance_id = $2 AND (projections.org_domains2.domain ILIKE $3 OR projections.orgs1.name ILIKE $4) AND projections.orgs1.org_state <> $5)"
orgUniqueCols = []string{"is_unique"}
prepareOrgsQueryStmt = `SELECT projections.orgs.id,` +
` projections.orgs.creation_date,` +
` projections.orgs.change_date,` +
` projections.orgs.resource_owner,` +
` projections.orgs.org_state,` +
` projections.orgs.sequence,` +
` projections.orgs.name,` +
` projections.orgs.primary_domain,` +
prepareOrgsQueryStmt = `SELECT projections.orgs1.id,` +
` projections.orgs1.creation_date,` +
` projections.orgs1.change_date,` +
` projections.orgs1.resource_owner,` +
` projections.orgs1.org_state,` +
` projections.orgs1.sequence,` +
` projections.orgs1.name,` +
` projections.orgs1.primary_domain,` +
` COUNT(*) OVER ()` +
` FROM projections.orgs` +
` FROM projections.orgs1` +
` AS OF SYSTEM TIME '-1 ms' `
prepareOrgsQueryCols = []string{
"id",
@ -43,15 +43,15 @@ var (
"count",
}
prepareOrgQueryStmt = `SELECT projections.orgs.id,` +
` projections.orgs.creation_date,` +
` projections.orgs.change_date,` +
` projections.orgs.resource_owner,` +
` projections.orgs.org_state,` +
` projections.orgs.sequence,` +
` projections.orgs.name,` +
` projections.orgs.primary_domain` +
` FROM projections.orgs` +
prepareOrgQueryStmt = `SELECT projections.orgs1.id,` +
` projections.orgs1.creation_date,` +
` projections.orgs1.change_date,` +
` projections.orgs1.resource_owner,` +
` projections.orgs1.org_state,` +
` projections.orgs1.sequence,` +
` projections.orgs1.name,` +
` projections.orgs1.primary_domain` +
` FROM projections.orgs1` +
` AS OF SYSTEM TIME '-1 ms' `
prepareOrgQueryCols = []string{
"id",
@ -65,8 +65,8 @@ var (
}
prepareOrgUniqueStmt = `SELECT COUNT(*) = 0` +
` FROM projections.orgs` +
` LEFT JOIN projections.org_domains2 ON projections.orgs.id = projections.org_domains2.org_id AND projections.orgs.instance_id = projections.org_domains2.instance_id` +
` FROM projections.orgs1` +
` LEFT JOIN projections.org_domains2 ON projections.orgs1.id = projections.org_domains2.org_id AND projections.orgs1.instance_id = projections.org_domains2.instance_id` +
` AS OF SYSTEM TIME '-1 ms' `
prepareOrgUniqueCols = []string{
"count",

View File

@ -29,8 +29,8 @@ var (
` COUNT(*) OVER () ` +
` FROM projections.project_grants3 ` +
` LEFT JOIN projections.projects3 ON projections.project_grants3.project_id = projections.projects3.id AND projections.project_grants3.instance_id = projections.projects3.instance_id ` +
` LEFT JOIN projections.orgs AS r ON projections.project_grants3.resource_owner = r.id AND projections.project_grants3.instance_id = r.instance_id` +
` LEFT JOIN projections.orgs AS o ON projections.project_grants3.granted_org_id = o.id AND projections.project_grants3.instance_id = o.instance_id` +
` LEFT JOIN projections.orgs1 AS r ON projections.project_grants3.resource_owner = r.id AND projections.project_grants3.instance_id = r.instance_id` +
` LEFT JOIN projections.orgs1 AS o ON projections.project_grants3.granted_org_id = o.id AND projections.project_grants3.instance_id = o.instance_id` +
` AS OF SYSTEM TIME '-1 ms'`
projectGrantsCols = []string{
"project_id",
@ -61,8 +61,8 @@ var (
` r.name` +
` FROM projections.project_grants3 ` +
` LEFT JOIN projections.projects3 ON projections.project_grants3.project_id = projections.projects3.id AND projections.project_grants3.instance_id = projections.projects3.instance_id ` +
` LEFT JOIN projections.orgs AS r ON projections.project_grants3.resource_owner = r.id AND projections.project_grants3.instance_id = r.instance_id` +
` LEFT JOIN projections.orgs AS o ON projections.project_grants3.granted_org_id = o.id AND projections.project_grants3.instance_id = o.instance_id` +
` LEFT JOIN projections.orgs1 AS r ON projections.project_grants3.resource_owner = r.id AND projections.project_grants3.instance_id = r.instance_id` +
` LEFT JOIN projections.orgs1 AS o ON projections.project_grants3.granted_org_id = o.id AND projections.project_grants3.instance_id = o.instance_id` +
` AS OF SYSTEM TIME '-1 ms'`
projectGrantCols = []string{
"project_id",

View File

@ -220,13 +220,8 @@ func (p *actionProjection) reduceOwnerRemoved(event eventstore.Event) (*handler.
if !ok {
return nil, errors.ThrowInvalidArgumentf(nil, "PROJE-mSmWM", "reduce.wrong.event.type %s", org.OrgRemovedEventType)
}
return crdb.NewUpdateStatement(
return crdb.NewDeleteStatement(
e,
[]handler.Column{
handler.NewCol(ActionChangeDateCol, e.CreationDate()),
handler.NewCol(ActionSequenceCol, e.Sequence()),
handler.NewCol(ActionOwnerRemovedCol, true),
},
[]handler.Condition{
handler.NewCond(ActionInstanceIDCol, e.Aggregate().InstanceID),
handler.NewCond(ActionResourceOwnerCol, e.Aggregate().ID),

View File

@ -195,11 +195,8 @@ func TestActionProjection_reduces(t *testing.T) {
executer: &testExecuter{
executions: []execution{
{
expectedStmt: "UPDATE projections.actions3 SET (change_date, sequence, owner_removed) = ($1, $2, $3) WHERE (instance_id = $4) AND (resource_owner = $5)",
expectedStmt: "DELETE FROM projections.actions3 WHERE (instance_id = $1) AND (resource_owner = $2)",
expectedArgs: []interface{}{
anyArg{},
uint64(15),
true,
"instance-id",
"agg-id",
},

View File

@ -598,13 +598,8 @@ func (p *appProjection) reduceOwnerRemoved(event eventstore.Event) (*handler.Sta
return nil, errors.ThrowInvalidArgumentf(nil, "PROJE-Hyd1f", "reduce.wrong.event.type %s", org.OrgRemovedEventType)
}
return crdb.NewUpdateStatement(
return crdb.NewDeleteStatement(
e,
[]handler.Column{
handler.NewCol(AppColumnChangeDate, e.CreationDate()),
handler.NewCol(AppColumnSequence, e.Sequence()),
handler.NewCol(AppColumnOwnerRemoved, true),
},
[]handler.Condition{
handler.NewCond(AppColumnInstanceID, e.Aggregate().InstanceID),
handler.NewCond(AppColumnResourceOwner, e.Aggregate().ID),

View File

@ -629,11 +629,8 @@ func TestAppProjection_reduces(t *testing.T) {
executer: &testExecuter{
executions: []execution{
{
expectedStmt: "UPDATE projections.apps5 SET (change_date, sequence, owner_removed) = ($1, $2, $3) WHERE (instance_id = $4) AND (resource_owner = $5)",
expectedStmt: "DELETE FROM projections.apps5 WHERE (instance_id = $1) AND (resource_owner = $2)",
expectedArgs: []interface{}{
anyArg{},
uint64(15),
true,
"instance-id",
"agg-id",
},

View File

@ -256,13 +256,8 @@ func (p *authNKeyProjection) reduceOwnerRemoved(event eventstore.Event) (*handle
return nil, errors.ThrowInvalidArgumentf(nil, "PROJE-Hyd1f", "reduce.wrong.event.type %s", org.OrgRemovedEventType)
}
return crdb.NewUpdateStatement(
return crdb.NewDeleteStatement(
e,
[]handler.Column{
handler.NewCol(AuthNKeyChangeDateCol, e.CreationDate()),
handler.NewCol(AuthNKeySequenceCol, e.Sequence()),
handler.NewCol(AuthNKeyOwnerRemovedCol, true),
},
[]handler.Condition{
handler.NewCond(AuthNKeyInstanceIDCol, e.Aggregate().InstanceID),
handler.NewCond(AuthNKeyResourceOwnerCol, e.Aggregate().ID),

View File

@ -488,11 +488,8 @@ func TestAuthNKeyProjection_reduces(t *testing.T) {
executer: &testExecuter{
executions: []execution{
{
expectedStmt: "UPDATE projections.authn_keys2 SET (change_date, sequence, owner_removed) = ($1, $2, $3) WHERE (instance_id = $4) AND (resource_owner = $5)",
expectedStmt: "DELETE FROM projections.authn_keys2 WHERE (instance_id = $1) AND (resource_owner = $2)",
expectedArgs: []interface{}{
anyArg{},
uint64(15),
true,
"instance-id",
"agg-id",
},

View File

@ -188,13 +188,8 @@ func (p *customTextProjection) reduceOwnerRemoved(event eventstore.Event) (*hand
return nil, errors.ThrowInvalidArgumentf(nil, "PROJE-V2T3z", "reduce.wrong.event.type %s", org.OrgRemovedEventType)
}
return crdb.NewUpdateStatement(
return crdb.NewDeleteStatement(
e,
[]handler.Column{
handler.NewCol(CustomTextChangeDateCol, e.CreationDate()),
handler.NewCol(CustomTextSequenceCol, e.Sequence()),
handler.NewCol(CustomTextOwnerRemovedCol, true),
},
[]handler.Condition{
handler.NewCond(CustomTextInstanceIDCol, e.Aggregate().InstanceID),
handler.NewCond(CustomTextAggregateIDCol, e.Aggregate().ID),

View File

@ -278,11 +278,8 @@ func TestCustomTextProjection_reduces(t *testing.T) {
executer: &testExecuter{
executions: []execution{
{
expectedStmt: "UPDATE projections.custom_texts2 SET (change_date, sequence, owner_removed) = ($1, $2, $3) WHERE (instance_id = $4) AND (aggregate_id = $5)",
expectedStmt: "DELETE FROM projections.custom_texts2 WHERE (instance_id = $1) AND (aggregate_id = $2)",
expectedArgs: []interface{}{
anyArg{},
uint64(15),
true,
"instance-id",
"agg-id",
},

View File

@ -185,13 +185,8 @@ func (p *domainPolicyProjection) reduceOwnerRemoved(event eventstore.Event) (*ha
return nil, errors.ThrowInvalidArgumentf(nil, "PROJE-JYD2K", "reduce.wrong.event.type %s", org.OrgRemovedEventType)
}
return crdb.NewUpdateStatement(
return crdb.NewDeleteStatement(
e,
[]handler.Column{
handler.NewCol(DomainPolicyChangeDateCol, e.CreationDate()),
handler.NewCol(DomainPolicySequenceCol, e.Sequence()),
handler.NewCol(DomainPolicyOwnerRemovedCol, true),
},
[]handler.Condition{
handler.NewCond(DomainPolicyInstanceIDCol, e.Aggregate().InstanceID),
handler.NewCond(DomainPolicyResourceOwnerCol, e.Aggregate().ID),

View File

@ -244,11 +244,8 @@ func TestDomainPolicyProjection_reduces(t *testing.T) {
executer: &testExecuter{
executions: []execution{
{
expectedStmt: "UPDATE projections.domain_policies2 SET (change_date, sequence, owner_removed) = ($1, $2, $3) WHERE (instance_id = $4) AND (resource_owner = $5)",
expectedStmt: "DELETE FROM projections.domain_policies2 WHERE (instance_id = $1) AND (resource_owner = $2)",
expectedArgs: []interface{}{
anyArg{},
uint64(15),
true,
"instance-id",
"agg-id",
},

View File

@ -135,13 +135,8 @@ func (p *flowProjection) reduceOwnerRemoved(event eventstore.Event) (*handler.St
return nil, errors.ThrowInvalidArgumentf(nil, "PROJE-Yd7WC", "reduce.wrong.event.type %s", org.OrgRemovedEventType)
}
return crdb.NewUpdateStatement(
return crdb.NewDeleteStatement(
e,
[]handler.Column{
handler.NewCol(FlowChangeDateCol, e.CreationDate()),
handler.NewCol(FlowSequenceCol, e.Sequence()),
handler.NewCol(FlowOwnerRemovedCol, true),
},
[]handler.Condition{
handler.NewCond(FlowInstanceIDCol, e.Aggregate().InstanceID),
handler.NewCond(FlowResourceOwnerCol, e.Aggregate().ID),

View File

@ -122,11 +122,8 @@ func TestFlowProjection_reduces(t *testing.T) {
executer: &testExecuter{
executions: []execution{
{
expectedStmt: "UPDATE projections.flow_triggers2 SET (change_date, sequence, owner_removed) = ($1, $2, $3) WHERE (instance_id = $4) AND (resource_owner = $5)",
expectedStmt: "DELETE FROM projections.flow_triggers2 WHERE (instance_id = $1) AND (resource_owner = $2)",
expectedArgs: []interface{}{
anyArg{},
uint64(15),
true,
"instance-id",
"agg-id",
},

View File

@ -554,13 +554,8 @@ func (p *idpProjection) reduceOwnerRemoved(event eventstore.Event) (*handler.Sta
return nil, errors.ThrowInvalidArgumentf(nil, "PROJE-YsbQC", "reduce.wrong.event.type %s", org.OrgRemovedEventType)
}
return crdb.NewUpdateStatement(
return crdb.NewDeleteStatement(
e,
[]handler.Column{
handler.NewCol(IDPChangeDateCol, e.CreationDate()),
handler.NewCol(IDPSequenceCol, e.Sequence()),
handler.NewCol(IDPOwnerRemovedCol, true),
},
[]handler.Condition{
handler.NewCond(IDPInstanceIDCol, e.Aggregate().InstanceID),
handler.NewCond(IDPResourceOwnerCol, e.Aggregate().ID),

View File

@ -259,13 +259,8 @@ func (p *idpLoginPolicyLinkProjection) reduceOwnerRemoved(event eventstore.Event
return nil, errors.ThrowInvalidArgumentf(nil, "PROJE-YbhOv", "reduce.wrong.event.type %s", org.OrgRemovedEventType)
}
return crdb.NewUpdateStatement(
return crdb.NewDeleteStatement(
e,
[]handler.Column{
handler.NewCol(IDPLoginPolicyLinkChangeDateCol, e.CreationDate()),
handler.NewCol(IDPLoginPolicyLinkSequenceCol, e.Sequence()),
handler.NewCol(IDPLoginPolicyLinkOwnerRemovedCol, true),
},
[]handler.Condition{
handler.NewCond(IDPLoginPolicyLinkInstanceIDCol, e.Aggregate().InstanceID),
handler.NewCond(IDPLoginPolicyLinkResourceOwnerCol, e.Aggregate().ID),

View File

@ -406,11 +406,8 @@ func TestIDPLoginPolicyLinkProjection_reduces(t *testing.T) {
executer: &testExecuter{
executions: []execution{
{
expectedStmt: "UPDATE projections.idp_login_policy_links5 SET (change_date, sequence, owner_removed) = ($1, $2, $3) WHERE (instance_id = $4) AND (resource_owner = $5)",
expectedStmt: "DELETE FROM projections.idp_login_policy_links5 WHERE (instance_id = $1) AND (resource_owner = $2)",
expectedArgs: []interface{}{
anyArg{},
uint64(15),
true,
"instance-id",
"agg-id",
},

View File

@ -2034,13 +2034,8 @@ func (p *idpTemplateProjection) reduceOwnerRemoved(event eventstore.Event) (*han
return nil, errors.ThrowInvalidArgumentf(nil, "PROJE-Jp0D2K", "reduce.wrong.event.type %s", org.OrgRemovedEventType)
}
return crdb.NewUpdateStatement(
return crdb.NewDeleteStatement(
e,
[]handler.Column{
handler.NewCol(IDPTemplateChangeDateCol, e.CreationDate()),
handler.NewCol(IDPTemplateSequenceCol, e.Sequence()),
handler.NewCol(IDPTemplateOwnerRemovedCol, true),
},
[]handler.Condition{
handler.NewCond(IDPTemplateInstanceIDCol, e.Aggregate().InstanceID),
handler.NewCond(IDPTemplateResourceOwnerCol, e.Aggregate().ID),

View File

@ -77,11 +77,8 @@ func TestIDPTemplateProjection_reducesRemove(t *testing.T) {
executer: &testExecuter{
executions: []execution{
{
expectedStmt: "UPDATE projections.idp_templates5 SET (change_date, sequence, owner_removed) = ($1, $2, $3) WHERE (instance_id = $4) AND (resource_owner = $5)",
expectedStmt: "DELETE FROM projections.idp_templates5 WHERE (instance_id = $1) AND (resource_owner = $2)",
expectedArgs: []interface{}{
anyArg{},
uint64(15),
true,
"instance-id",
"agg-id",
},
@ -2411,11 +2408,8 @@ func TestIDPTemplateProjection_reducesLDAP(t *testing.T) {
executer: &testExecuter{
executions: []execution{
{
expectedStmt: "UPDATE projections.idp_templates5 SET (change_date, sequence, owner_removed) = ($1, $2, $3) WHERE (instance_id = $4) AND (resource_owner = $5)",
expectedStmt: "DELETE FROM projections.idp_templates5 WHERE (instance_id = $1) AND (resource_owner = $2)",
expectedArgs: []interface{}{
anyArg{},
uint64(15),
true,
"instance-id",
"agg-id",
},

View File

@ -906,11 +906,8 @@ func TestIDPProjection_reduces(t *testing.T) {
executer: &testExecuter{
executions: []execution{
{
expectedStmt: "UPDATE projections.idps3 SET (change_date, sequence, owner_removed) = ($1, $2, $3) WHERE (instance_id = $4) AND (resource_owner = $5)",
expectedStmt: "DELETE FROM projections.idps3 WHERE (instance_id = $1) AND (resource_owner = $2)",
expectedArgs: []interface{}{
anyArg{},
uint64(15),
true,
"instance-id",
"agg-id",
},

View File

@ -171,13 +171,8 @@ func (p *idpUserLinkProjection) reduceOwnerRemoved(event eventstore.Event) (*han
return nil, errors.ThrowInvalidArgumentf(nil, "PROJE-PGiAY", "reduce.wrong.event.type %s", org.OrgRemovedEventType)
}
return crdb.NewUpdateStatement(
return crdb.NewDeleteStatement(
e,
[]handler.Column{
handler.NewCol(IDPUserLinkChangeDateCol, e.CreationDate()),
handler.NewCol(IDPUserLinkSequenceCol, e.Sequence()),
handler.NewCol(IDPUserLinkOwnerRemovedCol, true),
},
[]handler.Condition{
handler.NewCond(IDPUserLinkResourceOwnerCol, e.Aggregate().ID),
handler.NewCond(IDPUserLinkInstanceIDCol, e.Aggregate().InstanceID),

View File

@ -141,11 +141,8 @@ func TestIDPUserLinkProjection_reduces(t *testing.T) {
executer: &testExecuter{
executions: []execution{
{
expectedStmt: "UPDATE projections.idp_user_links3 SET (change_date, sequence, owner_removed) = ($1, $2, $3) WHERE (resource_owner = $4) AND (instance_id = $5)",
expectedStmt: "DELETE FROM projections.idp_user_links3 WHERE (resource_owner = $1) AND (instance_id = $2)",
expectedArgs: []interface{}{
anyArg{},
uint64(15),
true,
"agg-id",
"instance-id",
},

View File

@ -215,11 +215,8 @@ func TestInstanceMemberProjection_reduces(t *testing.T) {
executer: &testExecuter{
executions: []execution{
{
expectedStmt: "UPDATE projections.instance_members3 SET (change_date, sequence, user_owner_removed) = ($1, $2, $3) WHERE (instance_id = $4) AND (user_resource_owner = $5)",
expectedStmt: "DELETE FROM projections.instance_members3 WHERE (instance_id = $1) AND (user_resource_owner = $2)",
expectedArgs: []interface{}{
anyArg{},
uint64(15),
true,
"instance-id",
"agg-id",
},

View File

@ -607,13 +607,8 @@ func (p *labelPolicyProjection) reduceOwnerRemoved(event eventstore.Event) (*han
return nil, errors.ThrowInvalidArgumentf(nil, "PROJE-Su6pX", "reduce.wrong.event.type %s", org.OrgRemovedEventType)
}
return crdb.NewUpdateStatement(
return crdb.NewDeleteStatement(
e,
[]handler.Column{
handler.NewCol(LabelPolicyChangeDateCol, e.CreationDate()),
handler.NewCol(LabelPolicySequenceCol, e.Sequence()),
handler.NewCol(LabelPolicyOwnerRemovedCol, true),
},
[]handler.Condition{
handler.NewCond(LabelPolicyInstanceIDCol, e.Aggregate().InstanceID),
handler.NewCond(LabelPolicyResourceOwnerCol, e.Aggregate().ID),

View File

@ -1007,11 +1007,8 @@ func TestLabelPolicyProjection_reduces(t *testing.T) {
executer: &testExecuter{
executions: []execution{
{
expectedStmt: "UPDATE projections.label_policies2 SET (change_date, sequence, owner_removed) = ($1, $2, $3) WHERE (instance_id = $4) AND (resource_owner = $5)",
expectedStmt: "DELETE FROM projections.label_policies2 WHERE (instance_id = $1) AND (resource_owner = $2)",
expectedArgs: []interface{}{
anyArg{},
uint64(15),
true,
"instance-id",
"agg-id",
},

View File

@ -179,13 +179,8 @@ func (p *lockoutPolicyProjection) reduceOwnerRemoved(event eventstore.Event) (*h
return nil, errors.ThrowInvalidArgumentf(nil, "PROJE-IoW0x", "reduce.wrong.event.type %s", org.OrgRemovedEventType)
}
return crdb.NewUpdateStatement(
return crdb.NewDeleteStatement(
e,
[]handler.Column{
handler.NewCol(LockoutPolicyChangeDateCol, e.CreationDate()),
handler.NewCol(LockoutPolicySequenceCol, e.Sequence()),
handler.NewCol(LockoutPolicyOwnerRemovedCol, true),
},
[]handler.Condition{
handler.NewCond(LockoutPolicyInstanceIDCol, e.Aggregate().InstanceID),
handler.NewCond(LockoutPolicyResourceOwnerCol, e.Aggregate().ID),

View File

@ -236,11 +236,8 @@ func TestLockoutPolicyProjection_reduces(t *testing.T) {
executer: &testExecuter{
executions: []execution{
{
expectedStmt: "UPDATE projections.lockout_policies2 SET (change_date, sequence, owner_removed) = ($1, $2, $3) WHERE (instance_id = $4) AND (resource_owner = $5)",
expectedStmt: "DELETE FROM projections.lockout_policies2 WHERE (instance_id = $1) AND (resource_owner = $2)",
expectedArgs: []interface{}{
anyArg{},
uint64(15),
true,
"instance-id",
"agg-id",
},

View File

@ -574,30 +574,21 @@ func (p *loginNameProjection) reduceOwnerRemoved(event eventstore.Event) (*handl
return crdb.NewMultiStatement(
event,
crdb.AddUpdateStatement(
[]handler.Column{
handler.NewCol(LoginNameDomainOwnerRemovedCol, true),
},
crdb.AddDeleteStatement(
[]handler.Condition{
handler.NewCond(LoginNameDomainInstanceIDCol, e.Aggregate().InstanceID),
handler.NewCond(LoginNameDomainResourceOwnerCol, e.Aggregate().ID),
},
crdb.WithTableSuffix(loginNameDomainSuffix),
),
crdb.AddUpdateStatement(
[]handler.Column{
handler.NewCol(LoginNamePoliciesOwnerRemovedCol, true),
},
crdb.AddDeleteStatement(
[]handler.Condition{
handler.NewCond(LoginNamePoliciesInstanceIDCol, e.Aggregate().InstanceID),
handler.NewCond(LoginNamePoliciesResourceOwnerCol, e.Aggregate().ID),
},
crdb.WithTableSuffix(loginNamePolicySuffix),
),
crdb.AddUpdateStatement(
[]handler.Column{
handler.NewCol(LoginNameUserOwnerRemovedCol, true),
},
crdb.AddDeleteStatement(
[]handler.Condition{
handler.NewCond(LoginNameUserInstanceIDCol, e.Aggregate().InstanceID),
handler.NewCond(LoginNameUserResourceOwnerCol, e.Aggregate().ID),

View File

@ -544,25 +544,22 @@ func TestLoginNameProjection_reduces(t *testing.T) {
executer: &testExecuter{
executions: []execution{
{
expectedStmt: "UPDATE projections.login_names2_domains SET owner_removed = $1 WHERE (instance_id = $2) AND (resource_owner = $3)",
expectedStmt: "DELETE FROM projections.login_names2_domains WHERE (instance_id = $1) AND (resource_owner = $2)",
expectedArgs: []interface{}{
true,
"instance-id",
"agg-id",
},
},
{
expectedStmt: "UPDATE projections.login_names2_policies SET owner_removed = $1 WHERE (instance_id = $2) AND (resource_owner = $3)",
expectedStmt: "DELETE FROM projections.login_names2_policies WHERE (instance_id = $1) AND (resource_owner = $2)",
expectedArgs: []interface{}{
true,
"instance-id",
"agg-id",
},
},
{
expectedStmt: "UPDATE projections.login_names2_users SET owner_removed = $1 WHERE (instance_id = $2) AND (resource_owner = $3)",
expectedStmt: "DELETE FROM projections.login_names2_users WHERE (instance_id = $1) AND (resource_owner = $2)",
expectedArgs: []interface{}{
true,
"instance-id",
"agg-id",
},

View File

@ -401,13 +401,8 @@ func (p *loginPolicyProjection) reduceOwnerRemoved(event eventstore.Event) (*han
return nil, errors.ThrowInvalidArgumentf(nil, "PROJE-B8NZW", "reduce.wrong.event.type %s", org.OrgRemovedEventType)
}
return crdb.NewUpdateStatement(
return crdb.NewDeleteStatement(
e,
[]handler.Column{
handler.NewCol(LoginPolicyChangeDateCol, e.CreationDate()),
handler.NewCol(LoginPolicySequenceCol, e.Sequence()),
handler.NewCol(LoginPolicyOwnerRemovedCol, true),
},
[]handler.Condition{
handler.NewCond(LoginPolicyInstanceIDCol, e.Aggregate().InstanceID),
handler.NewCond(LoginPolicyIDCol, e.Aggregate().ID),

View File

@ -702,11 +702,8 @@ func TestLoginPolicyProjection_reduces(t *testing.T) {
executer: &testExecuter{
executions: []execution{
{
expectedStmt: "UPDATE projections.login_policies5 SET (change_date, sequence, owner_removed) = ($1, $2, $3) WHERE (instance_id = $4) AND (aggregate_id = $5)",
expectedStmt: "DELETE FROM projections.login_policies5 WHERE (instance_id = $1) AND (aggregate_id = $2)",
expectedArgs: []interface{}{
anyArg{},
uint64(15),
true,
"instance-id",
"agg-id",
},

View File

@ -170,13 +170,8 @@ func (p *mailTemplateProjection) reduceOwnerRemoved(event eventstore.Event) (*ha
return nil, errors.ThrowInvalidArgumentf(nil, "PROJE-CThXR", "reduce.wrong.event.type %s", org.OrgRemovedEventType)
}
return crdb.NewUpdateStatement(
return crdb.NewDeleteStatement(
e,
[]handler.Column{
handler.NewCol(MailTemplateChangeDateCol, e.CreationDate()),
handler.NewCol(MailTemplateSequenceCol, e.Sequence()),
handler.NewCol(MailTemplateOwnerRemovedCol, true),
},
[]handler.Condition{
handler.NewCond(MailTemplateInstanceIDCol, e.Aggregate().InstanceID),
handler.NewCond(MailTemplateAggregateIDCol, e.Aggregate().ID),

View File

@ -226,11 +226,8 @@ func TestMailTemplateProjection_reduces(t *testing.T) {
executer: &testExecuter{
executions: []execution{
{
expectedStmt: "UPDATE projections.mail_templates2 SET (change_date, sequence, owner_removed) = ($1, $2, $3) WHERE (instance_id = $4) AND (aggregate_id = $5)",
expectedStmt: "DELETE FROM projections.mail_templates2 WHERE (instance_id = $1) AND (aggregate_id = $2)",
expectedArgs: []interface{}{
anyArg{},
uint64(15),
true,
"instance-id",
"agg-id",
},

View File

@ -139,12 +139,8 @@ func multiReduceMemberOwnerRemoved(e eventstore.Event, opts ...reduceMemberOpt)
for _, opt := range opts {
config = opt(config)
}
return crdb.AddUpdateStatement(
[]handler.Column{
handler.NewCol(MemberChangeDate, e.CreationDate()),
handler.NewCol(MemberSequence, e.Sequence()),
handler.NewCol(MemberOwnerRemoved, true),
},
return crdb.AddDeleteStatement(
config.conds,
)
}
@ -172,16 +168,14 @@ func memberUserOwnerRemovedCols(e eventstore.Event) []handler.Column {
}
func reduceMemberUserOwnerRemoved(e eventstore.Event, opts ...reduceMemberOpt) (*handler.Statement, error) {
return crdb.NewUpdateStatement(
return crdb.NewDeleteStatement(
e,
memberUserOwnerRemovedCols(e),
memberUserOwnerRemovedConds(e, opts...),
), nil
}
func multiReduceMemberUserOwnerRemoved(e eventstore.Event, opts ...reduceMemberOpt) func(eventstore.Event) crdb.Exec {
return crdb.AddUpdateStatement(
memberUserOwnerRemovedCols(e),
return crdb.AddDeleteStatement(
memberUserOwnerRemovedConds(e, opts...),
)
}

View File

@ -698,11 +698,8 @@ func TestMessageTextProjection_reduces(t *testing.T) {
executer: &testExecuter{
executions: []execution{
{
expectedStmt: "UPDATE projections.message_texts2 SET (change_date, sequence, owner_removed) = ($1, $2, $3) WHERE (instance_id = $4) AND (aggregate_id = $5)",
expectedStmt: "DELETE FROM projections.message_texts2 WHERE (instance_id = $1) AND (aggregate_id = $2)",
expectedArgs: []interface{}{
anyArg{},
uint64(15),
true,
"instance-id",
"agg-id",
},

View File

@ -253,13 +253,8 @@ func (p *messageTextProjection) reduceOwnerRemoved(event eventstore.Event) (*han
return nil, errors.ThrowInvalidArgumentf(nil, "PROJE-mLsQw", "reduce.wrong.event.type %s", org.OrgRemovedEventType)
}
return crdb.NewUpdateStatement(
return crdb.NewDeleteStatement(
e,
[]handler.Column{
handler.NewCol(MessageTextChangeDateCol, e.CreationDate()),
handler.NewCol(MessageTextSequenceCol, e.Sequence()),
handler.NewCol(MessageTextOwnerRemovedCol, true),
},
[]handler.Condition{
handler.NewCond(MessageTextInstanceIDCol, e.Aggregate().InstanceID),
handler.NewCond(MessageTextAggregateIDCol, e.Aggregate().ID),

View File

@ -172,13 +172,8 @@ func (p *notificationPolicyProjection) reduceOwnerRemoved(event eventstore.Event
return nil, errors.ThrowInvalidArgumentf(nil, "PROJE-poxi9a", "reduce.wrong.event.type %s", org.OrgRemovedEventType)
}
return crdb.NewUpdateStatement(
return crdb.NewDeleteStatement(
e,
[]handler.Column{
handler.NewCol(DomainPolicyChangeDateCol, e.CreationDate()),
handler.NewCol(DomainPolicySequenceCol, e.Sequence()),
handler.NewCol(DomainPolicyOwnerRemovedCol, true),
},
[]handler.Condition{
handler.NewCond(DomainPolicyInstanceIDCol, e.Aggregate().InstanceID),
handler.NewCond(DomainPolicyResourceOwnerCol, e.Aggregate().ID),

View File

@ -227,11 +227,8 @@ func TestNotificationPolicyProjection_reduces(t *testing.T) {
executer: &testExecuter{
executions: []execution{
{
expectedStmt: "UPDATE projections.notification_policies SET (change_date, sequence, owner_removed) = ($1, $2, $3) WHERE (instance_id = $4) AND (resource_owner = $5)",
expectedStmt: "DELETE FROM projections.notification_policies WHERE (instance_id = $1) AND (resource_owner = $2)",
expectedArgs: []interface{}{
anyArg{},
uint64(15),
true,
"instance-id",
"agg-id",
},

View File

@ -13,7 +13,7 @@ import (
)
const (
OrgProjectionTable = "projections.orgs"
OrgProjectionTable = "projections.orgs1"
OrgColumnID = "id"
OrgColumnCreationDate = "creation_date"
@ -202,13 +202,8 @@ func (p *orgProjection) reduceOrgRemoved(event eventstore.Event) (*handler.State
if !ok {
return nil, errors.ThrowInvalidArgumentf(nil, "PROJE-DgMSg", "reduce.wrong.event.type %s", org.OrgRemovedEventType)
}
return crdb.NewUpdateStatement(
return crdb.NewDeleteStatement(
e,
[]handler.Column{
handler.NewCol(OrgColumnChangeDate, e.CreationDate()),
handler.NewCol(OrgColumnSequence, e.Sequence()),
handler.NewCol(OrgColumnState, domain.OrgStateRemoved),
},
[]handler.Condition{
handler.NewCond(OrgColumnID, e.Aggregate().ID),
handler.NewCond(OrgColumnInstanceID, e.Aggregate().InstanceID),

View File

@ -215,13 +215,8 @@ func (p *orgDomainProjection) reduceOwnerRemoved(event eventstore.Event) (*handl
return nil, errors.ThrowInvalidArgumentf(nil, "PROJE-dMUKJ", "reduce.wrong.event.type %s", org.OrgRemovedEventType)
}
return crdb.NewUpdateStatement(
return crdb.NewDeleteStatement(
e,
[]handler.Column{
handler.NewCol(OrgDomainChangeDateCol, e.CreationDate()),
handler.NewCol(OrgDomainSequenceCol, e.Sequence()),
handler.NewCol(OrgDomainOwnerRemovedCol, true),
},
[]handler.Condition{
handler.NewCond(OrgDomainInstanceIDCol, e.Aggregate().InstanceID),
handler.NewCond(OrgDomainOrgIDCol, e.Aggregate().ID),

View File

@ -205,11 +205,8 @@ func TestOrgDomainProjection_reduces(t *testing.T) {
executer: &testExecuter{
executions: []execution{
{
expectedStmt: "UPDATE projections.org_domains2 SET (change_date, sequence, owner_removed) = ($1, $2, $3) WHERE (instance_id = $4) AND (org_id = $5)",
expectedStmt: "DELETE FROM projections.org_domains2 WHERE (instance_id = $1) AND (org_id = $2)",
expectedArgs: []interface{}{
anyArg{},
uint64(15),
true,
"instance-id",
"agg-id",
},

View File

@ -218,21 +218,15 @@ func TestOrgMemberProjection_reduces(t *testing.T) {
executer: &testExecuter{
executions: []execution{
{
expectedStmt: "UPDATE projections.org_members3 SET (change_date, sequence, owner_removed) = ($1, $2, $3) WHERE (instance_id = $4) AND (resource_owner = $5)",
expectedStmt: "DELETE FROM projections.org_members3 WHERE (instance_id = $1) AND (resource_owner = $2)",
expectedArgs: []interface{}{
anyArg{},
uint64(15),
true,
"instance-id",
"agg-id",
},
},
{
expectedStmt: "UPDATE projections.org_members3 SET (change_date, sequence, user_owner_removed) = ($1, $2, $3) WHERE (instance_id = $4) AND (user_resource_owner = $5)",
expectedStmt: "DELETE FROM projections.org_members3 WHERE (instance_id = $1) AND (user_resource_owner = $2)",
expectedArgs: []interface{}{
anyArg{},
uint64(15),
true,
"instance-id",
"agg-id",
},

View File

@ -39,7 +39,7 @@ func TestOrgProjection_reduces(t *testing.T) {
executer: &testExecuter{
executions: []execution{
{
expectedStmt: "UPDATE projections.orgs SET (change_date, sequence, primary_domain) = ($1, $2, $3) WHERE (id = $4) AND (instance_id = $5)",
expectedStmt: "UPDATE projections.orgs1 SET (change_date, sequence, primary_domain) = ($1, $2, $3) WHERE (id = $4) AND (instance_id = $5)",
expectedArgs: []interface{}{
anyArg{},
uint64(15),
@ -69,7 +69,7 @@ func TestOrgProjection_reduces(t *testing.T) {
executer: &testExecuter{
executions: []execution{
{
expectedStmt: "UPDATE projections.orgs SET (change_date, sequence, org_state) = ($1, $2, $3) WHERE (id = $4) AND (instance_id = $5)",
expectedStmt: "UPDATE projections.orgs1 SET (change_date, sequence, org_state) = ($1, $2, $3) WHERE (id = $4) AND (instance_id = $5)",
expectedArgs: []interface{}{
anyArg{},
uint64(15),
@ -99,7 +99,7 @@ func TestOrgProjection_reduces(t *testing.T) {
executer: &testExecuter{
executions: []execution{
{
expectedStmt: "UPDATE projections.orgs SET (change_date, sequence, org_state) = ($1, $2, $3) WHERE (id = $4) AND (instance_id = $5)",
expectedStmt: "UPDATE projections.orgs1 SET (change_date, sequence, org_state) = ($1, $2, $3) WHERE (id = $4) AND (instance_id = $5)",
expectedArgs: []interface{}{
anyArg{},
uint64(15),
@ -129,7 +129,7 @@ func TestOrgProjection_reduces(t *testing.T) {
executer: &testExecuter{
executions: []execution{
{
expectedStmt: "UPDATE projections.orgs SET (change_date, sequence, name) = ($1, $2, $3) WHERE (id = $4) AND (instance_id = $5)",
expectedStmt: "UPDATE projections.orgs1 SET (change_date, sequence, name) = ($1, $2, $3) WHERE (id = $4) AND (instance_id = $5)",
expectedArgs: []interface{}{
anyArg{},
uint64(15),
@ -176,7 +176,7 @@ func TestOrgProjection_reduces(t *testing.T) {
executer: &testExecuter{
executions: []execution{
{
expectedStmt: "INSERT INTO projections.orgs (id, creation_date, change_date, resource_owner, instance_id, sequence, name, org_state) VALUES ($1, $2, $3, $4, $5, $6, $7, $8)",
expectedStmt: "INSERT INTO projections.orgs1 (id, creation_date, change_date, resource_owner, instance_id, sequence, name, org_state) VALUES ($1, $2, $3, $4, $5, $6, $7, $8)",
expectedArgs: []interface{}{
"agg-id",
anyArg{},
@ -209,11 +209,8 @@ func TestOrgProjection_reduces(t *testing.T) {
executer: &testExecuter{
executions: []execution{
{
expectedStmt: "UPDATE projections.orgs SET (change_date, sequence, org_state) = ($1, $2, $3) WHERE (id = $4) AND (instance_id = $5)",
expectedStmt: "DELETE FROM projections.orgs1 WHERE (id = $1) AND (instance_id = $2)",
expectedArgs: []interface{}{
anyArg{},
uint64(15),
domain.OrgStateRemoved,
"agg-id",
"instance-id",
},
@ -239,7 +236,7 @@ func TestOrgProjection_reduces(t *testing.T) {
executer: &testExecuter{
executions: []execution{
{
expectedStmt: "DELETE FROM projections.orgs WHERE (instance_id = $1)",
expectedStmt: "DELETE FROM projections.orgs1 WHERE (instance_id = $1)",
expectedArgs: []interface{}{
"agg-id",
},

View File

@ -179,13 +179,8 @@ func (p *passwordAgeProjection) reduceOwnerRemoved(event eventstore.Event) (*han
return nil, errors.ThrowInvalidArgumentf(nil, "PROJE-edLs2", "reduce.wrong.event.type %s", org.OrgRemovedEventType)
}
return crdb.NewUpdateStatement(
return crdb.NewDeleteStatement(
e,
[]handler.Column{
handler.NewCol(AgePolicyChangeDateCol, e.CreationDate()),
handler.NewCol(AgePolicySequenceCol, e.Sequence()),
handler.NewCol(AgePolicyOwnerRemovedCol, true),
},
[]handler.Condition{
handler.NewCond(AgePolicyInstanceIDCol, e.Aggregate().InstanceID),
handler.NewCond(AgePolicyResourceOwnerCol, e.Aggregate().ID),

View File

@ -236,11 +236,8 @@ func TestPasswordAgeProjection_reduces(t *testing.T) {
executer: &testExecuter{
executions: []execution{
{
expectedStmt: "UPDATE projections.password_age_policies2 SET (change_date, sequence, owner_removed) = ($1, $2, $3) WHERE (instance_id = $4) AND (resource_owner = $5)",
expectedStmt: "DELETE FROM projections.password_age_policies2 WHERE (instance_id = $1) AND (resource_owner = $2)",
expectedArgs: []interface{}{
anyArg{},
uint64(15),
true,
"instance-id",
"agg-id",
},

View File

@ -197,13 +197,8 @@ func (p *passwordComplexityProjection) reduceOwnerRemoved(event eventstore.Event
return nil, errors.ThrowInvalidArgumentf(nil, "PROJE-pGTz9", "reduce.wrong.event.type %s", org.OrgRemovedEventType)
}
return crdb.NewUpdateStatement(
return crdb.NewDeleteStatement(
e,
[]handler.Column{
handler.NewCol(ComplexityPolicyChangeDateCol, e.CreationDate()),
handler.NewCol(ComplexityPolicySequenceCol, e.Sequence()),
handler.NewCol(ComplexityPolicyOwnerRemovedCol, true),
},
[]handler.Condition{
handler.NewCond(ComplexityPolicyInstanceIDCol, e.Aggregate().InstanceID),
handler.NewCond(ComplexityPolicyResourceOwnerCol, e.Aggregate().ID),

View File

@ -260,11 +260,8 @@ func TestPasswordComplexityProjection_reduces(t *testing.T) {
executer: &testExecuter{
executions: []execution{
{
expectedStmt: "UPDATE projections.password_complexity_policies2 SET (change_date, sequence, owner_removed) = ($1, $2, $3) WHERE (instance_id = $4) AND (resource_owner = $5)",
expectedStmt: "DELETE FROM projections.password_complexity_policies2 WHERE (instance_id = $1) AND (resource_owner = $2)",
expectedArgs: []interface{}{
anyArg{},
uint64(15),
true,
"instance-id",
"agg-id",
},

View File

@ -191,13 +191,8 @@ func (p *privacyPolicyProjection) reduceOwnerRemoved(event eventstore.Event) (*h
return nil, errors.ThrowInvalidArgumentf(nil, "PROJE-bxJCY", "reduce.wrong.event.type %s", org.OrgRemovedEventType)
}
return crdb.NewUpdateStatement(
return crdb.NewDeleteStatement(
e,
[]handler.Column{
handler.NewCol(PrivacyPolicyChangeDateCol, e.CreationDate()),
handler.NewCol(PrivacyPolicySequenceCol, e.Sequence()),
handler.NewCol(PrivacyPolicyOwnerRemovedCol, true),
},
[]handler.Condition{
handler.NewCond(PrivacyPolicyInstanceIDCol, e.Aggregate().InstanceID),
handler.NewCond(PrivacyPolicyResourceOwnerCol, e.Aggregate().ID),

View File

@ -247,11 +247,8 @@ func TestPrivacyPolicyProjection_reduces(t *testing.T) {
executer: &testExecuter{
executions: []execution{
{
expectedStmt: "UPDATE projections.privacy_policies3 SET (change_date, sequence, owner_removed) = ($1, $2, $3) WHERE (instance_id = $4) AND (resource_owner = $5)",
expectedStmt: "DELETE FROM projections.privacy_policies3 WHERE (instance_id = $1) AND (resource_owner = $2)",
expectedArgs: []interface{}{
anyArg{},
uint64(15),
true,
"instance-id",
"agg-id",
},

View File

@ -231,13 +231,8 @@ func (p *projectProjection) reduceOwnerRemoved(event eventstore.Event) (*handler
return nil, errors.ThrowInvalidArgumentf(nil, "PROJE-sbgru", "reduce.wrong.event.type %s", org.OrgRemovedEventType)
}
return crdb.NewUpdateStatement(
return crdb.NewDeleteStatement(
e,
[]handler.Column{
handler.NewCol(ProjectColumnChangeDate, e.CreationDate()),
handler.NewCol(ProjectColumnSequence, e.Sequence()),
handler.NewCol(ProjectColumnOwnerRemoved, true),
},
[]handler.Condition{
handler.NewCond(ProjectColumnInstanceID, e.Aggregate().InstanceID),
handler.NewCond(ProjectColumnResourceOwner, e.Aggregate().ID),

View File

@ -260,23 +260,13 @@ func (p *projectGrantProjection) reduceOwnerRemoved(event eventstore.Event) (*ha
return crdb.NewMultiStatement(
e,
crdb.AddUpdateStatement(
[]handler.Column{
handler.NewCol(ProjectGrantColumnChangeDate, e.CreationDate()),
handler.NewCol(ProjectGrantColumnSequence, e.Sequence()),
handler.NewCol(ProjectGrantColumnOwnerRemoved, true),
},
crdb.AddDeleteStatement(
[]handler.Condition{
handler.NewCond(ProjectGrantColumnInstanceID, e.Aggregate().InstanceID),
handler.NewCond(ProjectGrantColumnResourceOwner, e.Aggregate().ID),
},
),
crdb.AddUpdateStatement(
[]handler.Column{
handler.NewCol(ProjectGrantColumnChangeDate, e.CreationDate()),
handler.NewCol(ProjectGrantColumnSequence, e.Sequence()),
handler.NewCol(ProjectGrantColumnGrantedOrgRemoved, true),
},
crdb.AddDeleteStatement(
[]handler.Condition{
handler.NewCond(ProjectGrantColumnInstanceID, e.Aggregate().InstanceID),
handler.NewCond(ProjectGrantColumnGrantedOrgID, e.Aggregate().ID),

View File

@ -196,12 +196,7 @@ func (p *projectGrantMemberProjection) reduceOrgRemoved(event eventstore.Event)
e,
multiReduceMemberOwnerRemoved(e),
multiReduceMemberUserOwnerRemoved(e),
crdb.AddUpdateStatement(
[]handler.Column{
handler.NewCol(MemberChangeDate, e.CreationDate()),
handler.NewCol(MemberSequence, e.Sequence()),
handler.NewCol(ProjectGrantMemberGrantedOrgRemoved, true),
},
crdb.AddDeleteStatement(
[]handler.Condition{
handler.NewCond(ProjectGrantColumnInstanceID, e.Aggregate().InstanceID),
handler.NewCond(ProjectGrantMemberGrantedOrg, e.Aggregate().ID),

View File

@ -313,31 +313,22 @@ func TestProjectGrantMemberProjection_reduces(t *testing.T) {
executer: &testExecuter{
executions: []execution{
{
expectedStmt: "UPDATE projections.project_grant_members3 SET (change_date, sequence, owner_removed) = ($1, $2, $3) WHERE (instance_id = $4) AND (resource_owner = $5)",
expectedStmt: "DELETE FROM projections.project_grant_members3 WHERE (instance_id = $1) AND (resource_owner = $2)",
expectedArgs: []interface{}{
anyArg{},
uint64(15),
true,
"instance-id",
"agg-id",
},
},
{
expectedStmt: "UPDATE projections.project_grant_members3 SET (change_date, sequence, user_owner_removed) = ($1, $2, $3) WHERE (instance_id = $4) AND (user_resource_owner = $5)",
expectedStmt: "DELETE FROM projections.project_grant_members3 WHERE (instance_id = $1) AND (user_resource_owner = $2)",
expectedArgs: []interface{}{
anyArg{},
uint64(15),
true,
"instance-id",
"agg-id",
},
},
{
expectedStmt: "UPDATE projections.project_grant_members3 SET (change_date, sequence, granted_org_removed) = ($1, $2, $3) WHERE (instance_id = $4) AND (granted_org = $5)",
expectedStmt: "DELETE FROM projections.project_grant_members3 WHERE (instance_id = $1) AND (granted_org = $2)",
expectedArgs: []interface{}{
anyArg{},
uint64(15),
true,
"instance-id",
"agg-id",
},

View File

@ -281,21 +281,15 @@ func TestProjectGrantProjection_reduces(t *testing.T) {
executer: &testExecuter{
executions: []execution{
{
expectedStmt: "UPDATE projections.project_grants3 SET (change_date, sequence, owner_removed) = ($1, $2, $3) WHERE (instance_id = $4) AND (resource_owner = $5)",
expectedStmt: "DELETE FROM projections.project_grants3 WHERE (instance_id = $1) AND (resource_owner = $2)",
expectedArgs: []interface{}{
anyArg{},
uint64(15),
true,
"instance-id",
"agg-id",
},
},
{
expectedStmt: "UPDATE projections.project_grants3 SET (change_date, sequence, granted_org_removed) = ($1, $2, $3) WHERE (instance_id = $4) AND (granted_org_id = $5)",
expectedStmt: "DELETE FROM projections.project_grants3 WHERE (instance_id = $1) AND (granted_org_id = $2)",
expectedArgs: []interface{}{
anyArg{},
uint64(15),
true,
"instance-id",
"agg-id",
},

View File

@ -272,21 +272,15 @@ func TestProjectMemberProjection_reduces(t *testing.T) {
executer: &testExecuter{
executions: []execution{
{
expectedStmt: "UPDATE projections.project_members3 SET (change_date, sequence, owner_removed) = ($1, $2, $3) WHERE (instance_id = $4) AND (resource_owner = $5)",
expectedStmt: "DELETE FROM projections.project_members3 WHERE (instance_id = $1) AND (resource_owner = $2)",
expectedArgs: []interface{}{
anyArg{},
uint64(15),
true,
"instance-id",
"agg-id",
},
},
{
expectedStmt: "UPDATE projections.project_members3 SET (change_date, sequence, user_owner_removed) = ($1, $2, $3) WHERE (instance_id = $4) AND (user_resource_owner = $5)",
expectedStmt: "DELETE FROM projections.project_members3 WHERE (instance_id = $1) AND (user_resource_owner = $2)",
expectedArgs: []interface{}{
anyArg{},
uint64(15),
true,
"instance-id",
"agg-id",
},

View File

@ -184,13 +184,8 @@ func (p *projectRoleProjection) reduceOwnerRemoved(event eventstore.Event) (*han
return nil, errors.ThrowInvalidArgumentf(nil, "PROJE-3XrHY", "reduce.wrong.event.type %s", org.OrgRemovedEventType)
}
return crdb.NewUpdateStatement(
return crdb.NewDeleteStatement(
e,
[]handler.Column{
handler.NewCol(ProjectRoleColumnChangeDate, e.CreationDate()),
handler.NewCol(ProjectRoleColumnSequence, e.Sequence()),
handler.NewCol(ProjectRoleColumnOwnerRemoved, true),
},
[]handler.Condition{
handler.NewCond(ProjectRoleColumnInstanceID, e.Aggregate().InstanceID),
handler.NewCond(ProjectRoleColumnResourceOwner, e.Aggregate().ID),

View File

@ -203,11 +203,8 @@ func TestProjectRoleProjection_reduces(t *testing.T) {
executer: &testExecuter{
executions: []execution{
{
expectedStmt: "UPDATE projections.project_roles3 SET (change_date, sequence, owner_removed) = ($1, $2, $3) WHERE (instance_id = $4) AND (resource_owner = $5)",
expectedStmt: "DELETE FROM projections.project_roles3 WHERE (instance_id = $1) AND (resource_owner = $2)",
expectedArgs: []interface{}{
anyArg{},
uint64(15),
true,
"instance-id",
"agg-id",
},

View File

@ -241,11 +241,8 @@ func TestProjectProjection_reduces(t *testing.T) {
executer: &testExecuter{
executions: []execution{
{
expectedStmt: "UPDATE projections.projects3 SET (change_date, sequence, owner_removed) = ($1, $2, $3) WHERE (instance_id = $4) AND (resource_owner = $5)",
expectedStmt: "DELETE FROM projections.projects3 WHERE (instance_id = $1) AND (resource_owner = $2)",
expectedArgs: []interface{}{
anyArg{},
uint64(15),
true,
"instance-id",
"agg-id",
},

View File

@ -1064,13 +1064,8 @@ func (p *userProjection) reduceOwnerRemoved(event eventstore.Event) (*handler.St
return nil, errors.ThrowInvalidArgumentf(nil, "PROJE-NCsdV", "reduce.wrong.event.type %s", org.OrgRemovedEventType)
}
return crdb.NewUpdateStatement(
return crdb.NewDeleteStatement(
e,
[]handler.Column{
handler.NewCol(UserChangeDateCol, e.CreationDate()),
handler.NewCol(UserSequenceCol, e.Sequence()),
handler.NewCol(UserOwnerRemovedCol, true),
},
[]handler.Condition{
handler.NewCond(UserInstanceIDCol, e.Aggregate().InstanceID),
handler.NewCond(UserResourceOwnerCol, e.Aggregate().ID),

View File

@ -298,13 +298,8 @@ func (p *userAuthMethodProjection) reduceOwnerRemoved(event eventstore.Event) (*
return nil, errors.ThrowInvalidArgumentf(nil, "PROJE-FwDZ8", "reduce.wrong.event.type %s", org.OrgRemovedEventType)
}
return crdb.NewUpdateStatement(
return crdb.NewDeleteStatement(
e,
[]handler.Column{
handler.NewCol(UserAuthMethodChangeDateCol, e.CreationDate()),
handler.NewCol(UserAuthMethodSequenceCol, e.Sequence()),
handler.NewCol(UserAuthMethodOwnerRemovedCol, true),
},
[]handler.Condition{
handler.NewCond(UserAuthMethodInstanceIDCol, e.Aggregate().InstanceID),
handler.NewCond(UserAuthMethodResourceOwnerCol, e.Aggregate().ID),

View File

@ -509,11 +509,8 @@ func TestUserAuthMethodProjection_reduces(t *testing.T) {
executer: &testExecuter{
executions: []execution{
{
expectedStmt: "UPDATE projections.user_auth_methods4 SET (change_date, sequence, owner_removed) = ($1, $2, $3) WHERE (instance_id = $4) AND (resource_owner = $5)",
expectedStmt: "DELETE FROM projections.user_auth_methods4 WHERE (instance_id = $1) AND (resource_owner = $2)",
expectedArgs: []interface{}{
anyArg{},
uint64(15),
true,
"instance-id",
"agg-id",
},

View File

@ -396,45 +396,25 @@ func (p *userGrantProjection) reduceOwnerRemoved(event eventstore.Event) (*handl
return crdb.NewMultiStatement(
e,
crdb.AddUpdateStatement(
[]handler.Column{
handler.NewCol(UserGrantChangeDate, e.CreationDate()),
handler.NewCol(UserGrantSequence, e.Sequence()),
handler.NewCol(UserGrantOwnerRemoved, true),
},
crdb.AddDeleteStatement(
[]handler.Condition{
handler.NewCond(UserGrantInstanceID, e.Aggregate().InstanceID),
handler.NewCond(UserGrantResourceOwner, e.Aggregate().ID),
},
),
crdb.AddUpdateStatement(
[]handler.Column{
handler.NewCol(UserGrantChangeDate, e.CreationDate()),
handler.NewCol(UserGrantSequence, e.Sequence()),
handler.NewCol(UserGrantUserOwnerRemoved, true),
},
crdb.AddDeleteStatement(
[]handler.Condition{
handler.NewCond(UserGrantInstanceID, e.Aggregate().InstanceID),
handler.NewCond(UserGrantResourceOwnerUser, e.Aggregate().ID),
},
),
crdb.AddUpdateStatement(
[]handler.Column{
handler.NewCol(UserGrantChangeDate, e.CreationDate()),
handler.NewCol(UserGrantSequence, e.Sequence()),
handler.NewCol(UserGrantProjectOwnerRemoved, true),
},
crdb.AddDeleteStatement(
[]handler.Condition{
handler.NewCond(UserGrantInstanceID, e.Aggregate().InstanceID),
handler.NewCond(UserGrantResourceOwnerProject, e.Aggregate().ID),
},
),
crdb.AddUpdateStatement(
[]handler.Column{
handler.NewCol(UserGrantChangeDate, e.CreationDate()),
handler.NewCol(UserGrantSequence, e.Sequence()),
handler.NewCol(UserGrantGrantedOrgRemoved, true),
},
crdb.AddDeleteStatement(
[]handler.Condition{
handler.NewCond(UserGrantInstanceID, e.Aggregate().InstanceID),
handler.NewCond(UserGrantGrantedOrg, e.Aggregate().ID),

View File

@ -517,41 +517,29 @@ func TestUserGrantProjection_reduces(t *testing.T) {
executer: &testExecuter{
executions: []execution{
{
expectedStmt: "UPDATE projections.user_grants3 SET (change_date, sequence, owner_removed) = ($1, $2, $3) WHERE (instance_id = $4) AND (resource_owner = $5)",
expectedStmt: "DELETE FROM projections.user_grants3 WHERE (instance_id = $1) AND (resource_owner = $2)",
expectedArgs: []interface{}{
anyArg{},
uint64(15),
true,
"instance-id",
"agg-id",
},
},
{
expectedStmt: "UPDATE projections.user_grants3 SET (change_date, sequence, user_owner_removed) = ($1, $2, $3) WHERE (instance_id = $4) AND (resource_owner_user = $5)",
expectedStmt: "DELETE FROM projections.user_grants3 WHERE (instance_id = $1) AND (resource_owner_user = $2)",
expectedArgs: []interface{}{
anyArg{},
uint64(15),
true,
"instance-id",
"agg-id",
},
},
{
expectedStmt: "UPDATE projections.user_grants3 SET (change_date, sequence, project_owner_removed) = ($1, $2, $3) WHERE (instance_id = $4) AND (resource_owner_project = $5)",
expectedStmt: "DELETE FROM projections.user_grants3 WHERE (instance_id = $1) AND (resource_owner_project = $2)",
expectedArgs: []interface{}{
anyArg{},
uint64(15),
true,
"instance-id",
"agg-id",
},
},
{
expectedStmt: "UPDATE projections.user_grants3 SET (change_date, sequence, granted_org_removed) = ($1, $2, $3) WHERE (instance_id = $4) AND (granted_org = $5)",
expectedStmt: "DELETE FROM projections.user_grants3 WHERE (instance_id = $1) AND (granted_org = $2)",
expectedArgs: []interface{}{
anyArg{},
uint64(15),
true,
"instance-id",
"agg-id",
},

View File

@ -163,13 +163,8 @@ func (p *userMetadataProjection) reduceOwnerRemoved(event eventstore.Event) (*ha
return nil, errors.ThrowInvalidArgumentf(nil, "PROJE-oqwul", "reduce.wrong.event.type %s", org.OrgRemovedEventType)
}
return crdb.NewUpdateStatement(
return crdb.NewDeleteStatement(
e,
[]handler.Column{
handler.NewCol(UserMetadataColumnChangeDate, e.CreationDate()),
handler.NewCol(UserMetadataColumnSequence, e.Sequence()),
handler.NewCol(UserMetadataColumnOwnerRemoved, true),
},
[]handler.Condition{
handler.NewCond(UserMetadataColumnInstanceID, e.Aggregate().InstanceID),
handler.NewCond(UserMetadataColumnResourceOwner, e.Aggregate().ID),

View File

@ -159,11 +159,8 @@ func TestUserMetadataProjection_reduces(t *testing.T) {
executer: &testExecuter{
executions: []execution{
{
expectedStmt: "UPDATE projections.user_metadata4 SET (change_date, sequence, owner_removed) = ($1, $2, $3) WHERE (instance_id = $4) AND (resource_owner = $5)",
expectedStmt: "DELETE FROM projections.user_metadata4 WHERE (instance_id = $1) AND (resource_owner = $2)",
expectedArgs: []interface{}{
anyArg{},
uint64(15),
true,
"instance-id",
"agg-id",
},

View File

@ -155,13 +155,8 @@ func (p *personalAccessTokenProjection) reduceOwnerRemoved(event eventstore.Even
return nil, errors.ThrowInvalidArgumentf(nil, "PROJE-zQVhl", "reduce.wrong.event.type %s", org.OrgRemovedEventType)
}
return crdb.NewUpdateStatement(
return crdb.NewDeleteStatement(
e,
[]handler.Column{
handler.NewCol(PersonalAccessTokenColumnChangeDate, e.CreationDate()),
handler.NewCol(PersonalAccessTokenColumnSequence, e.Sequence()),
handler.NewCol(PersonalAccessTokenColumnOwnerRemoved, true),
},
[]handler.Condition{
handler.NewCond(PersonalAccessTokenColumnInstanceID, e.Aggregate().InstanceID),
handler.NewCond(PersonalAccessTokenColumnResourceOwner, e.Aggregate().ID),

View File

@ -129,11 +129,8 @@ func TestPersonalAccessTokenProjection_reduces(t *testing.T) {
executer: &testExecuter{
executions: []execution{
{
expectedStmt: "UPDATE projections.personal_access_tokens3 SET (change_date, sequence, owner_removed) = ($1, $2, $3) WHERE (instance_id = $4) AND (resource_owner = $5)",
expectedStmt: "DELETE FROM projections.personal_access_tokens3 WHERE (instance_id = $1) AND (resource_owner = $2)",
expectedArgs: []interface{}{
anyArg{},
uint64(15),
true,
"instance-id",
"agg-id",
},

View File

@ -1713,11 +1713,8 @@ func TestUserProjection_reduces(t *testing.T) {
executer: &testExecuter{
executions: []execution{
{
expectedStmt: "UPDATE projections.users8 SET (change_date, sequence, owner_removed) = ($1, $2, $3) WHERE (instance_id = $4) AND (resource_owner = $5)",
expectedStmt: "DELETE FROM projections.users8 WHERE (instance_id = $1) AND (resource_owner = $2)",
expectedArgs: []interface{}{
anyArg{},
uint64(15),
true,
"instance-id",
"agg-id",
},

View File

@ -33,14 +33,14 @@ var (
", projections.users8_humans.avatar_key" +
", projections.login_names2.login_name" +
", projections.user_grants3.resource_owner" +
", projections.orgs.name" +
", projections.orgs.primary_domain" +
", projections.orgs1.name" +
", projections.orgs1.primary_domain" +
", projections.user_grants3.project_id" +
", projections.projects3.name" +
" FROM projections.user_grants3" +
" LEFT JOIN projections.users8 ON projections.user_grants3.user_id = projections.users8.id AND projections.user_grants3.instance_id = projections.users8.instance_id" +
" LEFT JOIN projections.users8_humans ON projections.user_grants3.user_id = projections.users8_humans.user_id AND projections.user_grants3.instance_id = projections.users8_humans.instance_id" +
" LEFT JOIN projections.orgs ON projections.user_grants3.resource_owner = projections.orgs.id AND projections.user_grants3.instance_id = projections.orgs.instance_id" +
" LEFT JOIN projections.orgs1 ON projections.user_grants3.resource_owner = projections.orgs1.id AND projections.user_grants3.instance_id = projections.orgs1.instance_id" +
" LEFT JOIN projections.projects3 ON projections.user_grants3.project_id = projections.projects3.id AND projections.user_grants3.instance_id = projections.projects3.instance_id" +
" LEFT JOIN projections.login_names2 ON projections.user_grants3.user_id = projections.login_names2.user_id AND projections.user_grants3.instance_id = projections.login_names2.instance_id" +
` AS OF SYSTEM TIME '-1 ms' ` +
@ -88,15 +88,15 @@ var (
", projections.users8_humans.avatar_key" +
", projections.login_names2.login_name" +
", projections.user_grants3.resource_owner" +
", projections.orgs.name" +
", projections.orgs.primary_domain" +
", projections.orgs1.name" +
", projections.orgs1.primary_domain" +
", projections.user_grants3.project_id" +
", projections.projects3.name" +
", COUNT(*) OVER ()" +
" FROM projections.user_grants3" +
" LEFT JOIN projections.users8 ON projections.user_grants3.user_id = projections.users8.id AND projections.user_grants3.instance_id = projections.users8.instance_id" +
" LEFT JOIN projections.users8_humans ON projections.user_grants3.user_id = projections.users8_humans.user_id AND projections.user_grants3.instance_id = projections.users8_humans.instance_id" +
" LEFT JOIN projections.orgs ON projections.user_grants3.resource_owner = projections.orgs.id AND projections.user_grants3.instance_id = projections.orgs.instance_id" +
" LEFT JOIN projections.orgs1 ON projections.user_grants3.resource_owner = projections.orgs1.id AND projections.user_grants3.instance_id = projections.orgs1.instance_id" +
" LEFT JOIN projections.projects3 ON projections.user_grants3.project_id = projections.projects3.id AND projections.user_grants3.instance_id = projections.projects3.instance_id" +
" LEFT JOIN projections.login_names2 ON projections.user_grants3.user_id = projections.login_names2.user_id AND projections.user_grants3.instance_id = projections.login_names2.instance_id" +
` AS OF SYSTEM TIME '-1 ms' ` +

View File

@ -28,7 +28,7 @@ var (
", memberships.grant_id" +
", projections.project_grants3.granted_org_id" +
", projections.projects3.name" +
", projections.orgs.name" +
", projections.orgs1.name" +
", COUNT(*) OVER ()" +
" FROM (" +
"SELECT members.user_id" +
@ -88,7 +88,7 @@ var (
" WHERE members.granted_org_removed = $7 AND members.owner_removed = $8 AND members.user_owner_removed = $9" +
") AS memberships" +
" LEFT JOIN projections.projects3 ON memberships.project_id = projections.projects3.id AND memberships.instance_id = projections.projects3.instance_id" +
" LEFT JOIN projections.orgs ON memberships.org_id = projections.orgs.id AND memberships.instance_id = projections.orgs.instance_id" +
" LEFT JOIN projections.orgs1 ON memberships.org_id = projections.orgs1.id AND memberships.instance_id = projections.orgs1.instance_id" +
" LEFT JOIN projections.project_grants3 ON memberships.grant_id = projections.project_grants3.grant_id AND memberships.instance_id = projections.project_grants3.instance_id" +
` AS OF SYSTEM TIME '-1 ms'`)
membershipCols = []string{

View File

@ -844,7 +844,7 @@ service AdminService {
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
tags: "Organizations";
summary: "Remove Organization";
description: "Sets the state of the organization and all its resource (Users, Projects, Grants to and from the org) to remove. Users of this organization will not be able to log in."
description: "Deletes the organization and all its resources (Users, Projects, Grants to and from the org). Users of this organization will not be able to log in."
responses: {
key: "200";
value: {

View File

@ -2027,7 +2027,7 @@ service ManagementService {
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
tags: "Organizations";
summary: "Delete Organization";
description: "Sets the state of my organization and all its resource (Users, Projects, Grants to and from the org) to remove. Users of this organization will not be able to log in."
description: "Deletes my organization and all its resources (Users, Projects, Grants to and from the org). Users of this organization will not be able to log in."
parameters: {
headers: {
name: "x-zitadel-orgid";