zitadel/cmd
Tim Möhlmann 6f6e2234eb
fix(migrations): clean stale org fields using events (#9051)
# Which Problems Are Solved

Migration step 39 is supposed to cleanup stale organization entries in
the eventstore.fields table. In order to do this it used the projection
to check which orgs still exist.

During initial setup of ZITADEL the first instance with the organization
is created. Howevet, the projections are filled after all migrations are
done. With the organization projection empty, the fields of the first
org would be deleted.

This was discovered during development of a new field type. The
accosiated events did not yet have any projection based filled assigned.
It seems fields with a pre-fill projection are somehow restored.
Therefore a restoration migration isn't required IMO.

# How the Problems Are Solved

Query the event store for `org.removed` events instead. This has the
drawback of using a sequential scan on the eventstore, making the
migration more expensive.

# Additional Changes

- none

# Additional Context

- Introduced in https://github.com/zitadel/zitadel/pull/8946
2024-12-12 18:37:18 +02:00
..
admin chore: test server for direct resource access 2023-04-24 20:40:31 +03:00
build fix: allow version to be overwritten by build again (#4656) 2022-11-07 09:50:44 +00:00
encryption feat: action v2 signing (#8779) 2024-11-28 10:06:52 +00:00
hooks feat: support whole config as env (#6336) 2024-02-16 16:04:42 +00:00
initialise refactor(eventstore): move push logic to sql (#8816) 2024-12-04 13:51:40 +00:00
key feat: api v2beta to api v2 (#8283) 2024-07-26 22:39:55 +02:00
mirror feat: action v2 signing (#8779) 2024-11-28 10:06:52 +00:00
ready feat(v3alpha): web key resource (#8262) 2024-08-14 14:18:14 +00:00
setup fix(migrations): clean stale org fields using events (#9051) 2024-12-12 18:37:18 +02:00
start refactor(handler): cache active instances (#9008) 2024-12-06 11:32:53 +00:00
tls fix: enable env vars in setup steps (and deprecate admin subcommand) (#3871) 2022-06-27 10:32:34 +00:00
defaults.yaml refactor(handler): cache active instances (#9008) 2024-12-06 11:32:53 +00:00
zitadel.go fix(mirror): read config correctly (#8330) 2024-07-18 14:00:58 +00:00