BlueWaveTechnologies / BlueWave

Web application used to create charts and dashboards using a graph database
MIT License
5 stars 3 forks source link

User Activity Reports #297

Open pborissow opened 2 years ago

pborissow commented 2 years ago

Currently web activity is being logged in flat files on disk. It would be helpful for admins to generate usage reports.

Proposed tasks:

pborissow commented 2 years ago

UserActivity model has been added. The following script will be required to update the database:


CREATE TABLE APPLICATION.USER_ACTIVITY (
    ID BIGSERIAL NOT NULL,
    USER_ID bigint NOT NULL,
    HOUR integer NOT NULL,
    MINUTE integer NOT NULL,
    COUNT integer NOT NULL,
    CONSTRAINT PK_USER_ACTIVITY PRIMARY KEY (ID)
);

ALTER TABLE APPLICATION.USER_ACTIVITY ADD FOREIGN KEY (USER_ID) REFERENCES APPLICATION.USER(ID)
    ON DELETE CASCADE ON UPDATE NO ACTION;

CREATE INDEX IDX_USER_ACTIVITY_USER ON APPLICATION.USER_ACTIVITY(USER_ID);

ALTER TABLE APPLICATION.USER_ACTIVITY ADD CONSTRAINT unique_user_activity UNIQUE (USER_ID, HOUR, MINUTE);