Skip to content

Commit d9a72dd

Browse files
author
Piotr Kubicki
committed
feat: add constraint END_DATE_TIME > DATE_TIME for APPOINTMENT
1 parent 8adf998 commit d9a72dd

File tree

5 files changed

+14
-11
lines changed

5 files changed

+14
-11
lines changed

src/main/resources/application.properties

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
application.title=Appointment Booking Application
2+
13
spring.application.name=appointment-booking-app
24

35
spring.h2.console.enabled=true
@@ -16,4 +18,4 @@ spring.flyway.clean-on-validation-error=true
1618

1719
spring.jpa.hibernate.ddl-auto=none
1820

19-
spring.banner.location=classpath:/banner/jbf_banner.txt
21+
spring.banner.location=classpath:/banner/jbd_banner.txt
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
____. __________ __ .___ ________ .__
2+
| |____ ___ _______ \______ \_____ ____ | | __ ____ ____ __| _/ \______ \ _______ __ ____ | | ____ ______ ___________
3+
| \__ \\ \/ /\__ \ | | _/\__ \ _/ ___\| |/ // __ \ / \ / __ | | | \_/ __ \ \/ // __ \| | / _ \\____ \_/ __ \_ __ \
4+
/\__| |/ __ \\ / / __ \_ | | \ / __ \\ \___| <\ ___/| | \/ /_/ | | ` \ ___/\ /\ ___/| |_( <_> ) |_> > ___/| | \/
5+
\________(____ /\_/ (____ / |______ /(____ /\___ >__|_ \\___ >___| /\____ | /_______ /\___ >\_/ \___ >____/\____/| __/ \___ >__|
6+
\/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ |__| \/
7+
${application.title} ${application.version}
8+
Powered by Spring Boot ${spring-boot.version}

src/main/resources/banner/jbf_banner.txt

Lines changed: 0 additions & 8 deletions
This file was deleted.

src/main/resources/db/migration/1.0/V0001__Create_schema.sql

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,8 @@ CREATE TABLE APPOINTMENT (
5757
LAST_UPDATED TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
5858
PRIMARY KEY (ID),
5959
FOREIGN KEY (CLIENT_ID) REFERENCES CLIENT(ID) ON DELETE CASCADE,
60-
FOREIGN KEY (TREATMENT_ID) REFERENCES TREATMENT(ID) ON DELETE CASCADE
60+
FOREIGN KEY (TREATMENT_ID) REFERENCES TREATMENT(ID) ON DELETE CASCADE,
61+
CONSTRAINT CHK_APPOINTMENT_END_AFTER_START CHECK (END_DATE_TIME > DATE_TIME)
6162
);
6263

6364
-- CREATING SEQUENCES

src/test/java/com/capgemini/training/appointmentbooking/dataaccess/entity/EntitySmokeIT.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
import jakarta.persistence.PersistenceContext;
1313

1414
@DataJpaTest
15-
public class EntitySmokeIT {
15+
class EntitySmokeIT {
1616

1717
@PersistenceContext
1818
private EntityManager em;

0 commit comments

Comments
 (0)