diff --git a/build.gradle b/build.gradle index 57fb1434879e743256de069ce00e844c2c4dc68f..e83ee87cd07bbf09236557a4c3206aeb8001bc6f 100644 --- a/build.gradle +++ b/build.gradle @@ -30,8 +30,8 @@ dependencies { annotationProcessor 'org.projectlombok:lombok' testImplementation 'org.springframework.boot:spring-boot-starter-test' implementation 'org.springframework.boot:spring-boot-starter-validation' -// implementation 'org.springframework.boot:spring-boot-starter-jdbc' -// implementation 'org.mariadb.jdbc:mariadb-java-client:2.1.2' + implementation 'org.springframework.boot:spring-boot-starter-jdbc' + implementation 'org.mariadb.jdbc:mariadb-java-client:2.1.2' } tasks.named('bootBuildImage') { diff --git a/clientUsers.db b/clientUsers.db new file mode 100644 index 0000000000000000000000000000000000000000..0310bc11880ed24271bf932342496a0213c4e889 Binary files /dev/null and b/clientUsers.db differ diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index 8b137891791fe96927ad78e64b0aad7bded08bdc..d7f55564959ed4314950c6ee0bc5de780fb84068 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -1 +1,4 @@ - +spring.datasource.url=jdbc:mariadb://localhost:3306/rhys +spring.datasource.username=root +spring.datasource.password=comsc +spring.sql.init.mode=always diff --git a/src/main/resources/templates/data.sql b/src/main/resources/templates/data.sql new file mode 100644 index 0000000000000000000000000000000000000000..6b7393c40a7270b6fe77a268b58ca0d44c4b4d66 --- /dev/null +++ b/src/main/resources/templates/data.sql @@ -0,0 +1,2 @@ +delete from rhys; +insert into rhys (name, tel_number) values ( 'Ian', '111'); \ No newline at end of file diff --git a/src/main/resources/templates/schema.sql b/src/main/resources/templates/schema.sql new file mode 100644 index 0000000000000000000000000000000000000000..0338f622247fb789c12ccb624befafb26f775181 --- /dev/null +++ b/src/main/resources/templates/schema.sql @@ -0,0 +1,6 @@ +drop table if exists rhys; +create table if not exists rhys ( + id bigint auto_increment primary key, + name varchar(128), + tel_number varchar(128) +) engine=InnoDB; \ No newline at end of file