chore: Renamed changed/created_on to changed/created_at #10719
Closed
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.
SUMMARY
As part of [SIP-27] Proposal for Paranoid Deletes with the addition of paranoid deletes it seems that, per the SIP, the
sqla-paranoid
package would be useful which provides thedeleted_at
column.Currently for various audit tables have
changed_on
andcreated_on
yet these refer to timestamps as opposed to dates and the tendency is to use_at
for timestamps and_on
for dates (example). To ensure consistency withsqla-paranoid
I thought there would be merit in renaming the variouschanged_on
andcreated_on
columns tochanged_at
andcreated_at
respectively.I probably should have dug a little further before actioning on this PR as it seems that the auditability comes from FAB which explicitly defines the
changed_on
andcreated_on
columns which are used in theab_user
table. I'm uncertain how people feel about this change. Note as a work around I needed to make theAuditMixinNullable
not inherit fromflask_appbuilder.models.mixins.AuditMixin
.Thoughts @bkyryliuk, @dpgaspar, @villebro, et al?
Note as a side note the
mypy
checks are failing when deprecating theflask_appbuilder.models.mixins.AuditMixin
. Irrespective of whether we go ahead with said change it's highlighted a number of previously silenced (due to inheritance) typing issues which should be resolved.BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
TEST PLAN
CI and manual testing.
ADDITIONAL INFORMATION