Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions db/init/mysql/schema.sql
Original file line number Diff line number Diff line change
Expand Up @@ -2446,6 +2446,7 @@ CREATE TABLE `discovery_upstream`
`upstream_status` int(0) NOT NULL COMMENT 'type (0, healthy, 1 unhealthy)',
`weight` int(0) NOT NULL COMMENT 'the weight for lists',
`props` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT 'the other field (json)',
`metadata` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT 'user-defined metadata for gray release',
`date_created` timestamp(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) COMMENT 'create time',
`date_updated` timestamp(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3) COMMENT 'update time',
PRIMARY KEY (`id`) USING BTREE,
Expand Down
1 change: 1 addition & 0 deletions db/init/ob/schema.sql
Original file line number Diff line number Diff line change
Expand Up @@ -2363,6 +2363,7 @@ CREATE TABLE `discovery_upstream`
`upstream_status` int(0) NOT NULL COMMENT 'type (0, healthy, 1 unhealthy)',
`weight` int(0) NOT NULL COMMENT 'the weight for lists',
`props` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT 'the other field (json)',
`metadata` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT 'user-defined metadata for gray release',
`date_created` timestamp(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) COMMENT 'create time',
`date_updated` timestamp(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3) COMMENT 'update time',
PRIMARY KEY (`id`) USING BTREE,
Expand Down
2 changes: 2 additions & 0 deletions db/init/og/create-table.sql
Original file line number Diff line number Diff line change
Expand Up @@ -2544,6 +2544,7 @@ CREATE TABLE "public"."discovery_upstream"
"upstream_status" int4 NOT NULL,
"weight" int4 NOT NULL,
"props" text COLLATE "pg_catalog"."default",
"metadata" text COLLATE "pg_catalog"."default",
"date_created" timestamp(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
"date_updated" timestamp(3) NOT NULL DEFAULT CURRENT_TIMESTAMP
)
Expand All @@ -2556,6 +2557,7 @@ COMMENT ON COLUMN "public"."discovery_upstream"."upstream_url" IS 'ip:port';
COMMENT ON COLUMN "public"."discovery_upstream"."upstream_status" IS 'type (0, healthy, 1 unhealthy)';
COMMENT ON COLUMN "public"."discovery_upstream"."weight" IS 'the weight for lists';
COMMENT ON COLUMN "public"."discovery_upstream"."props" IS 'the other field (json)';
COMMENT ON COLUMN "public"."discovery_upstream"."metadata" IS 'user-defined metadata for gray release';
COMMENT ON COLUMN "public"."discovery_upstream"."date_created" IS 'create time';
COMMENT ON COLUMN "public"."discovery_upstream"."date_updated" IS 'update time';
CREATE INDEX "unique_discovery_upstream_discovery_handler_id" ON "public"."discovery_upstream" USING btree (
Expand Down
4 changes: 3 additions & 1 deletion db/init/oracle/schema.sql
Original file line number Diff line number Diff line change
Expand Up @@ -2735,10 +2735,12 @@ create table discovery_upstream
upstream_status NUMBER(10) not null,
weight NUMBER(10) not null,
props CLOB,
metadata CLOB,
date_created timestamp(3) default SYSDATE not null,
date_updated timestamp(3) default SYSDATE not null,
PRIMARY KEY (id)
);
COMMENT ON COLUMN discovery_upstream.metadata IS 'user-defined metadata for gray release';
CREATE UNIQUE INDEX discovery_upstream_idx ON discovery_upstream (discovery_handler_id, upstream_url);

