Commit 27d6fe3f authored by Alex Pinto's avatar Alex Pinto
parents 68f5bea0 124fe2b7
...@@ -2,7 +2,10 @@ ...@@ -2,7 +2,10 @@
# Setup postgres docker container # Setup postgres docker container
docker create --name student-details-pgdb -e POSTGRES_PASSWORD=admin -p 5432:5432 postgres:11.5-alpine docker create --name student-details-pgdb -e POSTGRES_PASSWORD=admin -p 5432:5432 postgres:11.5-alpine
# Enter into the psql shell and create the database # Start the postgres docker container
docker start student-details-pgdb
# Below will enter into the psql shell and create the database
docker exec -it student-details-pgdb psql -U postgres docker exec -it student-details-pgdb psql -U postgres
(psql) create database student_details; (psql) create database student_details;
......
...@@ -14,10 +14,10 @@ repositories { ...@@ -14,10 +14,10 @@ repositories {
dependencies { dependencies {
implementation 'org.springframework.boot:spring-boot-starter-web' implementation 'org.springframework.boot:spring-boot-starter-web'
//implementation 'org.springframework.boot:spring-boot-starter-data-jpa' implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
implementation 'org.springframework.boot:spring-boot-starter-actuator' implementation 'org.springframework.boot:spring-boot-starter-actuator'
implementation 'org.springframework.boot:spring-boot-starter-validation' implementation 'org.springframework.boot:spring-boot-starter-validation'
// runtimeOnly 'org.postgresql:postgresql' runtimeOnly 'org.postgresql:postgresql'
testImplementation 'org.springframework.boot:spring-boot-starter-test' testImplementation 'org.springframework.boot:spring-boot-starter-test'
} }
......
/*
package com.student.details.models; package com.student.details.models;
import javax.persistence.*; import javax.persistence.*;
...@@ -79,4 +78,3 @@ public class Student { ...@@ -79,4 +78,3 @@ public class Student {
this.course = course; this.course = course;
} }
} }
*/
/*
package com.student.details.repositories; package com.student.details.repositories;
import com.student.details.models.Student; import com.student.details.models.Student;
...@@ -8,4 +7,4 @@ import org.springframework.stereotype.Repository; ...@@ -8,4 +7,4 @@ import org.springframework.stereotype.Repository;
@Repository @Repository
public interface StudentRepository extends JpaRepository<Student, Long> { public interface StudentRepository extends JpaRepository<Student, Long> {
} }
*/
...@@ -2,7 +2,6 @@ ...@@ -2,7 +2,6 @@
spring.datasource.initialization-mode=always spring.datasource.initialization-mode=always
spring.datasource.initialize=true spring.datasource.initialize=true
spring.datasource.schema=classpath:/schema.sql
spring.datasource.continue-on-error=true spring.datasource.continue-on-error=true
DB_URL=jdbc:postgresql://localhost:5432/student_details DB_URL=jdbc:postgresql://localhost:5432/student_details
......
INSERT INTO student_details (email, firstName, lastName, dateOfBirth, course)
VALUES ('dyong@nisum.com', 'Darrick', 'Yong', DATE('1990-09-08'), 'Math'),
('apinto@nisum.com', 'Alex', 'Pinto', DATE('1997-07-04'), 'English'),
('banderson@nisum.com', 'Ben', 'Anderson', DATE('1993-09-20'), 'Chemistry'),
('ccottier@nisum.com', 'Chris', 'Cottier', DATE('1993-01-03'), 'Biology'),
('asegers@nisum.com', 'Alex', 'Segers', DATE('2021-04-01'), 'Debugging')
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment