feat: Store log data in a separate table#255
Merged
Conversation
121c76d to
b372e90
Compare
palkan
reviewed
Apr 8, 2025
lib/logidze.rb
Outdated
| attr_reader :on_pending_upgrade | ||
| # Determines if we should treat all models as detached regardless of the +detached: true+ macros presence | ||
| # Usable for gem specs setup | ||
| attr_accessor :treat_models_as_detached |
Owner
There was a problem hiding this comment.
Let's call it log_data_placement = :detached | :inline
ac30fdd to
0bb4c06
Compare
880257c to
f1600ad
Compare
Owner
|
🚀 Thanks @Lokideos! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What is the purpose of this pull request?
This PR addresses adds an option to store
log_datain a separate table.Context
The main concern of the
logidzegem is performance. However, the current approach leads to table bloat. One of the ways to remediate this problem is to storelog_datain a separate table, which is added in this PR.What changes did you make? (overview)
log_datain a separate table. To achieve this:bundle exec rails generate logidze:migration:logsto create a new table.bundle exec rails generate logidze:model %MODEL_NAME% --detachedto add needed helpers and trigger to the model.Logidze.log_data_placementconfiguration value to:detachedto force storing alllog_datain a separate table.log_data.Is there anything you'd like reviewers to focus on?
Checklist