mirror of
https://github.com/google/nomulus.git
synced 2025-05-23 04:39:35 +02:00
Add and use temp_history_id_sequence to avoid release error (#795)
This commit is contained in:
parent
d6d44d73ba
commit
baa59b1f55
7 changed files with 40 additions and 5 deletions
|
@ -53,7 +53,7 @@ public class ContactHistory extends HistoryEntry {
|
||||||
VKey<ContactResource> contactRepoId;
|
VKey<ContactResource> contactRepoId;
|
||||||
|
|
||||||
@Id
|
@Id
|
||||||
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "HistorySequenceGenerator")
|
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "TempHistorySequenceGenerator")
|
||||||
@Column(name = "historyRevisionId")
|
@Column(name = "historyRevisionId")
|
||||||
@Access(AccessType.PROPERTY)
|
@Access(AccessType.PROPERTY)
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -76,7 +76,7 @@ public class DomainHistory extends HistoryEntry {
|
||||||
Set<VKey<HostResource>> nsHosts;
|
Set<VKey<HostResource>> nsHosts;
|
||||||
|
|
||||||
@Id
|
@Id
|
||||||
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "HistorySequenceGenerator")
|
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "TempHistorySequenceGenerator")
|
||||||
@Column(name = "historyRevisionId")
|
@Column(name = "historyRevisionId")
|
||||||
@Access(AccessType.PROPERTY)
|
@Access(AccessType.PROPERTY)
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -54,7 +54,7 @@ public class HostHistory extends HistoryEntry {
|
||||||
VKey<HostResource> hostRepoId;
|
VKey<HostResource> hostRepoId;
|
||||||
|
|
||||||
@Id
|
@Id
|
||||||
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "HistorySequenceGenerator")
|
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "TempHistorySequenceGenerator")
|
||||||
@Column(name = "historyRevisionId")
|
@Column(name = "historyRevisionId")
|
||||||
@Access(AccessType.PROPERTY)
|
@Access(AccessType.PROPERTY)
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -11,7 +11,10 @@
|
||||||
</attributes>
|
</attributes>
|
||||||
</embeddable>
|
</embeddable>
|
||||||
|
|
||||||
<sequence-generator name="HistorySequenceGenerator" sequence-name="history_id_sequence" />
|
<sequence-generator name="HistorySequenceGenerator" sequence-name="history_id_sequence"/>
|
||||||
|
|
||||||
|
<!-- TODO(shicong): Drop this sequence and change all history tables to use the above one. -->
|
||||||
|
<sequence-generator name="TempHistorySequenceGenerator" sequence-name="temp_history_id_sequence"/>
|
||||||
|
|
||||||
<persistence-unit-metadata>
|
<persistence-unit-metadata>
|
||||||
<persistence-unit-defaults>
|
<persistence-unit-defaults>
|
||||||
|
|
|
@ -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;
|
|
@ -11,7 +11,7 @@
|
||||||
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
-- See the License for the specific language governing permissions and
|
-- See the License for the specific language governing permissions and
|
||||||
-- limitations under the License.
|
-- 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" (
|
create table "AllocationToken" (
|
||||||
token text not null,
|
token text not null,
|
||||||
|
|
|
@ -930,6 +930,18 @@ CREATE SEQUENCE public.history_id_sequence
|
||||||
CACHE 1;
|
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: -
|
-- Name: BillingCancellation billing_cancellation_id; Type: DEFAULT; Schema: public; Owner: -
|
||||||
--
|
--
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue