refactor: relational organization projection to use repository (#11621)

- Transitioned from using `handler.Statements` to a repository pattern
for managing organization data in migrations.
- Introduced a new method to set the updated timestamp for
organizations.
- Updated the projection logic to utilize the repository for creating,
updating, and deleting organization records.
This commit is contained in:
Silvan
2026-03-05 14:55:42 +01:00
committed by GitHub
parent 90faf440f4
commit 07dbb48cc7
7 changed files with 155 additions and 105 deletions
@@ -64,7 +64,9 @@ func (p projectGrant) Create(ctx context.Context, client database.QueryExecutor,
// separate statement to add roles to project grant
builder := database.NewStatementBuilder(insertProjectGrantRolesStmt, projectGrant.RoleKeys)
builder.WriteString(`INSERT INTO ` + p.qualifiedTableName() + ` (instance_id, id, project_id, granting_organization_id, granted_organization_id, state, created_at, updated_at) VALUES ( `)
builder.WriteString(`INSERT INTO `)
builder.WriteString(p.qualifiedTableName())
builder.WriteString(` (instance_id, id, project_id, granting_organization_id, granted_organization_id, state, created_at, updated_at) VALUES ( `)
builder.WriteArgs(
projectGrant.InstanceID,
projectGrant.ID,