-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Description
Description
Currently, the file_info table uses database-managed timestamps with DEFAULT CURRENT_TIMESTAMP for both created_at and updated_at fields. However, the FileInfo entity already has Spring JPA auditing annotations (@CreatedDate and @LastModifiedDate) and @EnableJpaAuditing is configured.
Current State
- Database schema:
created_at timestamp DEFAULT CURRENT_TIMESTAMP - Database schema:
updated_at timestamp DEFAULT CURRENT_TIMESTAMP - Entity has
@CreatedDateand@LastModifiedDateannotations @EnableJpaAuditingis enabled inWebMvcConfig
Desired State
- Remove
DEFAULT CURRENT_TIMESTAMPfrom database schema - Make both fields
NOT NULLsince Spring will guarantee their population - Rely entirely on Spring JPA auditing for timestamp management
Benefits
- Consistent timestamp management at the application layer
- Better testability and control over audit fields
- Cleaner separation of concerns
Changes Required
- Update
init-db.sqlto remove database defaults and add NOT NULL constraints - Ensure Spring auditing is properly configured (already done)
- Update any existing data migration if needed
References
- PR: feat : apply encryption if enabled #914
- Comment: feat : apply encryption if enabled #914 (comment)
- Requested by: @rajadilipkolli
Metadata
Metadata
Assignees
Labels
No labels