refactor: 테스트 GWT로 통일해서 사용할 수 있도록 구성 및 서브에이전트 파일 수정
This commit is contained in:
+3
@@ -8,6 +8,7 @@ import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.data.jpa.repository.Modifying;
|
||||
import org.springframework.data.jpa.repository.Query;
|
||||
import org.springframework.data.repository.query.Param;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import com.study.course_registration.entity.RegistrationIdempotency;
|
||||
|
||||
@@ -21,6 +22,7 @@ public interface RegistrationIdempotencyRepository extends JpaRepository<Registr
|
||||
Instant now);
|
||||
|
||||
@Modifying
|
||||
@Transactional
|
||||
@Query("""
|
||||
delete from RegistrationIdempotency value
|
||||
where value.user.id = :userId
|
||||
@@ -33,6 +35,7 @@ public interface RegistrationIdempotencyRepository extends JpaRepository<Registr
|
||||
@Param("now") Instant now);
|
||||
|
||||
@Modifying
|
||||
@Transactional
|
||||
@Query("delete from RegistrationIdempotency value where value.expiresAt <= :now")
|
||||
int deleteExpired(@Param("now") Instant now);
|
||||
}
|
||||
|
||||
@@ -8,7 +8,6 @@ CREATE TABLE semesters (
|
||||
registration_end_at TIMESTAMP WITH TIME ZONE NOT NULL,
|
||||
max_credits INTEGER NOT NULL,
|
||||
created_at TIMESTAMP WITH TIME ZONE NOT NULL,
|
||||
expires_at TIMESTAMP WITH TIME ZONE NOT NULL,
|
||||
updated_at TIMESTAMP WITH TIME ZONE NOT NULL,
|
||||
CONSTRAINT uk_semester_name UNIQUE (name),
|
||||
CONSTRAINT ck_semester_dates CHECK (end_date >= start_date),
|
||||
@@ -21,7 +20,6 @@ CREATE TABLE professors (
|
||||
version BIGINT NOT NULL DEFAULT 0,
|
||||
name VARCHAR(255) NOT NULL,
|
||||
created_at TIMESTAMP WITH TIME ZONE NOT NULL,
|
||||
expires_at TIMESTAMP WITH TIME ZONE NOT NULL,
|
||||
updated_at TIMESTAMP WITH TIME ZONE NOT NULL
|
||||
);
|
||||
|
||||
@@ -33,7 +31,6 @@ CREATE TABLE subjects (
|
||||
description VARCHAR(1000) NOT NULL,
|
||||
credit INTEGER NOT NULL,
|
||||
created_at TIMESTAMP WITH TIME ZONE NOT NULL,
|
||||
expires_at TIMESTAMP WITH TIME ZONE NOT NULL,
|
||||
updated_at TIMESTAMP WITH TIME ZONE NOT NULL,
|
||||
CONSTRAINT uk_subject_code UNIQUE (code),
|
||||
CONSTRAINT ck_subject_credit CHECK (credit >= 1)
|
||||
@@ -46,7 +43,6 @@ CREATE TABLE users (
|
||||
grade BIGINT NOT NULL,
|
||||
role VARCHAR(64) NOT NULL,
|
||||
created_at TIMESTAMP WITH TIME ZONE NOT NULL,
|
||||
expires_at TIMESTAMP WITH TIME ZONE NOT NULL,
|
||||
updated_at TIMESTAMP WITH TIME ZONE NOT NULL,
|
||||
CONSTRAINT ck_user_grade CHECK (grade >= 1)
|
||||
);
|
||||
@@ -62,7 +58,6 @@ CREATE TABLE lessons (
|
||||
min_grade BIGINT,
|
||||
allowed_role VARCHAR(64),
|
||||
created_at TIMESTAMP WITH TIME ZONE NOT NULL,
|
||||
expires_at TIMESTAMP WITH TIME ZONE NOT NULL,
|
||||
updated_at TIMESTAMP WITH TIME ZONE NOT NULL,
|
||||
CONSTRAINT fk_lesson_subject FOREIGN KEY (subject_id) REFERENCES subjects(id),
|
||||
CONSTRAINT fk_lesson_professor FOREIGN KEY (professor_id) REFERENCES professors(id),
|
||||
@@ -79,7 +74,6 @@ CREATE TABLE lesson_schedules (
|
||||
start_time TIME NOT NULL,
|
||||
end_time TIME NOT NULL,
|
||||
created_at TIMESTAMP WITH TIME ZONE NOT NULL,
|
||||
expires_at TIMESTAMP WITH TIME ZONE NOT NULL,
|
||||
updated_at TIMESTAMP WITH TIME ZONE NOT NULL,
|
||||
CONSTRAINT fk_schedule_lesson FOREIGN KEY (lesson_id) REFERENCES lessons(id),
|
||||
CONSTRAINT ck_schedule_day CHECK (day_of_week BETWEEN 1 AND 7),
|
||||
@@ -93,7 +87,6 @@ CREATE TABLE user_lessons (
|
||||
user_id VARCHAR(36) NOT NULL,
|
||||
lesson_id VARCHAR(36) NOT NULL,
|
||||
created_at TIMESTAMP WITH TIME ZONE NOT NULL,
|
||||
expires_at TIMESTAMP WITH TIME ZONE NOT NULL,
|
||||
canceled_at TIMESTAMP WITH TIME ZONE,
|
||||
active_lesson_id VARCHAR(36) GENERATED ALWAYS AS (CASE WHEN canceled_at IS NULL THEN lesson_id END),
|
||||
CONSTRAINT fk_user_lesson_user FOREIGN KEY (user_id) REFERENCES users(id),
|
||||
|
||||
Reference in New Issue
Block a user