Embed a ZonedDateTime as the UpdateAutoTimestamp in SQL (#1033)

* Embed a ZonedDateTime as the UpdateAutoTimestamp in SQL

This means we can get rid of the converter and more importantly, means
that reading the object from SQL does not affect the last-read time (the
test added to UpdateAutoTimestampTest failed prior to the production
code change).

For now we keep both time fields in UpdateAutoTimestamp however
post-migration, we can remove the joda-time field if we wish.

Note: I'm not sure why <now> is the time that we started getting
LazyInitializationExceptions in the LegacyHistoryObject and
ReplayExtension tests but we can solve that by just examining /
initializing the object within the transaction.
This commit is contained in:
gbrodman 2021-03-29 11:59:08 -04:00 committed by GitHub
parent 2de27b5716
commit bc4cd573b5
28 changed files with 2875 additions and 2932 deletions

View file

@ -589,7 +589,7 @@
i18n_address_zip text,
ip_address_allow_list text[],
last_certificate_update_time timestamptz,
last_update_time timestamptz,
last_update_time timestamptz not null,
localized_address_city text,
localized_address_country_code text,
localized_address_state text,
@ -634,15 +634,15 @@
revision_id bigserial not null,
domain_name text not null,
is_superuser boolean not null,
last_update_timestamp timestamptz,
lock_completion_timestamp timestamptz,
lock_request_timestamp timestamptz not null,
last_update_time timestamptz not null,
lock_completion_time timestamptz,
lock_request_time timestamptz not null,
registrar_id text not null,
registrar_poc_id text,
relock_duration interval,
repo_id text not null,
unlock_completion_timestamp timestamptz,
unlock_request_timestamp timestamptz,
unlock_completion_time timestamptz,
unlock_request_time timestamptz,
verification_code text not null,
relock_revision_id int8,
primary key (revision_id)