zitadel/cmd/initialise/sql
Silvan b5564572bc
feat(eventstore): increase parallel write capabilities (#5940)
This implementation increases parallel write capabilities of the eventstore.
Please have a look at the technical advisories: [05](https://zitadel.com/docs/support/advisory/a10005) and  [06](https://zitadel.com/docs/support/advisory/a10006).
The implementation of eventstore.push is rewritten and stored events are migrated to a new table `eventstore.events2`.
If you are using cockroach: make sure that the database user of ZITADEL has `VIEWACTIVITY` grant. This is used to query events.
2023-10-19 12:19:10 +02:00
..
cockroach feat(eventstore): increase parallel write capabilities (#5940) 2023-10-19 12:19:10 +02:00
postgres feat(eventstore): increase parallel write capabilities (#5940) 2023-10-19 12:19:10 +02:00
README.md fix: enable env vars in setup steps (and deprecate admin subcommand) (#3871) 2022-06-27 10:32:34 +00:00

SQL initialisation

The sql-files in this folder initialize the ZITADEL database and user. These objects need to exist before ZITADEL is able to set and start up.

files

  • 01_user.sql: create the user zitadel uses to connect to the database
  • 02_database.sql: create the database for zitadel
  • 03_grant_user.sql: grants the user created before to have full access to its database. The user needs full access to the database because zitadel makes ddl/dml on runtime
  • 04_eventstore.sql: creates the schema needed for eventsourcing
  • 05_projections.sql: creates the schema needed to read the data
  • 06_system.sql: creates the schema needed for ZITADEL itself
  • 07_encryption_keys_table.sql: creates the table for encryption keys (for event data)
  • files 08_enable_hash_sharded_indexes.sql and 09_events_table.sql must run in the same session
    • 08_enable_hash_sharded_indexes.sql enables the hash sharded index feature for this session
    • 09_events_table.sql creates the table for eventsourcing