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 1e650bd0a1
commit a4e078305d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
28 changed files with 2875 additions and 2932 deletions

View file

@ -780,7 +780,7 @@ CREATE TABLE public."Registrar" (
i18n_address_zip text,
ip_address_allow_list text[],
last_certificate_update_time timestamp with time zone,
last_update_time timestamp with time zone,
last_update_time timestamp with time zone NOT NULL,
localized_address_city text,
localized_address_country_code text,
localized_address_state text,
@ -831,17 +831,17 @@ CREATE TABLE public."RegistrarPoc" (
CREATE TABLE public."RegistryLock" (
revision_id bigint NOT NULL,
lock_completion_timestamp timestamp with time zone,
lock_request_timestamp timestamp with time zone NOT NULL,
lock_completion_time timestamp with time zone,
lock_request_time timestamp with time zone NOT NULL,
domain_name text NOT NULL,
is_superuser boolean NOT NULL,
registrar_id text NOT NULL,
registrar_poc_id text,
repo_id text NOT NULL,
verification_code text NOT NULL,
unlock_request_timestamp timestamp with time zone,
unlock_completion_timestamp timestamp with time zone,
last_update_timestamp timestamp with time zone,
unlock_request_time timestamp with time zone,
unlock_completion_time timestamp with time zone,
last_update_time timestamp with time zone NOT NULL,
relock_revision_id bigint,
relock_duration interval
);