-- Add comments to the columns
Expand Down Expand Up @@ -3815,4 +3817,4 @@ INSERT INTO permission (id, object_id, resource_id, date_created, date_updated)
INSERT INTO permission (id, object_id, resource_id, date_created, date_updated) VALUES ('1953049887387303902', '1346358560427216896', '1953048313980116901', sysdate, sysdate);
INSERT INTO permission (id, object_id, resource_id, date_created, date_updated) VALUES ('1953049887387303903', '1346358560427216896', '1953048313980116902', sysdate, sysdate);
INSERT INTO permission (id, object_id, resource_id, date_created, date_updated) VALUES ('1953049887387303904', '1346358560427216896', '1953048313980116903', sysdate, sysdate);
INSERT INTO permission (id, object_id, resource_id, date_created, date_updated) VALUES ('1953049887387303905', '1346358560427216896', '1953048313980116904', sysdate, sysdate);
INSERT INTO permission (id, object_id, resource_id, date_created, date_updated) VALUES ('1953049887387303905', '1346358560427216896', '1953048313980116904', sysdate, sysdate);
2 changes: 2 additions & 0 deletions db/init/pg/create-table.sql
Original file line number Diff line number Diff line change
Expand Up @@ -2667,6 +2667,7 @@ CREATE TABLE "public"."discovery_upstream"
"upstream_status" int4 NOT NULL,
"weight" int4 NOT NULL,
"props" text COLLATE "pg_catalog"."default",
"metadata" text COLLATE "pg_catalog"."default",
"date_created" timestamp(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
"date_updated" timestamp(3) NOT NULL DEFAULT CURRENT_TIMESTAMP
)
Expand All @@ -2679,6 +2680,7 @@ COMMENT ON COLUMN "public"."discovery_upstream"."upstream_url" IS 'ip:port';
COMMENT ON COLUMN "public"."discovery_upstream"."upstream_status" IS 'type (0, healthy, 1 unhealthy)';
COMMENT ON COLUMN "public"."discovery_upstream"."weight" IS 'the weight for lists';
COMMENT ON COLUMN "public"."discovery_upstream"."props" IS 'the other field (json)';
COMMENT ON COLUMN "public"."discovery_upstream"."metadata" IS 'user-defined metadata for gray release';
COMMENT ON COLUMN "public"."discovery_upstream"."date_created" IS 'create time';
COMMENT ON COLUMN "public"."discovery_upstream"."date_updated" IS 'update time';

Expand Down
20 changes: 20 additions & 0 deletions db/upgrade/2.7.1-upgrade-2.7.2-mysql.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
-- Licensed to the Apache Software Foundation (ASF) under one
-- or more contributor license agreements. See the NOTICE file
-- distributed with this work for additional information
-- regarding copyright ownership. The ASF licenses this file
-- to you 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.

-- this file works for MySQL.

-- Add metadata column to discovery_upstream table for gray release
ALTER TABLE `discovery_upstream` ADD COLUMN `metadata` TEXT COMMENT 'User-defined metadata for gray release' AFTER `props`;
18 changes: 18 additions & 0 deletions db/upgrade/2.7.1-upgrade-2.7.2-ob.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
-- Licensed to the Apache Software Foundation (ASF) under one
-- or more contributor license agreements. See the NOTICE file
-- distributed with this work for additional information
-- regarding copyright ownership. The ASF licenses this file
-- to you 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.

-- this file works for Oceanbase.
ALTER TABLE `discovery_upstream` ADD COLUMN `metadata` TEXT COMMENT 'User-defined metadata for gray release' AFTER `props`;
19 changes: 19 additions & 0 deletions db/upgrade/2.7.1-upgrade-2.7.2-og.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
-- Licensed to the Apache Software Foundation (ASF) under one
-- or more contributor license agreements. See the NOTICE file
-- distributed with this work for additional information
-- regarding copyright ownership. The ASF licenses this file
-- to you 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.

-- this file works for og.
ALTER TABLE "public"."discovery_upstream" ADD COLUMN "metadata" text;
COMMENT ON COLUMN "public"."discovery_upstream"."metadata" IS 'User-defined metadata for gray release';
19 changes: 19 additions & 0 deletions db/upgrade/2.7.1-upgrade-2.7.2-oracle.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
-- Licensed to the Apache Software Foundation (ASF) under one
-- or more contributor license agreements. See the NOTICE file
-- distributed with this work for additional information
-- regarding copyright ownership. The ASF licenses this file
-- to you 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.

-- this file works for Oracle, can not use "`" syntax.
ALTER TABLE discovery_upstream ADD metadata CLOB;
COMMENT ON COLUMN discovery_upstream.metadata IS 'User-defined metadata for gray release';
19 changes: 19 additions & 0 deletions db/upgrade/2.7.1-upgrade-2.7.2-pg.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
-- Licensed to the Apache Software Foundation (ASF) under one
-- or more contributor license agreements. See the NOTICE file
-- distributed with this work for additional information
-- regarding copyright ownership. The ASF licenses this file
-- to you 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.

