apg 2 nedēļas atpakaļ
vecāks
revīzija
fc82c4e634

+ 2 - 2
docs/additions.txt

@@ -16,8 +16,8 @@
 12.3 Capitalisation Integration Test
 13: Switch to uat
 13.1: In the database window select the uat database *** and then refresh it***
-14: Generate changelog (ctrl-shift-A) as sql
-14.1 :Edit the file to add COLUMN IF NOT EXISTS to the entries
+14: Generate changelog (ctrl-shift-A) as sql   ----- does not work now!
+14.1: right-click on the database and "create liquibase changelog"
 15: Add the new file to master.xml
 16: Run in terminal  mvn clean test liquibase:update
 

+ 16 - 33
pom.xml

@@ -10,7 +10,8 @@
     <parent>
         <groupId>org.springframework.boot</groupId>
         <artifactId>spring-boot-starter-parent</artifactId>
-        <version>3.4.0</version>
+        <version>3.5.7</version>
+        <type>pom</type>
         <relativePath/> <!-- lookup parent from repository -->
     </parent>
     <groupId>scot.carricksoftware</groupId>
@@ -41,14 +42,17 @@
             <groupId>org.springframework.boot</groupId>
             <artifactId>spring-boot-starter-data-jpa</artifactId>
         </dependency>
+
         <dependency>
             <groupId>org.springframework.boot</groupId>
             <artifactId>spring-boot-starter-thymeleaf</artifactId>
         </dependency>
+
         <dependency>
             <groupId>org.springframework.boot</groupId>
             <artifactId>spring-boot-starter-web</artifactId>
         </dependency>
+
         <!-- https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-test -->
         <dependency>
             <groupId>org.springframework.boot</groupId>
@@ -78,15 +82,13 @@
             <artifactId>mariadb-java-client</artifactId>
             <scope>runtime</scope>
         </dependency>
+
         <dependency>
             <groupId>org.sonarsource.scanner.maven</groupId>
             <artifactId>sonar-maven-plugin</artifactId>
             <version>5.0.0.4389</version>
         </dependency>
-        <dependency>
-            <groupId>org.springframework.boot</groupId>
-            <artifactId>spring-boot-starter-web</artifactId>
-        </dependency>
+
 
         <dependency>
             <groupId>org.hibernate.validator</groupId>
@@ -115,6 +117,14 @@
             <scope>test</scope>
         </dependency>
 
+        <!-- https://mvnrepository.com/artifact/org.liquibase.ext/liquibase-hibernate6 -->
+        <dependency>
+            <groupId>org.liquibase.ext</groupId>
+            <artifactId>liquibase-hibernate6</artifactId>
+            <version>5.0.1</version>
+            <scope>runtime</scope>
+        </dependency>
+
 
     </dependencies>
     <build>
@@ -162,7 +172,6 @@
             </plugin>
 
             <plugin>
-
                 <groupId>org.liquibase</groupId>
                 <artifactId>liquibase-maven-plugin</artifactId>
                 <version>4.31.1</version>
@@ -170,36 +179,10 @@
                     <changeLogFile>src/main/resources/db/changelog/master.xml</changeLogFile>
                     <outputChangeLogFile>src/main/resources/db/changelog/migration/1.0_init.postgresql.sql
                     </outputChangeLogFile>
-                                       <propertyFile>src/main/resources/liquibase.properties</propertyFile>
+                    <propertyFile>src/main/resources/liquibase.properties</propertyFile>
                 </configuration>
-
-                <dependencies>
-                    <dependency>
-                        <groupId>org.liquibase.ext</groupId>
-                        <artifactId>liquibase-hibernate</artifactId>
-                        <version>5.0.1</version>
-                    </dependency>
-                    <dependency>
-                        <groupId>org.springframework.data</groupId>
-                        <artifactId>spring-data-jpa</artifactId>
-                        <version>3.0.2</version>
-                    </dependency>
-                    <dependency>
-                        <groupId>io.hypersistence</groupId>
-                        <artifactId>hypersistence-utils-hibernate-60</artifactId>
-                        <version>3.9.4</version>
-                    </dependency>
-                    <dependency>
-                        <groupId>com.fasterxml.jackson.core</groupId>
-                        <artifactId>jackson-databind</artifactId>
-                        <version>2.14.2</version>
-                    </dependency>
-
-                </dependencies>
-
             </plugin>
 
