Published events are transactionally captured in an outbox-table
[demos/spring/data-jdbc] / src / main / resources / db / migration / postgres / V2__Table_outbox.sql
diff --git a/src/main/resources/db/migration/postgres/V2__Table_outbox.sql b/src/main/resources/db/migration/postgres/V2__Table_outbox.sql
new file mode 100644 (file)
index 0000000..0b7fbfe
--- /dev/null
@@ -0,0 +1,3 @@
+CREATE SEQUENCE outbox_id_seq;
+CREATE TABLE outbox(id BIGINT PRIMARY KEY NOT NULL DEFAULT NEXTVAL('outbox_id_seq'), key VARCHAR(127), value varchar(1023), issued timestamp);
+ALTER SEQUENCE outbox_id_seq OWNED BY outbox.id;