Skip to content

Commit

Permalink
Merge pull request #82 from JohT/fix/issue-81
Browse files Browse the repository at this point in the history
Drop unnecessary sequence table in database schema (issue #81)
  • Loading branch information
JohT authored May 28, 2022
2 parents 5c6c8dc + c7b036a commit b43b017
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ CREATE TABLE "axon_on_microprofile_tryout"."snapshotevententry" (
PRIMARY KEY (AGGREGATEIDENTIFIER, SEQUENCENUMBER),
UNIQUE (EVENTIDENTIFIER)
);
-- The following sequence table will be dropped in schema version v3.0.0.
-- It was generated by JPA back then and hadn't been used since switching to JDBC.
-- It might be relevant for those who want to use AxonFramework with JPA ( + orm.xml here for the customized table name).
CREATE TABLE "axon_on_microprofile_tryout"."eventsourcing_sequence" (SEQ_NAME VARCHAR(50) NOT NULL, SEQ_COUNT NUMERIC(38), PRIMARY KEY (SEQ_NAME));

CREATE TABLE "axon_on_microprofile_tryout"."sagaentry" (
Expand All @@ -51,5 +54,8 @@ CREATE TABLE "axon_on_microprofile_tryout"."associationvalueentry" (
CREATE INDEX ASSOCIATIONVALUEENTRY_INDEX_ASSOCIATION ON "axon_on_microprofile_tryout"."associationvalueentry" (sagaType, associationKey, associationValue);
CREATE INDEX ASSOCIATIONVALUEENTRY_INDEX_SAGA ON "axon_on_microprofile_tryout"."associationvalueentry" (sagaId, sagaType);

-- These inserts will be deleted with the drop of the sequence table in schema version v3.0.0.
-- They were generated by JPA back then and hadn't been used since switching to JDBC.
-- It might be relevant for those who want to use AxonFramework with JPA ( + orm.xml here for the customized table name).
INSERT INTO "axon_on_microprofile_tryout"."eventsourcing_sequence"(SEQ_NAME, SEQ_COUNT) values ('ASSOCIATIONVALUEENTRY_ID', 0);
INSERT INTO "axon_on_microprofile_tryout"."eventsourcing_sequence"(SEQ_NAME, SEQ_COUNT) values ('DOMAINEVENTENTRY_GLOBAL_INDEX', 0);
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
DROP TABLE "axon_on_microprofile_tryout"."eventsourcing_sequence";

0 comments on commit b43b017

Please sign in to comment.