File size: 337 Bytes
1f30e8c
 
62e1b50
1f30e8c
62e1b50
 
 
1f30e8c
 
62e1b50
 
1f30e8c
1
2
3
4
5
6
7
8
9
10
11
12
CREATE TABLE audit_logs (
    id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
    user_id UUID NOT NULL,
    action TEXT NOT NULL,
    resource_type TEXT NOT NULL,
    resource_id UUID,
    metadata JSONB DEFAULT '{}',
    ip_address INET,
    user_agent TEXT,
    created_at TIMESTAMP WITH TIME ZONE DEFAULT timezone('utc',
    now())
);