-- this file works for PostgreSQL, can not use "`" syntax.
ALTER TABLE "public"."discovery_upstream" ADD COLUMN "metadata" text;
COMMENT ON COLUMN "public"."discovery_upstream"."metadata" IS 'User-defined metadata for gray release';
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,11 @@ public class DiscoveryUpstreamDTO implements Serializable {
@NotBlank(message = "props can't be null")
private String props;

/**
* metadata.
*/
private String metadata;

/**
* created time.
*/
Expand Down Expand Up @@ -231,6 +236,24 @@ public void setProps(final String props) {
this.props = props;
}

/**
* getMetadata.
*
* @return metadata
*/
public String getMetadata() {
return metadata;
}

/**
* setMetadata.
*
* @param metadata metadata
*/
public void setMetadata(final String metadata) {
this.metadata = metadata;
}

/**
* getDateCreated.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -450,6 +450,11 @@ public static class DiscoveryUpstream {
*/
private String props;

/**
* metadata.
*/
private String metadata;

/**
* startupTime.
*/
Expand Down Expand Up @@ -573,6 +578,24 @@ public void setProps(final String props) {
this.props = props;
}

/**
* get metadata.
*
* @return metadata
*/
public String getMetadata() {
return metadata;
}

/**
* set metadata.
*
* @param metadata metadata
*/
public void setMetadata(final String metadata) {
this.metadata = metadata;
}

/**
* get startupTime.
* @return startupTime
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,11 @@ public class DiscoveryUpstreamDO extends BaseDO {
*/
private String props;

/**
* metadata.
*/
private String metadata;

/**
* namespaceId.
*/
Expand Down Expand Up @@ -214,6 +219,24 @@ public void setProps(final String props) {
this.props = props;
}

/**
* getMetadata.
*
* @return metadata
*/
public String getMetadata() {
return metadata;
}

/**
* setMetadata.
*
* @param metadata metadata
*/
public void setMetadata(final String metadata) {
this.metadata = metadata;
}

/**
* builder.
*
Expand Down Expand Up @@ -258,6 +281,7 @@ public static DiscoveryUpstreamDO buildDiscoveryUpstreamDO(final DiscoveryUpstre
.status(item.getStatus())
.weight(item.getWeight())
.props(item.getProps())
.metadata(item.getMetadata())
.url(item.getUrl())
.namespaceId(item.getNamespaceId())
.dateCreated(currentTime)
Expand Down Expand Up @@ -322,6 +346,11 @@ public static final class DiscoveryUpstreamBuilder {
*/
private String props;

/**
* metadata.
*/
private String metadata;

/**
* namespaceId.
*/
Expand Down Expand Up @@ -435,6 +464,17 @@ public DiscoveryUpstreamBuilder props(final String props) {
return this;
}

/**
* metadata.
*
* @param metadata metadata
* @return DiscoveryUpstreamBuilder
*/
public DiscoveryUpstreamBuilder metadata(final String metadata) {
this.metadata = metadata;
return this;
}

/**
* build namespaceId.
*
Expand All @@ -461,6 +501,7 @@ public DiscoveryUpstreamDO build() {
discoveryUpstreamDO.setUpstreamStatus(this.status);
discoveryUpstreamDO.setWeight(this.weight);
discoveryUpstreamDO.setProps(this.props);
discoveryUpstreamDO.setMetadata(this.metadata);
discoveryUpstreamDO.setNamespaceId(this.namespaceId);
discoveryUpstreamDO.setDateCreated(this.dateCreated);
discoveryUpstreamDO.setDateUpdated(this.dateUpdated);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,11 @@ public class DiscoveryUpstreamVO {
*/
private String props;

/**
* metadata.
*/
private String metadata;

/**
* dateCreated.
*/
Expand Down Expand Up @@ -185,6 +190,24 @@ public void setProps(final String props) {
this.props = props;
}

/**
* getMetadata.
*
* @return metadata
*/
public String getMetadata() {
return metadata;
}

/**
* setMetadata.
*
* @param metadata metadata
*/
public void setMetadata(final String metadata) {
this.metadata = metadata;
}

/**
* getStartupTime.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,7 @@ private void addUpstreamList(final ProxySelectorAddDTO proxySelectorAddDTO, fina
.status(discoveryUpstream.getStatus())
.weight(discoveryUpstream.getWeight())
.props(Optional.ofNullable(discoveryUpstream.getProps()).orElse("{}"))
.metadata(discoveryUpstream.getMetadata())
.dateCreated(currentTime)
.dateUpdated(currentTime)
.build();
Expand Down Expand Up @@ -380,6 +381,7 @@ public String update(final ProxySelectorAddDTO proxySelectorAddDTO) {
.status(discoveryUpstream.getStatus())
.weight(discoveryUpstream.getWeight())
.props(discoveryUpstream.getProps())
.metadata(discoveryUpstream.getMetadata())
.dateCreated(Optional.ofNullable(discoveryUpstream.getStartupTime()).map(t -> new Timestamp(Long.parseLong(t))).orElse(currentTime))
.dateUpdated(Optional.ofNullable(discoveryUpstream.getStartupTime()).map(t -> new Timestamp(Long.parseLong(t))).orElse(currentTime))
.build();
Expand Down
Loading
Loading