feat(settings_relational): adding settings table for relational db (#10769)

# Which Problems Are Solved

As part of https://github.com/zitadel/zitadel/issues/9599 to push to
move to a relational db table model, this is the migration of the
settings

# Additional Changes

I had to add 2 non source code files
`backend/v3/storage/database/events_testing/font.otf` and
`backend/v3/storage/database/events_testing/picture.png`, these are used
as part of the reduce tests, hence why they're sourced inside
`backend/v3/storage/database/events_testing/settings_instance_test.go`

- Closes https://github.com/zitadel/zitadel/issues/10207

---------

Co-authored-by: adlerhurst <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Tim Möhlmann <[email protected]>
Co-authored-by: Stefan Benz <[email protected]>
This commit is contained in:
Iraq
2025-12-02 08:16:21 +01:00
committed by GitHub
co-authored by adlerhurst Copilot Tim Möhlmann Stefan Benz
parent 6c8619e2f0
commit 911967c865
30 changed files with 12316 additions and 27 deletions
@@ -110,7 +110,10 @@ func (i instance) Update(ctx context.Context, client database.QueryExecutor, id
var builder database.StatementBuilder
builder.WriteString(`UPDATE zitadel.instances SET `)
database.Changes(changes).Write(&builder)
err := database.Changes(changes).Write(&builder)
if err != nil {
return 0, err
}
idCondition := i.IDCondition(id)
writeCondition(&builder, idCondition)
@@ -149,15 +152,19 @@ func (i instance) SetUpdatedAt(time time.Time) database.Change {
func (i instance) SetIAMProject(id string) database.Change {
return database.NewChange(i.IAMProjectIDColumn(), id)
}
func (i instance) SetDefaultOrg(id string) database.Change {
return database.NewChange(i.DefaultOrgIDColumn(), id)
}
func (i instance) SetDefaultLanguage(lang language.Tag) database.Change {
return database.NewChange(i.DefaultLanguageColumn(), lang.String())
}
func (i instance) SetConsoleClientID(id string) database.Change {
return database.NewChange(i.ConsoleClientIDColumn(), id)
}
func (i instance) SetConsoleAppID(id string) database.Change {
return database.NewChange(i.ConsoleAppIDColumn(), id)
}
@@ -182,7 +189,6 @@ func (i instance) NameCondition(op database.TextOperation, name string) database
// ExistsDomain creates a correlated [database.Exists] condition on instance_domains.
// Use this filter to make sure the Instance returned contains a specific domain.
// of the instance in the aggregated result.
// Example usage:
//
// domainRepo := instanceRepo.Domains(true) // ensure domains are loaded/aggregated