-
         </plugins>
     </build>
 

+ 15 - 0
src/main/java/scot/carricksoftware/grants/domains/places/18-01-changelog.sql

@@ -0,0 +1,15 @@
+/*
+ * Copyright (c) 2025.  Andrew Grant Carrick Software. All rights reserved
+ *
+ */
+
+-- liquibase formatted sql
+
+-- changeset apg:1763501979947-1
+CREATE TABLE organisation
+(
+    id   BIGINT AUTO_INCREMENT NOT NULL,
+    name VARCHAR(255)          NULL,
+    CONSTRAINT pk_organisation PRIMARY KEY (id)
+);
+

+ 15 - 0
src/main/java/scot/carricksoftware/grants/domains/places/18-02-changelog.sql

@@ -0,0 +1,15 @@
+/*
+ * Copyright (c) 2025.  Andrew Grant Carrick Software. All rights reserved
+ *
+ */
+
+-- liquibase formatted sql
+
+-- changeset apg:1763502251399-1
+CREATE TABLE organisation
+(
+    id   BIGINT AUTO_INCREMENT NOT NULL,
+    name VARCHAR(255)          NULL,
+    CONSTRAINT pk_organisation PRIMARY KEY (id)
+);
+

+ 24 - 0
src/main/java/scot/carricksoftware/grants/domains/places/18-03-changelog.sql

@@ -0,0 +1,24 @@
+/*
+ * Copyright (c) 2025.  Andrew Grant Carrick Software. All rights reserved
+ *
+ */
+
+-- liquibase formatted sql
+
+-- changeset apg:1763502408162-1
+CREATE TABLE document_image
+(
+    id       BIGINT AUTO_INCREMENT NOT NULL,
+    image_id BIGINT                NULL,
+    level    VARCHAR(255)          NULL,
+    `order`  VARCHAR(255)          NULL,
+    caption  VARCHAR(255)          NULL,
+    height   VARCHAR(255)          NULL,
+    width    VARCHAR(255)          NULL,
+    CONSTRAINT pk_document_image PRIMARY KEY (id)
+);
+
+-- changeset apg:1763502408162-2
+ALTER TABLE document_image
+    ADD CONSTRAINT FK_DOCUMENT_IMAGE_ON_IMAGE FOREIGN KEY (image_id) REFERENCES image (id);
+

+ 20 - 0
src/main/resources/db/changelog/2025/11/18-01-changelog.sql

@@ -0,0 +1,20 @@
+/*
+ * Copyright (c) 2025.  Andrew Grant Carrick Software. All rights reserved
+ *
+ */
+
+-- liquibase formatted sql
+
+-- changeset apg:1763502561268-1
+CREATE TABLE document_image
+(
+    id       BIGINT AUTO_INCREMENT NOT NULL,
+    image_id BIGINT                NULL,
+    level    VARCHAR(255)          NULL,
+    `order`  VARCHAR(255)          NULL,
+    caption  VARCHAR(255)          NULL,
+    height   VARCHAR(255)          NULL,
+    width    VARCHAR(255)          NULL,
+    CONSTRAINT pk_document_image PRIMARY KEY (id)
+);
+

+ 11 - 0
src/main/resources/db/changelog/2025/11/18-02-changelog.sql

@@ -0,0 +1,11 @@
+/*
+ * Copyright (c) 2025.  Andrew Grant Carrick Software. All rights reserved
+ *
+ */
+
+-- liquibase formatted sql
+
+-- changeset apg:1763502561268-2
+ALTER TABLE document_image
+    ADD CONSTRAINT FK_DOCUMENT_IMAGE_ON_IMAGE FOREIGN KEY (image_id) REFERENCES image (id);
+

+ 1 - 0
src/main/resources/db/changelog/master.xml

@@ -69,6 +69,7 @@
     <include file="/db/changelog/2025/11/04-02-changelog.sql"/>
     <include file="/db/changelog/2025/11/04-03-changelog.sql"/>
     <include file="/db/changelog/2025/11/04-04-changelog.sql"/>
+    <include file="/db/changelog/2025/11/18-01-changelog.sql"/>
 
 
 </databaseChangeLog>