浏览代码

liquibase testing

Andrew Grant 5 月之前
父节点
当前提交
177956ed3c

+ 3 - 0
src/main/resources/application-uat.properties

@@ -1,3 +1,6 @@
+# Set up for uat
+spring.datasource.url=jdbc:mariadb://git.carricksoftware.co.uk:3306/grants_uat
+spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQLDialect
 
 
 

+ 1 - 1
src/main/resources/application.properties

@@ -2,7 +2,7 @@ spring.application.name=grants
 server.port=8086
 server.servlet.context-path=/grants
 spring.mvc.format.date=dd-MM-yyyy
-spring.profiles.active=dev
+spring.profiles.active=uat
 logging.level.scot.carricksoftware=debug
 
 

+ 2 - 2
src/main/resources/db/changelog/migration/master.xml → src/main/resources/db/changelog/master.xml

@@ -2,7 +2,7 @@
 <databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-2.0.xsd">
 
-    <include file="db/changelog/migration/_0.1.0_migrate.sql" /> 
-    <include file="db/changelog/migration/_0.2.0_migrate.sql" /> 
+    <include file="/db/changelog/migration/_0.1.0_migrate.sql" />
+    <include file="/db/changelog/migration/_0.2.0_migrate.sql" />
 
 </databaseChangeLog>

+ 2 - 4
src/main/resources/db/changelog/migration/_0.1.0_migrate.sql

@@ -1,12 +1,10 @@
 -- liquibase formatted sql
 -- changeset zuhaimi:1677359372272-1
 CREATE TABLE `groups` (
-    id BIGINT GENERATED BY DEFAULT AS IDENTITY NOT NULL,
-    created_time TIMESTAMP(6) WITHOUT TIME ZONE,
+    id BIGINT,
     description VARCHAR(500),
-    modified_time TIMESTAMP(6) WITHOUT TIME ZONE,
     name VARCHAR(100),
-    CONSTRAINT "groupsPK" PRIMARY KEY (id)
+    CONSTRAINT`groupsPK` PRIMARY KEY (id)
 );
 
 -- changeset zuhaimi:1677359372272-2

+ 3 - 3
src/main/resources/db/changelog/migration/_0.2.0_migrate.sql

@@ -1,8 +1,8 @@
 -- liquibase formatted sql
 -- changeset zuhaimi:1677359720411-3
-CREATE TABLE department (
-    id BIGINT GENERATED BY DEFAULT AS IDENTITY NOT NULL,
+CREATE TABLE `department` (
+    id BIGINT NOT NULL,
     name VARCHAR(255),
-    CONSTRAINT "departmentPK" PRIMARY KEY (id)
+    CONSTRAINT `departmentP` PRIMARY KEY (id)
 );
 

+ 1 - 1
src/main/resources/liquibase.properties

@@ -1,7 +1,7 @@
 #changeLogFile: src/main/resources/db/changelog/master.xml
 logging: debug
 #driver: org.postgresql.Driver
-url: url:jdbc:mariadb://git.carricksoftware.co.uk:3306/grants_uat
+url: jdbc:mariadb://git.carricksoftware.co.uk:3306/grants_uat
 
 username: apg
 password: sjkis27