mirror of
https://github.com/zitadel/zitadel.git
synced 2024-12-18 05:47:32 +00:00
30c130f102
* fix(projections): add base users * add user v1 events
46 lines
1.0 KiB
SQL
46 lines
1.0 KiB
SQL
CREATE TABLE zitadel.projections.users(
|
|
id STRING
|
|
, creation_date TIMESTAMPTZ
|
|
, change_date TIMESTAMPTZ
|
|
, resource_owner STRING NOT NULL
|
|
, state INT2
|
|
, sequence INT8
|
|
|
|
, username STRING
|
|
|
|
, PRIMARY KEY (id)
|
|
, INDEX idx_username (username)
|
|
);
|
|
|
|
CREATE TABLE zitadel.projections.users_machines(
|
|
user_id STRING REFERENCES zitadel.projections.users (id) ON DELETE CASCADE
|
|
|
|
, name STRING NOT NULL
|
|
, description STRING
|
|
|
|
, PRIMARY KEY (user_id)
|
|
);
|
|
|
|
CREATE TABLE zitadel.projections.users_humans(
|
|
user_id STRING REFERENCES zitadel.projections.users (id) ON DELETE CASCADE
|
|
|
|
--profile
|
|
, first_name STRING NOT NULL
|
|
, last_name STRING NOT NULL
|
|
, nick_name STRING
|
|
, display_name STRING
|
|
, preferred_language VARCHAR(10)
|
|
, gender INT2
|
|
, avater_key STRING
|
|
|
|
--email
|
|
, email STRING NOT NULL
|
|
, is_email_verified BOOLEAN NOT NULL DEFAULT false
|
|
|
|
--phone
|
|
, phone STRING
|
|
, is_phone_verified BOOLEAN
|
|
|
|
, PRIMARY KEY (user_id)
|
|
);
|