Skip to content

Commit

Permalink
Delete price column
Browse files Browse the repository at this point in the history
  • Loading branch information
Fagorym committed May 19, 2024
1 parent ddd0bd9 commit 1e41556
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
import com.fasterxml.jackson.annotation.JsonSubTypes;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import jakarta.validation.Valid;
import jakarta.validation.constraints.Max;
import jakarta.validation.constraints.Min;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Size;
import lombok.Data;
Expand Down Expand Up @@ -49,14 +47,6 @@ public class RequestEstablishmentDto {
private String category;
@NotNull(message = "Основное изображение не может быть не задано.")
private String image;
@Min(value = 1, message = "Рейтинг не может быть меньше 1.")
@Max(value = 5, message = "Рейтинг не может быть больше 5.")
@NotNull(message = "Рейтинг не может быть не задан.")
private Float rating;
@Max(value = 10000, message = "Средний чек не может быть больше 10000")
@Min(value = 500, message = "Средний чек не может быть меньше 500")
@NotNull(message = "Информация о среднем чеке не может быть не задана.")
private Integer price;
@NotNull(message = "Информация о рабочих часах заведения не может быть не задано.")
@Size(min = 1, max = 7, message = "Дней работы не может быть меньше 1 и больше 7")
@Valid
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,6 @@ public class Establishment {

private Float rating;

private Integer price;

@Enumerated(EnumType.STRING)
@Column(name = "category", insertable = false, updatable = false)
private Category category;
Expand Down
2 changes: 2 additions & 0 deletions src/main/resources/db/migration/V13__drop_price_column.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
ALTER TABLE establishments
DROP COLUMN price;
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
description="Милый китайский ресторанчик в центре Москвы"
address="г. Москва, улица Бронная д. 45"
rating="4.5"
price="4000"
has_map="false"
has_card_payment="true"
image="image"
Expand Down

0 comments on commit 1e41556

Please sign in to comment.