zitadel/cmd/setup/23.go
Silvan e0e5665e17
fix(eventstore): consider IsGlobal-flag of constraints (#7518)
* fix(eventstore): consider `IsGlobal`-flag of constraints

* fix(setup): set `instance_domain`-constraint global

(cherry picked from commit 60ee2610f2ae67e2e33ac8c08df739c44d397809)
2024-03-11 08:44:39 +01:00

28 lines
584 B
Go

package setup
import (
"context"
_ "embed"
"github.com/zitadel/zitadel/internal/database"
"github.com/zitadel/zitadel/internal/eventstore"
)
var (
//go:embed 23.sql
correctGlobalUniqueConstraints string
)
type CorrectGlobalUniqueConstraints struct {
dbClient *database.DB
}
func (mig *CorrectGlobalUniqueConstraints) Execute(ctx context.Context, _ eventstore.Event) error {
_, err := mig.dbClient.ExecContext(ctx, correctGlobalUniqueConstraints)
return err
}
func (mig *CorrectGlobalUniqueConstraints) String() string {
return "23_correct_global_unique_constraints"
}