mirror of
https://github.com/google/nomulus.git
synced 2025-05-22 20:29:36 +02:00
Make some columns nullable in History tables (#873)
* Make some columns nullable in History tables xmlBytes is made nullable in all history tables since changes performed by backend actions would not have it. In addition, epp requests are not saved to ContactHistory since data may contain PII. requestedByRegistrar in all history tables are made nullable. This property is set from metadata in epp requests. Null means not provided.
This commit is contained in:
parent
31c16e8369
commit
fe8f4cc4ac
7 changed files with 63 additions and 33 deletions
|
@ -137,8 +137,12 @@ public class HistoryEntry extends ImmutableObject implements Buildable, Datastor
|
|||
@Transient // domain-specific
|
||||
Period period;
|
||||
|
||||
/** The actual EPP xml of the command, stored as bytes to be agnostic of encoding. */
|
||||
@Column(nullable = false, name = "historyXmlBytes")
|
||||
/**
|
||||
* The actual EPP xml of the command, stored as bytes to be agnostic of encoding.
|
||||
*
|
||||
* <p>Changes performed by backend actions would not have EPP requests to store.
|
||||
*/
|
||||
@Column(name = "historyXmlBytes")
|
||||
byte[] xmlBytes;
|
||||
|
||||
/** The time the command occurred, represented by the ofy transaction time. */
|
||||
|
@ -182,7 +186,7 @@ public class HistoryEntry extends ImmutableObject implements Buildable, Datastor
|
|||
String reason;
|
||||
|
||||
/** Whether this change was requested by a registrar. */
|
||||
@Column(nullable = false, name = "historyRequestedByRegistrar")
|
||||
@Column(name = "historyRequestedByRegistrar")
|
||||
Boolean requestedByRegistrar;
|
||||
|
||||
/**
|
||||
|
|
|
@ -261,11 +261,11 @@ td.section {
|
|||
</tr>
|
||||
<tr>
|
||||
<td class="property_name">generated on</td>
|
||||
<td class="property_value">2020-11-12 02:22:52.212444</td>
|
||||
<td class="property_value">2020-11-13 19:34:54.398919</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="property_name">last flyway file</td>
|
||||
<td id="lastFlywayFile" class="property_value">V75__add_grace_period_history.sql</td>
|
||||
<td id="lastFlywayFile" class="property_value">V76__change_history_nullability.sql</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
@ -284,7 +284,7 @@ td.section {
|
|||
generated on
|
||||
</text>
|
||||
<text text-anchor="start" x="5830.94" y="-10.8" font-family="Helvetica,sans-Serif" font-size="14.00">
|
||||
2020-11-12 02:22:52.212444
|
||||
2020-11-13 19:34:54.398919
|
||||
</text>
|
||||
<polygon fill="none" stroke="#888888" points="5743.44,-4 5743.44,-44 6008.44,-44 6008.44,-4 5743.44,-4" /> <!-- allocationtoken_a08ccbef -->
|
||||
<g id="node1" class="node">
|
||||
|
|
|
@ -261,11 +261,11 @@ td.section {
|
|||
</tr>
|
||||
<tr>
|
||||
<td class="property_name">generated on</td>
|
||||
<td class="property_value">2020-11-12 02:22:50.323783</td>
|
||||
<td class="property_value">2020-11-13 19:34:52.404634</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="property_name">last flyway file</td>
|
||||
<td id="lastFlywayFile" class="property_value">V75__add_grace_period_history.sql</td>
|
||||
<td id="lastFlywayFile" class="property_value">V76__change_history_nullability.sql</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
@ -284,7 +284,7 @@ td.section {
|
|||
generated on
|
||||
</text>
|
||||
<text text-anchor="start" x="6501.68" y="-10.8" font-family="Helvetica,sans-Serif" font-size="14.00">
|
||||
2020-11-12 02:22:50.323783
|
||||
2020-11-13 19:34:52.404634
|
||||
</text>
|
||||
<polygon fill="none" stroke="#888888" points="6414.18,-4 6414.18,-44 6679.18,-44 6679.18,-4 6414.18,-4" /> <!-- allocationtoken_a08ccbef -->
|
||||
<g id="node1" class="node">
|
||||
|
@ -701,7 +701,7 @@ td.section {
|
|||
<text text-anchor="start" x="4457" y="-3829.3" font-family="Helvetica,sans-Serif" font-size="14.00">
|
||||
</text>
|
||||
<text text-anchor="start" x="4465" y="-3829.3" font-family="Helvetica,sans-Serif" font-size="14.00">
|
||||
bool not null
|
||||
bool
|
||||
</text>
|
||||
<text text-anchor="start" x="4179" y="-3810.3" font-family="Helvetica,sans-Serif" font-size="14.00">
|
||||
history_client_transaction_id
|
||||
|
@ -733,7 +733,7 @@ td.section {
|
|||
<text text-anchor="start" x="4457" y="-3753.3" font-family="Helvetica,sans-Serif" font-size="14.00">
|
||||
</text>
|
||||
<text text-anchor="start" x="4465" y="-3753.3" font-family="Helvetica,sans-Serif" font-size="14.00">
|
||||
bytea not null
|
||||
bytea
|
||||
</text>
|
||||
<text text-anchor="start" x="4179" y="-3734.3" font-family="Helvetica,sans-Serif" font-size="14.00">
|
||||
admin_contact
|
||||
|
@ -3789,7 +3789,7 @@ td.section {
|
|||
<text text-anchor="start" x="1517.5" y="-2523.3" font-family="Helvetica,sans-Serif" font-size="14.00">
|
||||
</text>
|
||||
<text text-anchor="start" x="1525.5" y="-2523.3" font-family="Helvetica,sans-Serif" font-size="14.00">
|
||||
bool not null
|
||||
bool
|
||||
</text>
|
||||
<text text-anchor="start" x="1306.5" y="-2504.3" font-family="Helvetica,sans-Serif" font-size="14.00">
|
||||
history_client_transaction_id
|
||||
|
@ -3821,7 +3821,7 @@ td.section {
|
|||
<text text-anchor="start" x="1517.5" y="-2447.3" font-family="Helvetica,sans-Serif" font-size="14.00">
|
||||
</text>
|
||||
<text text-anchor="start" x="1525.5" y="-2447.3" font-family="Helvetica,sans-Serif" font-size="14.00">
|
||||
bytea not null
|
||||
bytea
|
||||
</text>
|
||||
<text text-anchor="start" x="1306.5" y="-2428.3" font-family="Helvetica,sans-Serif" font-size="14.00">
|
||||
auth_info_repo_id
|
||||
|
@ -4562,7 +4562,7 @@ td.section {
|
|||
<text text-anchor="start" x="1507.5" y="-1189.3" font-family="Helvetica,sans-Serif" font-size="14.00">
|
||||
</text>
|
||||
<text text-anchor="start" x="1515.5" y="-1189.3" font-family="Helvetica,sans-Serif" font-size="14.00">
|
||||
bool not null
|
||||
bool
|
||||
</text>
|
||||
<text text-anchor="start" x="1316.5" y="-1170.3" font-family="Helvetica,sans-Serif" font-size="14.00">
|
||||
history_client_transaction_id
|
||||
|
@ -4594,7 +4594,7 @@ td.section {
|
|||
<text text-anchor="start" x="1507.5" y="-1113.3" font-family="Helvetica,sans-Serif" font-size="14.00">
|
||||
</text>
|
||||
<text text-anchor="start" x="1515.5" y="-1113.3" font-family="Helvetica,sans-Serif" font-size="14.00">
|
||||
bytea not null
|
||||
bytea
|
||||
</text>
|
||||
<text text-anchor="start" x="1316.5" y="-1094.3" font-family="Helvetica,sans-Serif" font-size="14.00">
|
||||
host_name
|
||||
|
@ -7983,7 +7983,7 @@ td.section {
|
|||
<tr>
|
||||
<td class="spacer"></td>
|
||||
<td class="minwidth">history_requested_by_registrar</td>
|
||||
<td class="minwidth">bool not null</td>
|
||||
<td class="minwidth">bool</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="spacer"></td>
|
||||
|
@ -8003,7 +8003,7 @@ td.section {
|
|||
<tr>
|
||||
<td class="spacer"></td>
|
||||
<td class="minwidth">history_xml_bytes</td>
|
||||
<td class="minwidth">bytea not null</td>
|
||||
<td class="minwidth">bytea</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="spacer"></td>
|
||||
|
@ -9425,7 +9425,7 @@ td.section {
|
|||
<tr>
|
||||
<td class="spacer"></td>
|
||||
<td class="minwidth">history_requested_by_registrar</td>
|
||||
<td class="minwidth">bool not null</td>
|
||||
<td class="minwidth">bool</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="spacer"></td>
|
||||
|
@ -9445,7 +9445,7 @@ td.section {
|
|||
<tr>
|
||||
<td class="spacer"></td>
|
||||
<td class="minwidth">history_xml_bytes</td>
|
||||
<td class="minwidth">bytea not null</td>
|
||||
<td class="minwidth">bytea</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="spacer"></td>
|
||||
|
@ -10717,7 +10717,7 @@ td.section {
|
|||
<tr>
|
||||
<td class="spacer"></td>
|
||||
<td class="minwidth">history_requested_by_registrar</td>
|
||||
<td class="minwidth">bool not null</td>
|
||||
<td class="minwidth">bool</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="spacer"></td>
|
||||
|
@ -10737,7 +10737,7 @@ td.section {
|
|||
<tr>
|
||||
<td class="spacer"></td>
|
||||
<td class="minwidth">history_xml_bytes</td>
|
||||
<td class="minwidth">bytea not null</td>
|
||||
<td class="minwidth">bytea</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="spacer"></td>
|
||||
|
|
|
@ -73,3 +73,4 @@ V72__add_missing_foreign_keys.sql
|
|||
V73__singleton_entities.sql
|
||||
V74__sql_replay_checkpoint.sql
|
||||
V75__add_grace_period_history.sql
|
||||
V76__change_history_nullability.sql
|
||||
|
|
|
@ -0,0 +1,25 @@
|
|||
-- Copyright 2020 The Nomulus Authors. All Rights Reserved.
|
||||
--
|
||||
-- Licensed under the Apache License, Version 2.0 (the "License");
|
||||
-- you may not use this file except in compliance with the License.
|
||||
-- You may obtain a copy of the License at
|
||||
--
|
||||
-- http://www.apache.org/licenses/LICENSE-2.0
|
||||
--
|
||||
-- Unless required by applicable law or agreed to in writing, software
|
||||
-- distributed under the License is distributed on an "AS IS" BASIS,
|
||||
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
-- See the License for the specific language governing permissions and
|
||||
-- limitations under the License.
|
||||
|
||||
ALTER table "ContactHistory"
|
||||
ALTER column history_xml_bytes DROP NOT NULL,
|
||||
ALTER column history_requested_by_registrar DROP NOT NULL;
|
||||
|
||||
ALTER table "DomainHistory"
|
||||
ALTER column history_xml_bytes DROP NOT NULL,
|
||||
ALTER column history_requested_by_registrar DROP NOT NULL;
|
||||
|
||||
ALTER table "HostHistory"
|
||||
ALTER column history_xml_bytes DROP NOT NULL,
|
||||
ALTER column history_requested_by_registrar DROP NOT NULL;
|
|
@ -156,11 +156,11 @@
|
|||
history_registrar_id text,
|
||||
history_modification_time timestamptz not null,
|
||||
history_reason text,
|
||||
history_requested_by_registrar boolean not null,
|
||||
history_requested_by_registrar boolean,
|
||||
history_client_transaction_id text,
|
||||
history_server_transaction_id text,
|
||||
history_type text not null,
|
||||
history_xml_bytes bytea not null,
|
||||
history_xml_bytes bytea,
|
||||
auth_info_repo_id text,
|
||||
auth_info_value text,
|
||||
contact_id text,
|
||||
|
@ -309,11 +309,11 @@
|
|||
history_registrar_id text,
|
||||
history_modification_time timestamptz not null,
|
||||
history_reason text,
|
||||
history_requested_by_registrar boolean not null,
|
||||
history_requested_by_registrar boolean,
|
||||
history_client_transaction_id text,
|
||||
history_server_transaction_id text,
|
||||
history_type text not null,
|
||||
history_xml_bytes bytea not null,
|
||||
history_xml_bytes bytea,
|
||||
admin_contact text,
|
||||
auth_info_repo_id text,
|
||||
auth_info_value text,
|
||||
|
@ -446,11 +446,11 @@
|
|||
history_registrar_id text,
|
||||
history_modification_time timestamptz not null,
|
||||
history_reason text,
|
||||
history_requested_by_registrar boolean not null,
|
||||
history_requested_by_registrar boolean,
|
||||
history_client_transaction_id text,
|
||||
history_server_transaction_id text,
|
||||
history_type text not null,
|
||||
history_xml_bytes bytea not null,
|
||||
history_xml_bytes bytea,
|
||||
host_name text,
|
||||
inet_addresses text[],
|
||||
last_superordinate_change timestamptz,
|
||||
|
|
|
@ -228,11 +228,11 @@ CREATE TABLE public."ContactHistory" (
|
|||
history_registrar_id text,
|
||||
history_modification_time timestamp with time zone NOT NULL,
|
||||
history_reason text,
|
||||
history_requested_by_registrar boolean NOT NULL,
|
||||
history_requested_by_registrar boolean,
|
||||
history_client_transaction_id text,
|
||||
history_server_transaction_id text,
|
||||
history_type text NOT NULL,
|
||||
history_xml_bytes bytea NOT NULL,
|
||||
history_xml_bytes bytea,
|
||||
auth_info_repo_id text,
|
||||
auth_info_value text,
|
||||
contact_id text,
|
||||
|
@ -401,11 +401,11 @@ CREATE TABLE public."DomainHistory" (
|
|||
history_registrar_id text,
|
||||
history_modification_time timestamp with time zone NOT NULL,
|
||||
history_reason text,
|
||||
history_requested_by_registrar boolean NOT NULL,
|
||||
history_requested_by_registrar boolean,
|
||||
history_client_transaction_id text,
|
||||
history_server_transaction_id text,
|
||||
history_type text NOT NULL,
|
||||
history_xml_bytes bytea NOT NULL,
|
||||
history_xml_bytes bytea,
|
||||
admin_contact text,
|
||||
auth_info_repo_id text,
|
||||
auth_info_value text,
|
||||
|
@ -587,11 +587,11 @@ CREATE TABLE public."HostHistory" (
|
|||
history_registrar_id text NOT NULL,
|
||||
history_modification_time timestamp with time zone NOT NULL,
|
||||
history_reason text,
|
||||
history_requested_by_registrar boolean NOT NULL,
|
||||
history_requested_by_registrar boolean,
|
||||
history_client_transaction_id text,
|
||||
history_server_transaction_id text,
|
||||
history_type text NOT NULL,
|
||||
history_xml_bytes bytea NOT NULL,
|
||||
history_xml_bytes bytea,
|
||||
host_name text,
|
||||
inet_addresses text[],
|
||||
last_superordinate_change timestamp with time zone,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue