Open corviday opened 6 years ago
The initialization script installs the postGIS extension. It MUST install the postGIS extension; if the extension is already installed, it quits without doing anything else.
This can probably be fixed by changing the create command to
CREATE EXTENSION IF NOT EXISTS ...
See also #68
Only the postgres superuser can install the postGIS extension, so the initialization script must be run with the superuser's credentials
Add to notes somewhere.
The superuser does not - unlike the database-associated accounts like ce_meta, ce_meta_ro, or ce_meta_rw - default to the ce_meta schema in its search path
Therefore, upon running the rest of the creation script, the superuser creates the modelmeta tables in the public schema instead, which is not where we want them
Make superuser (role
postgres
) default to the appropriate schema. E.g., in my dockerized Postgres setup, I have:ALTER ROLE postgres IN DATABASE mm_test SET search_path = mm_test, public;
We can hand update the
ce_meta
andpcic_meta
databases similarly.
Since these are two separate issues. Let's fix the former now, and defer the latter to another issue.
Two issues with alembic that shouldn't apply to the main database, but have affected test databases:
The initial create migration does not run correctly
This problem only exists with the first alembic "migration", the one that has to install postGIS; it won't affect upgrading the live database, but it does mean we cannot format a completely empty database easily.
The discrete sampling geometry upgrade cannot be downgraded if data has already been added.
The following error message results:
There is no
grid_id 0
in this database; thegrid_id
s start at 1. No entries in any other table referencegrid_id 0
, either, I'm not sure why it's trying to access grid_id 0 at all.Since we don't expect to downgrade the live database, this is unlikely to be a problem, but it does come up in testing.