Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@ Until `1.0.0`, breaking changes may appear in any release and are flagged with *
default `databasechangelog` / `databasechangeloglock`. Override the new defaults
via configuration to keep the shared-table layout (see Added below).
([#37](https://github.com/softwaremill/okapi/issues/37))
- **okapi's Liquibase migrations consolidated into a single
`001__create_okapi_outbox_table.sql` per database.** New installations create the
full schema (table + indexes) from one changeset instead of replaying the change
history; the resulting schema is unchanged. Existing installations from an earlier
release: the `outbox:001` changeset checksum changed — they must start on a fresh
okapi schema, or clear okapi's rows from `okapi_databasechangelog`, before upgrading.

### Added

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,7 @@ CREATE TABLE IF NOT EXISTS okapi_outbox
last_error TEXT,
delivery_metadata JSON NOT NULL
);

CREATE INDEX idx_okapi_outbox_status_last_attempt ON okapi_outbox (status, last_attempt);

CREATE INDEX idx_okapi_outbox_status_created_at ON okapi_outbox (status, created_at);

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,5 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog
http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-latest.xsd">
<include file="001__create_outbox_table.sql" relativeToChangelogFile="true"/>
<include file="002__add_purger_index.sql" relativeToChangelogFile="true"/>
<include file="003__add_claim_index.sql" relativeToChangelogFile="true"/>
<include file="001__create_okapi_outbox_table.sql" relativeToChangelogFile="true"/>
</databaseChangeLog>
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ CREATE TABLE IF NOT EXISTS okapi_outbox
id UUID NOT NULL PRIMARY KEY,
message_type VARCHAR(255) NOT NULL,
payload TEXT NOT NULL,
delivery_type VARCHAR(50) NOT NULL,
status VARCHAR(50) NOT NULL DEFAULT 'PENDING',
created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
Expand All @@ -14,3 +15,7 @@ CREATE TABLE IF NOT EXISTS okapi_outbox
last_error TEXT,
delivery_metadata JSONB NOT NULL
);

CREATE INDEX IF NOT EXISTS idx_okapi_outbox_status_last_attempt ON okapi_outbox (status, last_attempt);

CREATE INDEX IF NOT EXISTS idx_okapi_outbox_status_created_at ON okapi_outbox (status, created_at);

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,5 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog
http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-latest.xsd">
<include file="001__create_outbox_table.sql" relativeToChangelogFile="true"/>
<include file="002__add_delivery_type_column.sql" relativeToChangelogFile="true"/>
<include file="003__add_purger_index.sql" relativeToChangelogFile="true"/>
<include file="004__add_claim_index.sql" relativeToChangelogFile="true"/>
<include file="001__create_okapi_outbox_table.sql" relativeToChangelogFile="true"/>
</databaseChangeLog>