AuroraMeter. Config. PrefixError exception
(Aurora Meter v1.0.0)
View Source
Raised when a host asks Aurora Meter to live in a Postgres schema other than the repository's default one.
V1 supports the default schema and nothing else. That is not a preference: every query this package issues omits the prefix, so a prefix that reached the migrations and not the queries would put the tables in one schema and read from another, and the first symptom would be an empty ledger rather than an error.
There are three ways a host can ask for it and all three raise this, so the refusal happens before any table is created rather than after the first query comes back empty:
- the repository sets
migration_default_prefix(raised at boot byAuroraMeter.Config.validate!/0); - the repository's
default_options/1returns a:prefix(same); - a migration runs under
mix ecto.migrate --prefix(raised byAuroraMeter.Migration.up/1anddown/1before any version runs).
A fourth, AuroraMeter.Migration.up(prefix: ...), raises ArgumentError,
because an unknown option is an unknown option whatever it is called.
:source says which of the three it was, so a host rescuing this needs one
clause and can still tell the cases apart.