#108: V1.0.2__V1.0.2-RELEASE-Auditlog.sql

plugins/org.projectforge.plugins.datatransfer/src/main/resources/flyway/datatransfer/migrate/common/V1.0.2__V1.0.2-RELEASE-Auditlog.sql Path: plugins/...datatransfer/src/main/resources/flyway/datatransfer/migrate/common/V1.0.2__...Auditlog.sql · Lines: 21 · Type: Flyway migration — database-agnostic (common) 21 lines · 19 code · 0 comments · 2 blank

Creates the audit log table t_plugin_datatransfer_audit — adds activity tracking and email notification support to the DataTransfer plugin. Located in migrate/common/ meaning it runs on all database vendors without dialect-specific variants.

Table t_plugin_datatransfer_audit — 13 columns

Design: records every file operation (upload, download, rename, delete) on a data transfer area. Distinguishes between internal (by_user_fkt_pf_user) and external (by_external_user VARCHAR(4000) — stores free-text name/email/IP) users.

pkINTEGER PKPrimary key
timestampTIMESTAMPWhen the event occurred
area_fkINTEGER (indexed)FK → t_plugin_datatransfer_area
upload_by_user_fkINTEGEROriginal uploader FK — persists when file is later downloaded by another user
by_user_fkINTEGERWho performed this action (internal user)
by_external_userVARCHAR(4000)External user info (IP + optional name/email from login screen)
filename / filename_oldVARCHAR(1000)New and old filename (for rename tracking)
event_typeVARCHAR(20)Action type (UPLOAD, DOWNLOAD, DELETE, RENAME etc.)
description / description_oldVARCHAR(4000)New and old description (for edit tracking)
notifiedBOOLEAN NOT NULLWhether observers have been emailed about this event — prevents duplicate notifications

Indexes

The audit log is consumed by: the activity display dialog (DataTransferPublicServicesRest), the observer email notification scheduled job (queries events with notified=false), and the 30-day rolling display (old entries are pruned).