diff --git a/core/src/main/java/google/registry/model/contact/ContactHistory.java b/core/src/main/java/google/registry/model/contact/ContactHistory.java index fe66c3d1e..64875c0e1 100644 --- a/core/src/main/java/google/registry/model/contact/ContactHistory.java +++ b/core/src/main/java/google/registry/model/contact/ContactHistory.java @@ -53,7 +53,7 @@ public class ContactHistory extends HistoryEntry { VKey contactRepoId; @Id - @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "HistorySequenceGenerator") + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "TempHistorySequenceGenerator") @Column(name = "historyRevisionId") @Access(AccessType.PROPERTY) @Override diff --git a/core/src/main/java/google/registry/model/domain/DomainHistory.java b/core/src/main/java/google/registry/model/domain/DomainHistory.java index ef547df9c..b6e101c11 100644 --- a/core/src/main/java/google/registry/model/domain/DomainHistory.java +++ b/core/src/main/java/google/registry/model/domain/DomainHistory.java @@ -76,7 +76,7 @@ public class DomainHistory extends HistoryEntry { Set> nsHosts; @Id - @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "HistorySequenceGenerator") + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "TempHistorySequenceGenerator") @Column(name = "historyRevisionId") @Access(AccessType.PROPERTY) @Override diff --git a/core/src/main/java/google/registry/model/host/HostHistory.java b/core/src/main/java/google/registry/model/host/HostHistory.java index 5f883d96b..24dfd13e9 100644 --- a/core/src/main/java/google/registry/model/host/HostHistory.java +++ b/core/src/main/java/google/registry/model/host/HostHistory.java @@ -54,7 +54,7 @@ public class HostHistory extends HistoryEntry { VKey hostRepoId; @Id - @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "HistorySequenceGenerator") + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "TempHistorySequenceGenerator") @Column(name = "historyRevisionId") @Access(AccessType.PROPERTY) @Override diff --git a/core/src/main/resources/META-INF/orm.xml b/core/src/main/resources/META-INF/orm.xml index 23c7235b1..0245fc12e 100644 --- a/core/src/main/resources/META-INF/orm.xml +++ b/core/src/main/resources/META-INF/orm.xml @@ -11,7 +11,10 @@ - + + + + diff --git a/db/src/main/resources/sql/flyway/V53__add_temp_history_id_sequence.sql b/db/src/main/resources/sql/flyway/V53__add_temp_history_id_sequence.sql new file mode 100644 index 000000000..08f5d6b04 --- /dev/null +++ b/db/src/main/resources/sql/flyway/V53__add_temp_history_id_sequence.sql @@ -0,0 +1,20 @@ +-- 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. + +create sequence "temp_history_id_sequence" + start with 1 + increment by 50 + no minvalue + no maxvalue + cache 1; diff --git a/db/src/main/resources/sql/schema/db-schema.sql.generated b/db/src/main/resources/sql/schema/db-schema.sql.generated index 6156837e3..a9d2f323c 100644 --- a/db/src/main/resources/sql/schema/db-schema.sql.generated +++ b/db/src/main/resources/sql/schema/db-schema.sql.generated @@ -11,7 +11,7 @@ -- 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. -create sequence history_id_sequence start 1 increment 50; +create sequence temp_history_id_sequence start 1 increment 50; create table "AllocationToken" ( token text not null, diff --git a/db/src/main/resources/sql/schema/nomulus.golden.sql b/db/src/main/resources/sql/schema/nomulus.golden.sql index 00ab057a8..8437bea20 100644 --- a/db/src/main/resources/sql/schema/nomulus.golden.sql +++ b/db/src/main/resources/sql/schema/nomulus.golden.sql @@ -930,6 +930,18 @@ CREATE SEQUENCE public.history_id_sequence CACHE 1; +-- +-- Name: temp_history_id_sequence; Type: SEQUENCE; Schema: public; Owner: - +-- + +CREATE SEQUENCE public.temp_history_id_sequence + START WITH 1 + INCREMENT BY 50 + NO MINVALUE + NO MAXVALUE + CACHE 1; + + -- -- Name: BillingCancellation billing_cancellation_id; Type: DEFAULT; Schema: public; Owner: - --