-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Audit: all models are being tracked by PG history (#14)
* install pghistory * add created/modified/is_removed default at database level by SQL * attendee model now have history tracked by db triggers * add table comment to remove pk/id column which is pgh_obj_id * id still required for updating model instance * revert back to models.UUIDField on model itself * revert history table name back to event to match pghistory's method name * resolve conflics * fix partial date saving error from Django Admin * update django address and use bigint on it * add table checking step for manage task update_content_types * draft of user history * add user_groups and user_permissions event tables * add a test to limit model name length for pg-trigger names * add ccontext for celery task and access csv importer * add my own django-db-comments for labeling database tables * upgrade version of db-comment * user history diff in admin successfully shows * add history view for attendee, style buttons and show user id in history list view without click * add auth.Group in pg history * tracking group_permissions by pg history * track schedule Event model by PG history * update django pghistory version, tack event relation in History name * change event's event to event's history * rename migration file to match model name * rename GroupPermissionsEvent to GroupPermissionsHistory * rename GroupEvent to GroupHistory * rename UserPermissionEvent to UserPermissionHistory * rename GroupPermissionsHistory to GroupPermissionHistory * rename 0007_grouphistory to 0007_group_history * rename UserGroupEvent to UserGroupHistory * change UserEvent to UserHistory * rename AttendeesEvent to AttendeeHistory for consistancy * rename AttendeeHistory back to AttendeesHistory to match attendees table name * rename migration file to make it easier to read * add table comment seems overwritten by django-db-comments * rename UserGroupHistory to UserGroupsHistory for consistancy * UserHistory cannot be UsersHistory due to original table was created as users_user in Django Cookiecutter * track category by pghistory now * now track Note by pghistory * track Past with pg history now * track Past with pg history now with Admin * fix past data issues, may break again along adding pg history models * now tracking schedule's Calendar wth p history * schedule calendar relation model now tracked by pghistory too * track account's email address by pghistory * track email confirmation by pg history. Currently there's no records due to sendgrid, but email service may switch in the future * divert to upgrade django address * tracked address country by pghistory * now tracked state by pghistory * tracked locality history by pghistory now * tracked address by pghistory, noticed that django address id in history are still IntegerField instead of BigIntegerField * tracked menu by pghistory * track menu_auth_group by django pghistory now * now tracking organization by django pghistory * tracking division by django pghistory * add campus to be tracked by pghistory * track property with PG history now * track SuitesHistory by PG history now * track room by PG history now * fix room migration * track place by PG history * make room object id to uuid compatible, also applied permissions on most of occasions models * make room object id to uuid compatible, also applied permissions on most of occasions models * tracked MessageTemplate by PG history now * changing primary id to BigIntegerField in history model * remove Assembly model column 'need_age' and track its history by PG history * tracked Price model by PG history now * tracked character model by PG history now * tracked meet model with PG history * track model gathering with PG history * making pgh_id BigAutoField instead of AutoField * now tracked Team model by PG history * tracking attendance with PG history now * tracked Relations by PG history, also make pk index at history db level (Past) * move index on pk to the migration files instead of raw SQL unless necessary * tracked Folk model by PG history, also make attenee uuid indexed * tracking registration by PG history and change its assembly to non-null * add price to Attending model and tracked by PG history * add price to Attending model and tracked by PG history * track AttendingMeet by PG history now * tracked FolkAttendeesHistory by PG history finally * update seed data to match content type# after PG history * fix add more contact button position * update PR info * clean up some model def
- Loading branch information
Showing
90 changed files
with
2,926 additions
and
326 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,41 @@ | ||
import pghistory | ||
from django.apps import AppConfig | ||
from django.apps import apps as django_apps | ||
|
||
|
||
class OccasionsConfig(AppConfig): | ||
name = "attendees.occasions" | ||
|
||
def ready(self): | ||
schedule_calendar_model = django_apps.get_model("schedule.Calendar", require_ready=False) | ||
schedule_calendarrelation_model = django_apps.get_model("schedule.CalendarRelation", require_ready=False) | ||
schedule_event_model = django_apps.get_model("schedule.Event", require_ready=False) | ||
schedule_eventrelation_model = django_apps.get_model("schedule.EventRelation", require_ready=False) | ||
|
||
pghistory.track( | ||
pghistory.Snapshot('calendar.snapshot'), | ||
related_name='history', | ||
model_name='CalendarHistory', | ||
app_label='occasions' | ||
)(schedule_calendar_model) | ||
|
||
pghistory.track( | ||
pghistory.Snapshot('calendarrelation.snapshot'), | ||
related_name='history', | ||
model_name='CalendarRelationHistory', | ||
app_label='occasions', | ||
)(schedule_calendarrelation_model) | ||
|
||
pghistory.track( | ||
pghistory.Snapshot('event.snapshot'), | ||
related_name='history', | ||
model_name='EventHistory', | ||
app_label='occasions' | ||
)(schedule_event_model) | ||
|
||
pghistory.track( | ||
pghistory.Snapshot('eventrelation.snapshot'), | ||
related_name='history', | ||
model_name='EventRelationHistory', | ||
app_label='occasions', | ||
)(schedule_eventrelation_model) |
This file contains 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
Oops, something went wrong.