diff --git a/debug/application.yaml b/debug/application.yaml new file mode 100644 index 0000000..a056c55 --- /dev/null +++ b/debug/application.yaml @@ -0,0 +1,5 @@ +spring: + datasource: + url: jdbc:postgresql://localhost:5432/lti + username: postgres + password: postgres \ No newline at end of file diff --git a/pom.xml b/pom.xml index c174c57..127ba4f 100644 --- a/pom.xml +++ b/pom.xml @@ -43,6 +43,17 @@ spring-boot-starter-test + + org.liquibase + liquibase-core + + + + org.postgresql + postgresql + 42.7.8 + + diff --git a/src/main/java/ru/oa2/lti/repository/entities/Task.java b/src/main/java/ru/oa2/lti/repository/entities/Task.java index 96582ad..cebbd83 100644 --- a/src/main/java/ru/oa2/lti/repository/entities/Task.java +++ b/src/main/java/ru/oa2/lti/repository/entities/Task.java @@ -4,13 +4,17 @@ import jakarta.persistence.*; import ru.oa2.lti.model.TaskType; @Entity +@Table(name = "task") public class Task { @Id - @GeneratedValue(strategy = GenerationType.IDENTITY) + @GeneratedValue(strategy = GenerationType.AUTO) long taskId; @Column(length = 20) @Enumerated(EnumType.STRING) TaskType taskType; + + @Column(columnDefinition = "jsonb") + Object data; } diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties deleted file mode 100644 index f5c7423..0000000 --- a/src/main/resources/application.properties +++ /dev/null @@ -1,2 +0,0 @@ -spring.application.name=lti-provider -server.port=9999 diff --git a/src/main/resources/application.yaml b/src/main/resources/application.yaml new file mode 100644 index 0000000..dec1a39 --- /dev/null +++ b/src/main/resources/application.yaml @@ -0,0 +1,15 @@ +spring: + + application: + name: lti-provider + + liquibase: + change-log: classpath:db/changelog/changelog-master.xml + + datasource: + driver-class-name: org.postgresql.Driver + +server: + port: 9999 + + diff --git a/src/main/resources/db/changelog/1.0.0/2025-12-add_task.xml b/src/main/resources/db/changelog/1.0.0/2025-12-add_task.xml new file mode 100644 index 0000000..a4f0a7f --- /dev/null +++ b/src/main/resources/db/changelog/1.0.0/2025-12-add_task.xml @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/main/resources/db/changelog-master.xml b/src/main/resources/db/changelog/changelog-master.xml similarity index 85% rename from src/main/resources/db/changelog-master.xml rename to src/main/resources/db/changelog/changelog-master.xml index d763f13..6902742 100644 --- a/src/main/resources/db/changelog-master.xml +++ b/src/main/resources/db/changelog/changelog-master.xml @@ -8,6 +8,6 @@ http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-4.3.xsd"> - + \ No newline at end of file