opengisch / pum

Postgres Upgrades Manager
GNU General Public License v2.0
30 stars 7 forks source link

Improve workflow for database initialisation #96

Open olivierdalang opened 3 years ago

olivierdalang commented 3 years ago

It's not completely clear how to initialize a datamodel from scratch using pum.

pum baseline pum baseline seems to be the only way to create the pum_info tables, but it also asks for a base version, which doesn't really apply in the case of an empty datamodel (or is it 0.0.0 ?). Also it doesn't create the schema if needed.

pum upgrade IMO, pum upgrade should take care of creating the tables directly if missing.

pum info Also, pum info should deal with the case where the datamodel is not initialized, and return some clear message like "It seems this database is not managed by pum" (exit code != 0). Currently, it fails with an SQL error.