From 9f82c403098bb96acd8b7116f84416d3b4643b57 Mon Sep 17 00:00:00 2001 From: lucashemi Date: Fri, 24 Feb 2023 16:14:01 -0300 Subject: api-appointments --- api/src/main/resources/application-prod.properties | 4 ++++ api/src/main/resources/application-test.properties | 1 + .../resources/db/migration/V7__create-table-appointments.sql | 12 ++++++++++++ ...table-appointments-add-column-reason-for-cancellation.sql | 1 + .../V9__alter-table-appointments-add-column-active.sql | 1 + 5 files changed, 19 insertions(+) create mode 100644 api/src/main/resources/application-prod.properties create mode 100644 api/src/main/resources/application-test.properties create mode 100644 api/src/main/resources/db/migration/V7__create-table-appointments.sql create mode 100644 api/src/main/resources/db/migration/V8__alter-table-appointments-add-column-reason-for-cancellation.sql create mode 100644 api/src/main/resources/db/migration/V9__alter-table-appointments-add-column-active.sql (limited to 'api/src/main/resources') diff --git a/api/src/main/resources/application-prod.properties b/api/src/main/resources/application-prod.properties new file mode 100644 index 0000000..49041d6 --- /dev/null +++ b/api/src/main/resources/application-prod.properties @@ -0,0 +1,4 @@ +# Database config +spring.datasource.url=${DATASOURCE_URL} +spring.datasource.username=${DATASOURCE_USERNAME} +spring.datasource.password=${DATASOURCE_PASSWORD} \ No newline at end of file diff --git a/api/src/main/resources/application-test.properties b/api/src/main/resources/application-test.properties new file mode 100644 index 0000000..66d87f4 --- /dev/null +++ b/api/src/main/resources/application-test.properties @@ -0,0 +1 @@ +spring.datasource.url=jdbc:mariadb://localhost/voll_med_api_test \ No newline at end of file diff --git a/api/src/main/resources/db/migration/V7__create-table-appointments.sql b/api/src/main/resources/db/migration/V7__create-table-appointments.sql new file mode 100644 index 0000000..388810c --- /dev/null +++ b/api/src/main/resources/db/migration/V7__create-table-appointments.sql @@ -0,0 +1,12 @@ +create table appointments +( + id bigint not null auto_increment, + doctor_id bigint not null, + patient_id bigint not null, + date datetime not null, + + primary key (id), + constraint fk_appointments_doctor_id foreign key(doctor_id) references doctors(id), + constraint fk_appointments_patient_id foreign key(patient_id) references patients(id) + +); \ No newline at end of file diff --git a/api/src/main/resources/db/migration/V8__alter-table-appointments-add-column-reason-for-cancellation.sql b/api/src/main/resources/db/migration/V8__alter-table-appointments-add-column-reason-for-cancellation.sql new file mode 100644 index 0000000..b1b3fde --- /dev/null +++ b/api/src/main/resources/db/migration/V8__alter-table-appointments-add-column-reason-for-cancellation.sql @@ -0,0 +1 @@ +alter table appointments add column reason_for_cancellation varchar(100); \ No newline at end of file diff --git a/api/src/main/resources/db/migration/V9__alter-table-appointments-add-column-active.sql b/api/src/main/resources/db/migration/V9__alter-table-appointments-add-column-active.sql new file mode 100644 index 0000000..b02bda9 --- /dev/null +++ b/api/src/main/resources/db/migration/V9__alter-table-appointments-add-column-active.sql @@ -0,0 +1 @@ +alter table appointments add column active tinyint; \ No newline at end of file -- cgit v1.2.3-18-g5258