From 0d2341dc064f807407f4e0b41d1f3fbc2f5b227c Mon Sep 17 00:00:00 2001 From: Tor-Einar Skog <tor-einar.skog@nibio.no> Date: Fri, 29 Sep 2023 11:25:18 +0200 Subject: [PATCH] fix: Rollback property impactRadius on PointOfInterestTypeNurserry[PAER-24] --- .../entity/PointOfInterestTypeNursery.java | 36 ------------------- ...V16__POI_type_nursery_altered_rollback.sql | 28 +++++++++++++++ 2 files changed, 28 insertions(+), 36 deletions(-) create mode 100644 src/main/resources/db/migration/V16__POI_type_nursery_altered_rollback.sql diff --git a/src/main/java/no/nibio/vips/logic/entity/PointOfInterestTypeNursery.java b/src/main/java/no/nibio/vips/logic/entity/PointOfInterestTypeNursery.java index 0a1c0f2d..377a46be 100644 --- a/src/main/java/no/nibio/vips/logic/entity/PointOfInterestTypeNursery.java +++ b/src/main/java/no/nibio/vips/logic/entity/PointOfInterestTypeNursery.java @@ -20,12 +20,9 @@ package no.nibio.vips.logic.entity; import java.io.Serializable; -import java.util.Map; -import javax.persistence.Column; import javax.persistence.DiscriminatorValue; import javax.persistence.Entity; import javax.persistence.Table; -import javax.persistence.Transient; /** * @copyright 2023 <a href="http://www.nibio.no/">NIBIO</a> @@ -36,37 +33,4 @@ import javax.persistence.Transient; @Table(name = "point_of_interest_nursery") public class PointOfInterestTypeNursery extends PointOfInterest implements Serializable { - private Double impactRadius; - - /** - * Radius (in km) of the expected impact (implemented for fire blight) - * of the nursery. Used for map rendering - * @return the impactRadius - */ - @Column(name="impact_radius") - public Double getImpactRadius() { - return impactRadius; - } - - /** - * @param impactRadius the impactRadius to set - */ - public void setImpactRadius(Double impactRadius) { - this.impactRadius = impactRadius; - } - - @Transient - @Override - public String getGeoJSON() - { - this.addProperty("impactRadius", this.getImpactRadius()); - return super.getGeoJSON(); - } - - @Transient - @Override - public Map<String,Object> getProperties() { - this.addProperty("impactRadius", this.getImpactRadius()); - return super.getProperties(); - } } diff --git a/src/main/resources/db/migration/V16__POI_type_nursery_altered_rollback.sql b/src/main/resources/db/migration/V16__POI_type_nursery_altered_rollback.sql new file mode 100644 index 00000000..c9179e6a --- /dev/null +++ b/src/main/resources/db/migration/V16__POI_type_nursery_altered_rollback.sql @@ -0,0 +1,28 @@ +/* + * Copyright (c) 2023 NIBIO <http://www.nibio.no/>. + * + * This file is part of VIPSLogic. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + * + */ +/** + * Author: Tor-Einar Skog <tor-einar.skog@nibio.no> + * Created: September 29th, 2023 + */ + + + +-- Rollback adding of property impact_radius to POI type nursery +ALTER TABLE public.point_of_interest_nursery + DROP COLUMN impact_radius; \ No newline at end of file -- GitLab