mirror of
https://github.com/goharbor/harbor.git
synced 2025-01-03 14:37:44 +01:00
b0c74a0584
add auditlog-ext related api in swagger add audit_log_ext table Signed-off-by: stonezdj <stone.zhang@broadcom.com>
24 lines
959 B
SQL
24 lines
959 B
SQL
ALTER TABLE p2p_preheat_policy DROP COLUMN IF EXISTS scope;
|
|
ALTER TABLE p2p_preheat_policy ADD COLUMN IF NOT EXISTS extra_attrs text;
|
|
|
|
CREATE TABLE IF NOT EXISTS audit_log_ext
|
|
(
|
|
id BIGSERIAL PRIMARY KEY NOT NULL,
|
|
project_id BIGINT,
|
|
operation VARCHAR(50) NULL,
|
|
resource_type VARCHAR(50) NULL,
|
|
resource VARCHAR(50) NULL,
|
|
username VARCHAR(50) NULL,
|
|
op_desc VARCHAR(500) NULL,
|
|
op_result BOOLEAN DEFAULT true,
|
|
payload TEXT NULL,
|
|
source_ip VARCHAR(50) NULL,
|
|
op_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP
|
|
);
|
|
|
|
-- add index to the audit_log_ext table
|
|
CREATE INDEX IF NOT EXISTS idx_audit_log_ext_op_time ON audit_log_ext (op_time);
|
|
CREATE INDEX IF NOT EXISTS idx_audit_log_ext_project_id_optime ON audit_log_ext (project_id, op_time);
|
|
CREATE INDEX IF NOT EXISTS idx_audit_log_ext_project_id_resource_type ON audit_log_ext (project_id, resource_type);
|
|
CREATE INDEX IF NOT EXISTS idx_audit_log_ext_project_id_operation ON audit_log_ext (project_id, operation);
|