diff --git a/src/main/resources/templates/db_scripts/schema.json b/src/main/resources/templates/db_scripts/schema.json index a7c9dd9d..8b90e8ea 100644 --- a/src/main/resources/templates/db_scripts/schema.json +++ b/src/main/resources/templates/db_scripts/schema.json @@ -84,6 +84,16 @@ "run": "after", "snippetPath": "invoices_table.sql", "fromModuleVersion": "mod-invoice-storage-5.9.0" + }, + { + "run": "after", + "snippetPath": "tables/create_audit_outbox_table.sql", + "fromModuleVersion": "mod-invoice-storage-5.9.0" + }, + { + "run": "after", + "snippetPath": "tables/create_internal_lock_table.sql", + "fromModuleVersion": "mod-invoice-storage-5.9.0" } ], "tables": [ diff --git a/src/main/resources/templates/db_scripts/tables/create_audit_outbox_table.sql b/src/main/resources/templates/db_scripts/tables/create_audit_outbox_table.sql new file mode 100644 index 00000000..ff31c93e --- /dev/null +++ b/src/main/resources/templates/db_scripts/tables/create_audit_outbox_table.sql @@ -0,0 +1,6 @@ +CREATE TABLE IF NOT EXISTS outbox_event_log ( + event_id uuid NOT NULL PRIMARY KEY, + entity_type text NOT NULL, + action text NOT NULL, + payload jsonb +); diff --git a/src/main/resources/templates/db_scripts/tables/create_internal_lock_table.sql b/src/main/resources/templates/db_scripts/tables/create_internal_lock_table.sql new file mode 100644 index 00000000..a441d415 --- /dev/null +++ b/src/main/resources/templates/db_scripts/tables/create_internal_lock_table.sql @@ -0,0 +1,5 @@ +CREATE TABLE IF NOT EXISTS internal_lock ( + lock_name text NOT NULL PRIMARY KEY +); + +INSERT INTO internal_lock(lock_name) VALUES ('audit_outbox') ON CONFLICT DO NOTHING;