You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: spring-modulith-events/spring-modulith-events-jdbc/src/main/java/org/springframework/modulith/events/jdbc/DatabaseSchemaInitializer.java
Copy file name to clipboardExpand all lines: spring-modulith-events/spring-modulith-events-jdbc/src/main/java/org/springframework/modulith/events/jdbc/DatabaseSchemaLocator.java
+14-5Lines changed: 14 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -19,6 +19,9 @@
19
19
importorg.springframework.core.io.ResourceLoader;
20
20
importorg.springframework.util.Assert;
21
21
22
+
importjava.util.Collection;
23
+
importjava.util.List;
24
+
22
25
/**
23
26
* Simple wrapper around a {@link ResourceLoader} to load database specific schema files from the classpath.
24
27
*
@@ -41,16 +44,22 @@ public class DatabaseSchemaLocator {
41
44
}
42
45
43
46
/**
44
-
* Loads the {@link Resource} containing the schema for the given {@link DatabaseType} from the classpath.
47
+
* Loads the {@link Resource} containing the schema for the given {@link JdbcRepositorySettings} from the classpath.
45
48
*
46
-
* @param databaseType must not be {@literal null}.
Copy file name to clipboardExpand all lines: spring-modulith-events/spring-modulith-events-jdbc/src/main/java/org/springframework/modulith/events/jdbc/DatabaseType.java
+4-1Lines changed: 4 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -25,6 +25,7 @@
25
25
* @author Björn Kieling
26
26
* @author Oliver Drotbohm
27
27
* @author Raed Ben Hamouda
28
+
* @author Cora Iberkleid
28
29
*/
29
30
enumDatabaseType {
30
31
@@ -106,7 +107,7 @@ boolean isSchemaSupported() {
106
107
}
107
108
};
108
109
109
-
staticfinalStringSCHEMA_NOT_SUPPORTED = "Setting the schema name not supported on MySQL!";
110
+
staticfinalStringSCHEMA_NOT_SUPPORTED = "Setting the schema name is not supported!";
Copy file name to clipboardExpand all lines: spring-modulith-events/spring-modulith-events-jdbc/src/main/java/org/springframework/modulith/events/jdbc/JdbcEventPublicationAutoConfiguration.java
Copy file name to clipboardExpand all lines: spring-modulith-events/spring-modulith-events-jdbc/src/main/java/org/springframework/modulith/events/jdbc/JdbcEventPublicationRepository.java
Copy file name to clipboardExpand all lines: spring-modulith-events/spring-modulith-events-jdbc/src/main/java/org/springframework/modulith/events/jdbc/JdbcRepositorySettings.java
+14Lines changed: 14 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -47,6 +47,10 @@ public class JdbcRepositorySettings {
47
47
this.databaseType = databaseType;
48
48
this.schema = schema;
49
49
this.completionMode = completionMode;
50
+
51
+
if (schema != null && !databaseType.isSchemaSupported()) {
CREATETABLEIF NOT EXISTS EVENT_PUBLICATION_ARCHIVE
2
+
(
3
+
ID UUID NOT NULL,
4
+
COMPLETION_DATE TIMESTAMP(9) WITH TIME ZONE,
5
+
EVENT_TYPE VARCHAR(512) NOT NULL,
6
+
LISTENER_ID VARCHAR(512) NOT NULL,
7
+
PUBLICATION_DATE TIMESTAMP(9) WITH TIME ZONENOT NULL,
8
+
SERIALIZED_EVENT VARCHAR(4000) NOT NULL,
9
+
PRIMARY KEY (ID)
10
+
);
11
+
CREATEINDEXIF NOT EXISTS EVENT_PUBLICATION_ARCHIVE_BY_LISTENER_ID_AND_SERIALIZED_EVENT_IDX ON EVENT_PUBLICATION_ARCHIVE (LISTENER_ID, SERIALIZED_EVENT);
12
+
CREATEINDEXIF NOT EXISTS EVENT_PUBLICATION_ARCHIVE_BY_COMPLETION_DATE_IDX ON EVENT_PUBLICATION_ARCHIVE (COMPLETION_DATE);
CREATETABLEIF NOT EXISTS EVENT_PUBLICATION_ARCHIVE
2
+
(
3
+
ID UUID NOT NULL,
4
+
COMPLETION_DATE TIMESTAMP(9),
5
+
EVENT_TYPE VARCHAR(512) NOT NULL,
6
+
LISTENER_ID VARCHAR(512) NOT NULL,
7
+
PUBLICATION_DATE TIMESTAMP(9) NOT NULL,
8
+
SERIALIZED_EVENT VARCHAR(4000) NOT NULL,
9
+
PRIMARY KEY (ID)
10
+
);
11
+
CREATEINDEXIF NOT EXISTS EVENT_PUBLICATION_ARCHIVE_BY_LISTENER_ID_AND_SERIALIZED_EVENT_IDX ON EVENT_PUBLICATION_ARCHIVE (LISTENER_ID, SERIALIZED_EVENT);
12
+
CREATEINDEXIF NOT EXISTS EVENT_PUBLICATION_ARCHIVE_BY_COMPLETION_DATE_IDX ON EVENT_PUBLICATION_ARCHIVE (COMPLETION_DATE);
0 commit comments