zitadel/cmd/admin/initialise/sql
Livio Amstutz 32afa77b97
fix: compatibility for cockroach v22.1 (#3754)
* fix: compatability for cockroach v22.1

* update cr version in docs and compose

* bind dev cockroach to 127.0.0.1

* Revert "bind dev cockroach to 127.0.0.1"

This reverts commit 1c7c6304ae.

* remove --listen-addr flag

* use v2.0.0-v2-alpha.16

* use v2.0.0-v2-alpha.17

Co-authored-by: Elio Bischof <eliobischof@gmail.com>
2022-06-01 11:41:01 +02:00
..
01_user.sql fix: compatibility for cockroach v22.1 (#3754) 2022-06-01 11:41:01 +02:00
02_database.sql fix: init sub commands (#3218) 2022-02-16 12:30:49 +00:00
03_grant_user.sql fix: init sub commands (#3218) 2022-02-16 12:30:49 +00:00
04_eventstore.sql fix: init sub commands (#3218) 2022-02-16 12:30:49 +00:00
05_projections.sql fix: init sub commands (#3218) 2022-02-16 12:30:49 +00:00
06_system.sql feat: encryption keys in database (#3265) 2022-03-14 07:55:09 +01:00
07_encryption_keys_table.sql feat: encryption keys in database (#3265) 2022-03-14 07:55:09 +01:00
08_enable_hash_sharded_indexes.sql feat: encryption keys in database (#3265) 2022-03-14 07:55:09 +01:00
09_events_table.sql feat: handle instanceID in projections (#3442) 2022-04-19 08:26:12 +02:00
10_system_sequence.sql feat: add tenant column to eventstore (#3314) 2022-03-15 07:19:02 +01:00
11_unique_constraints_table.sql feat(cli): setup (#3267) 2022-03-28 10:05:09 +02:00
README.md feat: encryption keys in database (#3265) 2022-03-14 07:55:09 +01: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