All Downloads are FREE. Search and download functionalities are using the official Maven repository.

database.postgresql.schema Maven / Gradle / Ivy

There is a newer version: 4.6.0-alpha.2
Show newest version
--
-- Script to create Postgresql schema
-- Table & index names are suffixed by 3 underscores to define a
-- pattern to replace with the reporter name
--
CREATE TABLE IF NOT EXISTS reporter_audits___ (id VARCHAR(64) NOT NULL, transaction_id VARCHAR(64), type VARCHAR(255), reference_type VARCHAR(64), reference_id VARCHAR(64), timestamp TIMESTAMP(6) WITHOUT TIME ZONE, PRIMARY KEY(id))
CREATE TABLE IF NOT EXISTS reporter_audits_outcomes___ (audit_id VARCHAR(64) NOT NULL, status VARCHAR(64), message TEXT)
CREATE TABLE IF NOT EXISTS reporter_audits_access_points___ (audit_id VARCHAR(64) NOT NULL, id VARCHAR(255), alternative_id VARCHAR(320), display_name VARCHAR(255), ip_address VARCHAR(255), user_agent VARCHAR(255))
CREATE TABLE IF NOT EXISTS reporter_audits_entities___ (audit_id VARCHAR(64) NOT NULL, audit_field VARCHAR(64) NOT NULL, id VARCHAR(64), alternative_id VARCHAR(320), display_name VARCHAR(256), type VARCHAR(64), display_ame VARCHAR(255), reference_type VARCHAR(64), reference_id VARCHAR(64), attributes TEXT)

CREATE INDEX IF NOT EXISTS idx_audits_ref___ ON reporter_audits___(reference_id, reference_type)
CREATE INDEX IF NOT EXISTS idx_audits_type___ ON reporter_audits___(type)
CREATE INDEX IF NOT EXISTS idx_audits_timestamp___ ON reporter_audits___(timestamp)
CREATE INDEX IF NOT EXISTS idx_audit_outcomes_id___ ON reporter_audits_outcomes___(audit_id)
CREATE INDEX IF NOT EXISTS idx_audit_outcomes_status___ ON reporter_audits_outcomes___(status)
CREATE INDEX IF NOT EXISTS idx_audit_access_points_id___ ON reporter_audits_access_points___(audit_id)
CREATE INDEX IF NOT EXISTS idx_audit_access_points_alternative_id___ ON reporter_audits_access_points___(alternative_id)
CREATE INDEX IF NOT EXISTS idx_audit_entities_id___ ON reporter_audits_entities___(audit_id)
CREATE INDEX IF NOT EXISTS idx_audit_entities_alternative_id___ ON reporter_audits_entities___(alternative_id)




© 2015 - 2025 Weber Informatics LLC | Privacy Policy