pgmq-migration: PGMQ schema migrations without PostgreSQL extension

[ database, library, mit ] [ Propose Tags ] [ Report a vulnerability ]

Installs the PGMQ schema into PostgreSQL without requiring the pgmq extension. Exposes a native pg-migrate component and verified predecessor-history imports.


[Skip to Readme]

Modules

[Last Documentation]

  • Pgmq
    • Pgmq.Migration
      • History
        • Pgmq.Migration.History.HasqlMigration
      • Pgmq.Migration.SchemaContract

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

  • No Candidates
Versions [RSS] 0.1.0.0, 0.1.1.0, 0.1.2.0, 0.1.3.0, 0.2.0.0, 0.3.0.0, 0.4.0.0, 0.4.0.1
Change log CHANGELOG.md
Dependencies aeson (>=2.2 && <2.3), base (>=4.18 && <5), bytestring (>=0.12 && <0.13), containers (>=0.7 && <0.8), file-embed (>=0.0.16 && <0.1), hasql (>=1.10 && <1.11), hasql-transaction (>=1.2 && <1.3), pg-migrate (>=1.1.0.0 && <1.2), pg-migrate-embed (>=1.1.0.0 && <1.2), pg-migrate-import-hasql-migration (>=1.1.0.0 && <1.2), text (>=2.1 && <2.2) [details]
License MIT
Author Nadeem Bitar
Maintainer Nadeem Bitar
Uploaded by shinzui at 2026-07-14T19:01:32Z
Category Database
Home page https://github.com/shinzui/pgmq-hs
Distributions
Downloads 69 total (17 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs not available [build log]
All reported builds failed as of 2026-07-14 [all 2 reports]

Readme for pgmq-migration-0.4.0.1

[back to package description]

pgmq-migration

pgmq-migration exposes the PGMQ schema as a native pg-migrate component. Applications compose pgmqMigrations into their migration plan; the package intentionally ships no standalone runner.

Fresh databases run the two native migrations normally. Databases installed by pgmq-migration 0.3 or earlier must import their public.schema_migrations predecessor history before the first native up, so the PGMQ baseline is recorded rather than replayed.

The existing pgmqHasqlMigrationSourceConfig helper requires an exclusive predecessor ledger. When an application deliberately shares that table with its own migrations, use the explicit policy-aware constructor:

pgmqHasqlMigrationSourceConfigWithPolicy
  provider
  DirectFullInstallHistory
  AllowUnselectedSourceRows

Call readHasqlMigrationHistory with that configuration first and review unselectedRows. The policy accepts but never claims or modifies those rows. It does not relax selected PGMQ evidence: the baseline must still reproduce its exact stored base64 MD5, and the equivalent two-step history still requires its state validator plus explicit equivalent-history opt-in.

The repository guide at docs/user/schema-migration.md contains complete fresh-install, history-import, validation, and recovery examples.