mirror of
https://github.com/zitadel/zitadel.git
synced 2024-12-12 11:04:25 +00:00
32 lines
742 B
SQL
32 lines
742 B
SQL
CREATE DATABASE zitadel;
|
|
GRANT SELECT, INSERT, UPDATE, DELETE ON DATABASE zitadel TO queries;
|
|
use zitadel;
|
|
|
|
CREATE SCHEMA zitadel.projections AUTHORIZATION queries;
|
|
|
|
CREATE TABLE zitadel.projections.locks (
|
|
locker_id TEXT,
|
|
locked_until TIMESTAMPTZ(3),
|
|
projection_name TEXT,
|
|
|
|
PRIMARY KEY (projection_name)
|
|
);
|
|
|
|
CREATE TABLE zitadel.projections.current_sequences (
|
|
projection_name TEXT,
|
|
aggregate_type TEXT,
|
|
current_sequence BIGINT,
|
|
timestamp TIMESTAMPTZ,
|
|
|
|
PRIMARY KEY (projection_name, aggregate_type)
|
|
);
|
|
|
|
CREATE TABLE zitadel.projections.failed_events (
|
|
projection_name TEXT,
|
|
failed_sequence BIGINT,
|
|
failure_count SMALLINT,
|
|
error TEXT,
|
|
|
|
PRIMARY KEY (projection_name, failed_sequence)
|
|
);
|