– The tokens table contains tokens for externally resolvable workflows. They are considered – secret, and therefore not part of the main table.
CREATE TABLE IF NOT EXISTS {SCHEMA_NAME}.tokens (
id BIGSERIAL PRIMARY KEY, postjob_id BIGINT REFERENCES {SCHEMA_NAME}.postjobs ON DELETE CASCADE, token UUID NOT NULL, created_at timestamp NOT NULL DEFAULT (now() at time zone 'utc')
);
CREATE INDEX IF NOT EXISTS tokens_postjob_id_idx ON {SCHEMA_NAME}.tokens(postjob_id); CREATE INDEX IF NOT EXISTS tokens_token_idx ON {SCHEMA_NAME}.tokens(token);