From ea4bfe281f456998f7bf08cb273b9288c638cff8 Mon Sep 17 00:00:00 2001 From: Anton Dzyk Date: Thu, 11 Dec 2025 22:29:35 +0300 Subject: [PATCH] =?UTF-8?q?=D1=82=D0=B0=D0=B1=D0=BB=D0=B8=D1=86=D0=B0=20ta?= =?UTF-8?q?sk,=20=D0=BC=D0=B8=D0=B3=D1=80=D0=B0=D1=86=D0=B8=D1=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- debug/application.yaml | 5 ++++ pom.xml | 11 +++++++++ .../ru/oa2/lti/repository/entities/Task.java | 6 ++++- src/main/resources/application.properties | 2 -- src/main/resources/application.yaml | 15 ++++++++++++ .../db/changelog/1.0.0/2025-12-add_task.xml | 24 +++++++++++++++++++ .../db/{ => changelog}/changelog-master.xml | 2 +- 7 files changed, 61 insertions(+), 4 deletions(-) create mode 100644 debug/application.yaml delete mode 100644 src/main/resources/application.properties create mode 100644 src/main/resources/application.yaml create mode 100644 src/main/resources/db/changelog/1.0.0/2025-12-add_task.xml rename src/main/resources/db/{ => changelog}/changelog-master.xml (85%) 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