fix: fix and improve primary keys on projections (#3708)

* fix: org_domain projection

* fix: projection reset

* fix test

* improve foreign keys on suffixed tables
This commit is contained in:
Livio Amstutz
2022-05-25 14:15:13 +02:00
committed by GitHub
parent 79452da7d6
commit 737e01bfd2
20 changed files with 403 additions and 156 deletions

View File

@@ -21,6 +21,7 @@ var _ system.SystemServiceServer = (*Server)(nil)
type Server struct {
system.UnimplementedSystemServiceServer
database string
command *command.Commands
query *query.Queries
administrator repository.AdministratorRepository
@@ -34,12 +35,14 @@ type Config struct {
func CreateServer(command *command.Commands,
query *query.Queries,
repo repository.Repository,
database string,
defaultInstance command.InstanceSetup,
) *Server {
return &Server{
command: command,
query: query,
administrator: repo,
database: database,
DefaultInstance: defaultInstance,
}
}

View File

@@ -25,7 +25,7 @@ func (s *Server) ListViews(ctx context.Context, _ *system_pb.ListViewsRequest) (
func (s *Server) ClearView(ctx context.Context, req *system_pb.ClearViewRequest) (*system_pb.ClearViewResponse, error) {
var err error
if req.Database != "zitadel" {
if req.Database != s.database {
err = s.administrator.ClearView(ctx, req.Database, req.ViewName)
} else {
err = s.query.ClearCurrentSequence(ctx, req.ViewName)