Add ID column to domains table and update repository implementation

Co-authored-by: adlerhurst <27845747+adlerhurst@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2025-07-14 20:11:28 +00:00
parent d3de8a2150
commit 655f9be015
6 changed files with 537 additions and 37 deletions

View File

@@ -15,6 +15,7 @@ import (
const (
DomainsTable = "zitadel.domains"
DomainsIDCol = "id"
DomainsInstanceIDCol = "instance_id"
DomainsOrgIDCol = "org_id"
DomainsDomainCol = "domain"
@@ -40,6 +41,7 @@ func (*domainsProjection) Init() *old_handler.Check {
// The table is created by migration, so we just need to check it exists
return handler.NewTableCheck(
handler.NewTable([]*handler.InitColumn{
handler.NewColumn(DomainsIDCol, handler.ColumnTypeText),
handler.NewColumn(DomainsInstanceIDCol, handler.ColumnTypeText),
handler.NewColumn(DomainsOrgIDCol, handler.ColumnTypeText),
handler.NewColumn(DomainsDomainCol, handler.ColumnTypeText),
@@ -50,7 +52,7 @@ func (*domainsProjection) Init() *old_handler.Check {
handler.NewColumn(DomainsUpdatedAtCol, handler.ColumnTypeTimestamp),
handler.NewColumn(DomainsDeletedAtCol, handler.ColumnTypeTimestamp),
},
// Note: We don't define primary key here since the table is created by migration
handler.NewPrimaryKey(DomainsIDCol),
),
)
}