Skip to content

Migrating from 0.17.x to 0.18.x #128

@tvuotila

Description

@tvuotila

There is no documentation on how to migrate from 0.17 to 0.18.
The naive migration is:

  1. Update transaction and activity tables:
ALTER TABLE transaction
DROP COLUMN native_transaction_id,
ADD COLUMN native_transaction_id xid8,
ADD CONSTRAINT uq_transaction_native_transaction_id UNiQUE (native_transaction_id);

ALTER TABLE activity
DROP COLUMN native_transaction_id,
ADD COLUMN native_transaction_id xid8;

CREATE INDEX ix_activity_native_transaction_id ON activity (native_transaction_id);
  1. Re-create create_activity function either for statement or row level triggers.

If you prefer a minimal downtime version:

  1. Create the new columns
ALTER TABLE transaction ADD COLUMN native_transaction_id_new xid8;
ALTER TABLE activity ADD COLUMN native_transaction_id_new xid8;
  1. Index them:
CREATE UNIQUE INDEX CONCURRENTLY uq_transaction_native_transaction_id ON transaction (native_transaction_id_new);
CREATE INDEX CONCURRENTLY ix_activity_native_transaction_id ON activity (native_transaction_id_new);
  1. Replace the columns:
ALTER TABLE transaction DROP COLUMN native_transaction_id;

ALTER TABLE transaction RENAME COLUMN native_transaction_id_new TO native_transaction_id;

ALTER TABLE activity DROP COLUMN native_transaction_id;

ALTER TABLE activity RENAME COLUMN native_transaction_id_new TO native_transaction_id;
  1. Remember to re-create the create_activity function.

A documentation could be created for these.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions