mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-12 00:27:31 +00:00
perf: remove owner removed columns from projections for oidc (#6925)
* fix: remove owner removed columns from login names projection * fix: remove owner removed columns from flow projection * fix: remove owner removed columns from project, projectgrant and member projections * fix: correct unit tests for session projection * fix: correct unit tests for session projection
This commit is contained in:
@@ -61,18 +61,16 @@ func TestOrgMemberProjection_reduces(t *testing.T) {
|
||||
executer: &testExecuter{
|
||||
executions: []execution{
|
||||
{
|
||||
expectedStmt: "INSERT INTO projections.org_members3 (user_id, user_resource_owner, user_owner_removed, roles, creation_date, change_date, sequence, resource_owner, instance_id, owner_removed, org_id) VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11)",
|
||||
expectedStmt: "INSERT INTO projections.org_members4 (user_id, user_resource_owner, roles, creation_date, change_date, sequence, resource_owner, instance_id, org_id) VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9)",
|
||||
expectedArgs: []interface{}{
|
||||
"user-id",
|
||||
"org1",
|
||||
false,
|
||||
database.TextArray[string]{"role"},
|
||||
anyArg{},
|
||||
anyArg{},
|
||||
uint64(15),
|
||||
"ro-id",
|
||||
"instance-id",
|
||||
false,
|
||||
"agg-id",
|
||||
},
|
||||
},
|
||||
@@ -100,7 +98,7 @@ func TestOrgMemberProjection_reduces(t *testing.T) {
|
||||
executer: &testExecuter{
|
||||
executions: []execution{
|
||||
{
|
||||
expectedStmt: "UPDATE projections.org_members3 SET (roles, change_date, sequence) = ($1, $2, $3) WHERE (instance_id = $4) AND (user_id = $5) AND (org_id = $6)",
|
||||
expectedStmt: "UPDATE projections.org_members4 SET (roles, change_date, sequence) = ($1, $2, $3) WHERE (instance_id = $4) AND (user_id = $5) AND (org_id = $6)",
|
||||
expectedArgs: []interface{}{
|
||||
database.TextArray[string]{"role", "changed"},
|
||||
anyArg{},
|
||||
@@ -133,7 +131,7 @@ func TestOrgMemberProjection_reduces(t *testing.T) {
|
||||
executer: &testExecuter{
|
||||
executions: []execution{
|
||||
{
|
||||
expectedStmt: "DELETE FROM projections.org_members3 WHERE (instance_id = $1) AND (user_id = $2) AND (org_id = $3)",
|
||||
expectedStmt: "DELETE FROM projections.org_members4 WHERE (instance_id = $1) AND (user_id = $2) AND (org_id = $3)",
|
||||
expectedArgs: []interface{}{
|
||||
"instance-id",
|
||||
"user-id",
|
||||
@@ -163,7 +161,7 @@ func TestOrgMemberProjection_reduces(t *testing.T) {
|
||||
executer: &testExecuter{
|
||||
executions: []execution{
|
||||
{
|
||||
expectedStmt: "DELETE FROM projections.org_members3 WHERE (instance_id = $1) AND (user_id = $2) AND (org_id = $3)",
|
||||
expectedStmt: "DELETE FROM projections.org_members4 WHERE (instance_id = $1) AND (user_id = $2) AND (org_id = $3)",
|
||||
expectedArgs: []interface{}{
|
||||
"instance-id",
|
||||
"user-id",
|
||||
@@ -191,7 +189,7 @@ func TestOrgMemberProjection_reduces(t *testing.T) {
|
||||
executer: &testExecuter{
|
||||
executions: []execution{
|
||||
{
|
||||
expectedStmt: "DELETE FROM projections.org_members3 WHERE (instance_id = $1) AND (user_id = $2)",
|
||||
expectedStmt: "DELETE FROM projections.org_members4 WHERE (instance_id = $1) AND (user_id = $2)",
|
||||
expectedArgs: []interface{}{
|
||||
"instance-id",
|
||||
"agg-id",
|
||||
@@ -218,14 +216,14 @@ func TestOrgMemberProjection_reduces(t *testing.T) {
|
||||
executer: &testExecuter{
|
||||
executions: []execution{
|
||||
{
|
||||
expectedStmt: "DELETE FROM projections.org_members3 WHERE (instance_id = $1) AND (resource_owner = $2)",
|
||||
expectedStmt: "DELETE FROM projections.org_members4 WHERE (instance_id = $1) AND (resource_owner = $2)",
|
||||
expectedArgs: []interface{}{
|
||||
"instance-id",
|
||||
"agg-id",
|
||||
},
|
||||
},
|
||||
{
|
||||
expectedStmt: "DELETE FROM projections.org_members3 WHERE (instance_id = $1) AND (user_resource_owner = $2)",
|
||||
expectedStmt: "DELETE FROM projections.org_members4 WHERE (instance_id = $1) AND (user_resource_owner = $2)",
|
||||
expectedArgs: []interface{}{
|
||||
"instance-id",
|
||||
"agg-id",
|
||||
@@ -252,7 +250,7 @@ func TestOrgMemberProjection_reduces(t *testing.T) {
|
||||
executer: &testExecuter{
|
||||
executions: []execution{
|
||||
{
|
||||
expectedStmt: "DELETE FROM projections.org_members3 WHERE (instance_id = $1)",
|
||||
expectedStmt: "DELETE FROM projections.org_members4 WHERE (instance_id = $1)",
|
||||
expectedArgs: []interface{}{
|
||||
"agg-id",
|
||||
},
|
||||
|
Reference in New Issue
Block a user