zitadel/migrations/cockroach/V1.98__keys.sql
Livio Amstutz f0a77e80bf
fix: add keys to projections (#2728)
* fix: add keys to projections

* change to multiple tables

* merge

* change migration version

* merge

* Update migrations/cockroach/V1.98__keys.sql

Co-authored-by: Silvan <silvan.reusser@gmail.com>

* Update migrations/cockroach/V1.98__keys.sql

Co-authored-by: Silvan <silvan.reusser@gmail.com>

* check keys

Co-authored-by: Silvan <silvan.reusser@gmail.com>
2021-12-06 16:57:35 +01:00

28 lines
702 B
SQL

CREATE TABLE zitadel.projections.keys (
id STRING,
creation_date TIMESTAMPTZ NOT NULL,
change_date TIMESTAMPTZ NOT NULL,
resource_owner STRING NOT NULL,
sequence INT8 NOT NULL,
algorithm STRING DEFAULT '' NOT NULL,
use STRING DEFAULT '' NOT NULL,
PRIMARY KEY (id)
);
CREATE TABLE zitadel.projections.keys_private(
id STRING REFERENCES zitadel.projections.keys ON DELETE NO ACTION,
expiry TIMESTAMPTZ NOT NULL,
key JSONB NOT NULL,
PRIMARY KEY (id)
);
CREATE TABLE zitadel.projections.keys_public (
id STRING REFERENCES zitadel.projections.keys ON DELETE NO ACTION,
expiry TIMESTAMPTZ NOT NULL,
key BYTES NOT NULL,
PRIMARY KEY (id)
);