diff --git a/spring-modulith-events/spring-modulith-events-jdbc/src/main/resources/schema-h2.sql b/spring-modulith-events/spring-modulith-events-jdbc/src/main/resources/schema-h2.sql index d6cb9a64..805b9fbd 100644 --- a/spring-modulith-events/spring-modulith-events-jdbc/src/main/resources/schema-h2.sql +++ b/spring-modulith-events/spring-modulith-events-jdbc/src/main/resources/schema-h2.sql @@ -8,5 +8,5 @@ CREATE TABLE IF NOT EXISTS EVENT_PUBLICATION SERIALIZED_EVENT VARCHAR(4000) NOT NULL, PRIMARY KEY (ID) ); -CREATE INDEX IF NOT EXISTS EVENT_PUBLICATION_LISTENER_ID_SERIALIZED_EVENT_IDX ON EVENT_PUBLICATION (LISTENER_ID, SERIALIZED_EVENT); -CREATE INDEX IF NOT EXISTS EVENT_PUBLICATION_COMPLETION_DATE_IDX ON EVENT_PUBLICATION (COMPLETION_DATE); +CREATE INDEX IF NOT EXISTS EVENT_PUBLICATION_BY_LISTENER_ID_AND_SERIALIZED_EVENT_IDX ON EVENT_PUBLICATION (LISTENER_ID, SERIALIZED_EVENT); +CREATE INDEX IF NOT EXISTS EVENT_PUBLICATION_BY_COMPLETION_DATE_IDX ON EVENT_PUBLICATION (COMPLETION_DATE); diff --git a/spring-modulith-events/spring-modulith-events-jdbc/src/main/resources/schema-hsqldb.sql b/spring-modulith-events/spring-modulith-events-jdbc/src/main/resources/schema-hsqldb.sql index 9c1c2daf..a7bf4460 100644 --- a/spring-modulith-events/spring-modulith-events-jdbc/src/main/resources/schema-hsqldb.sql +++ b/spring-modulith-events/spring-modulith-events-jdbc/src/main/resources/schema-hsqldb.sql @@ -7,4 +7,6 @@ CREATE TABLE IF NOT EXISTS EVENT_PUBLICATION PUBLICATION_DATE TIMESTAMP(9) NOT NULL, SERIALIZED_EVENT VARCHAR(4000) NOT NULL, PRIMARY KEY (ID) -) +); +CREATE INDEX IF NOT EXISTS EVENT_PUBLICATION_BY_LISTENER_ID_AND_SERIALIZED_EVENT_IDX ON EVENT_PUBLICATION (LISTENER_ID, SERIALIZED_EVENT); +CREATE INDEX IF NOT EXISTS EVENT_PUBLICATION_BY_COMPLETION_DATE_IDX ON EVENT_PUBLICATION (COMPLETION_DATE); diff --git a/spring-modulith-events/spring-modulith-events-jdbc/src/main/resources/schema-mysql.sql b/spring-modulith-events/spring-modulith-events-jdbc/src/main/resources/schema-mysql.sql index 92b17260..370dec71 100644 --- a/spring-modulith-events/spring-modulith-events-jdbc/src/main/resources/schema-mysql.sql +++ b/spring-modulith-events/spring-modulith-events-jdbc/src/main/resources/schema-mysql.sql @@ -7,6 +7,5 @@ CREATE TABLE IF NOT EXISTS EVENT_PUBLICATION PUBLICATION_DATE TIMESTAMP(6) NOT NULL, COMPLETION_DATE TIMESTAMP(6) DEFAULT NULL NULL, PRIMARY KEY (ID), - INDEX EVENT_PUBLICATION_LISTENER_ID_IDX (LISTENER_ID), - INDEX EVENT_PUBLICATION_COMPLETION_DATE_IDX (COMPLETION_DATE) + INDEX EVENT_PUBLICATION_BY_COMPLETION_DATE_IDX (COMPLETION_DATE) ); diff --git a/spring-modulith-events/spring-modulith-events-jdbc/src/main/resources/schema-postgresql.sql b/spring-modulith-events/spring-modulith-events-jdbc/src/main/resources/schema-postgresql.sql index 5e23373e..a8efb64b 100644 --- a/spring-modulith-events/spring-modulith-events-jdbc/src/main/resources/schema-postgresql.sql +++ b/spring-modulith-events/spring-modulith-events-jdbc/src/main/resources/schema-postgresql.sql @@ -8,5 +8,5 @@ CREATE TABLE IF NOT EXISTS event_publication completion_date TIMESTAMP WITH TIME ZONE, PRIMARY KEY (id) ); -CREATE INDEX IF NOT EXISTS event_publication_listener_id_serialized_event_idx ON event_publication (listener_id, serialized_event); -CREATE INDEX IF NOT EXISTS event_publication_completion_date_idx ON event_publication (completion_date); +CREATE INDEX IF NOT EXISTS event_publication_by_listener_id_and_serialized_event_idx ON event_publication (listener_id, serialized_event); +CREATE INDEX IF NOT EXISTS event_publication_by_completion_date_idx ON event_publication (completion_date); diff --git a/spring-modulith-events/spring-modulith-events-jdbc/src/test/resources/application.properties b/spring-modulith-events/spring-modulith-events-jdbc/src/test/resources/application.properties new file mode 100644 index 00000000..b92adaf4 --- /dev/null +++ b/spring-modulith-events/spring-modulith-events-jdbc/src/test/resources/application.properties @@ -0,0 +1 @@ +spring.main.banner-mode=OFF