Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

테이블 인덱스 추가 #192

Merged
merged 2 commits into from
Nov 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
import com.auth0.jwt.exceptions.JWTCreationException;
import com.auth0.jwt.exceptions.JWTVerificationException;
import com.kakao.sunsuwedding._core.errors.BaseException;
import com.kakao.sunsuwedding._core.errors.exception.ForbiddenException;
import com.kakao.sunsuwedding._core.errors.exception.NotFoundException;
import com.kakao.sunsuwedding._core.errors.exception.UnauthorizedException;
import com.kakao.sunsuwedding._core.utils.FilterResponseUtils;
import jakarta.servlet.FilterChain;
Expand All @@ -31,7 +29,7 @@ protected void doFilterInternal(HttpServletRequest request, HttpServletResponse
try {
chain.doFilter(request, response);
}
catch (UnauthorizedException | ForbiddenException | NotFoundException exception) {
catch (UnauthorizedException exception) {
filterResponseUtils.writeResponse(response, exception);
}
catch (JWTCreationException | JWTVerificationException e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,11 @@
import java.time.LocalDateTime;

@Entity
@Table(name="favorite_tb")
@Table(
name="favorite_tb",
indexes = {
@Index(name = "user_portfolio_index", columnList = "user_id,portfolio_id")
})
@Getter
@NoArgsConstructor(access = AccessLevel.PROTECTED)
public class Favorite {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,12 @@


@Entity
@Table(name="match_tb")
@Table(
name="match_tb",
indexes = {
@Index(name = "match_couple_planner_index", columnList = "planner_id,couple_id"),
@Index(name = "match_chat_index", columnList = "chat_id")
})
@SQLDelete(sql = "UPDATE match_tb SET is_active = false WHERE id = ?")
@Where(clause = "is_active = true")
@Getter
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,11 @@
import java.time.LocalDateTime;

@Entity
@Table(name="payment_tb")
@Table(
name="payment_tb",
indexes = {
@Index(name = "user_index", columnList = "user_id")
})
@SQLDelete(sql = "UPDATE payment_tb SET is_active = false WHERE id = ?")
@Where(clause = "is_active = true")
@Getter
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import com.kakao.sunsuwedding.user.planner.Planner;
import jakarta.persistence.*;
import jakarta.persistence.Index;
import jakarta.persistence.Table;
import lombok.AccessLevel;
import lombok.Builder;
Expand All @@ -12,7 +13,11 @@
import java.time.LocalDateTime;

@Entity
@Table(name = "portfolio_tb")
@Table(
name = "portfolio_tb",
indexes = {
@Index(name = "planner_index", columnList = "planner_id")
})
@SQLDelete(sql = "UPDATE portfolio_tb SET is_active = false WHERE id = ?")
@Where(clause = "is_active = true")
@Getter
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@


@Entity
@Table(name = "portfolio_image_item_tb")
@Table(
name = "portfolio_image_item_tb",
indexes = {
@Index(name = "portoflio_image_index", columnList = "portfolio_id")
})
@NamedEntityGraphs({
@NamedEntityGraph(
name = "ImageItemWithPortfolio",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@


@Entity
@Table(name = "price_item_tb")
@Table(
name = "price_item_tb",
indexes = {
@Index(name = "portfolio_price_index", columnList = "portfolio_id")
})
@NamedEntityGraphs({
@NamedEntityGraph(
name = "PriceItemWithPortfolio",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,11 @@


@Entity
@Table(name="quotation_tb")
@Table(
name="quotation_tb",
indexes = {
@Index(name = "match_index", columnList = "match_id")
})
@NamedEntityGraph(name = "QuotationWithMatch",
attributeNodes = @NamedAttributeNode("match"))
@Getter
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package com.kakao.sunsuwedding.review;

import com.kakao.sunsuwedding.match.Match;
import com.kakao.sunsuwedding.user.planner.Planner;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
Expand All @@ -10,7 +9,6 @@
import java.util.List;

public interface ReviewJPARepository extends JpaRepository<Review, Long> {
List<Review> findAllByMatch(Match match);
List<Review> findAllByMatchCoupleId(@Param("coupleId")Long coupleId);
Page<Review> findAllByMatchPlannerId(Long plannerId, Pageable pageable);
List<Review> findAllByMatchPlanner(Planner planner);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@
import lombok.NoArgsConstructor;

@Entity
@Table(name = "review_imageitem_tb")
@Table(
name = "review_imageitem_tb",
indexes = {
@Index(name = "review_index", columnList = "review_id")
})
@Getter
@NoArgsConstructor(access = AccessLevel.PROTECTED)
public class ReviewImageItem {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@
name="user_tb",
uniqueConstraints = {
@UniqueConstraint(columnNames = {"id", "email", "is_active"})
},
indexes = {
@Index(name = "email_index", columnList = "email")
})
@Inheritance(strategy = InheritanceType.SINGLE_TABLE)
@DiscriminatorColumn(name = "dtype")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,11 @@
import java.time.LocalDateTime;

@Entity
@Table(name="email_code_tb")
@Table(
name="email_code_tb",
indexes = {
@Index(name = "user_email_index", columnList = "email")
})
@SQLDelete(sql = "UPDATE email_code_tb SET is_active = false WHERE id = ?")
@Where(clause = "is_active = true")
@Getter
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@
import lombok.NoArgsConstructor;

@Entity
@Table(name = "token_tb")
@Table(
name = "token_tb",
indexes = {
@Index(name = "token_user_index", columnList = "user_id")
})
@Getter
@NoArgsConstructor(access = AccessLevel.PROTECTED)
public class Token {
Expand Down
Loading