active log add
This commit is contained in:
1 parent
585ba63bc2
commit
3636e1ca53
15 files changed
+856
-29
No files matched your search
@@ -0,0 +1,18 @@
|
||||
CREATE TABLE IF NOT EXISTS activity_logs (
|
||||
id bigserial PRIMARY KEY,
|
||||
user_id bigint,
|
||||
method character varying(10) NOT NULL DEFAULT '',
|
||||
path character varying(255) NOT NULL DEFAULT '',
|
||||
module character varying(100) NOT NULL DEFAULT '',
|
||||
action character varying(50) NOT NULL DEFAULT '',
|
||||
status_code integer NOT NULL DEFAULT 0,
|
||||
request_body jsonb,
|
||||
ip character varying(50) NOT NULL DEFAULT '',
|
||||
created_at TIMESTAMP DEFAULT (CURRENT_TIMESTAMP AT TIME ZONE 'UTC') NOT NULL,
|
||||
CONSTRAINT activity_logs_user_id_fkey
|
||||
FOREIGN KEY ("user_id") REFERENCES users(id)
|
||||
);
|
||||
|
||||
CREATE INDEX IF NOT EXISTS idx_activity_logs_user_id ON activity_logs(user_id);
|
||||
CREATE INDEX IF NOT EXISTS idx_activity_logs_module ON activity_logs(module);
|
||||
CREATE INDEX IF NOT EXISTS idx_activity_logs_created_at ON activity_logs(created_at);
|
||||
Reference in new issue
Block a user