pum 1.2.1__tar.gz → 1.2.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {pum-1.2.1 → pum-1.2.2}/PKG-INFO +1 -1
- {pum-1.2.1 → pum-1.2.2}/pum/pum_config.py +1 -1
- {pum-1.2.1 → pum-1.2.2}/pum/upgrader.py +7 -0
- {pum-1.2.1 → pum-1.2.2}/pum.egg-info/PKG-INFO +1 -1
- {pum-1.2.1 → pum-1.2.2}/LICENSE +0 -0
- {pum-1.2.1 → pum-1.2.2}/README.md +0 -0
- {pum-1.2.1 → pum-1.2.2}/pum/__init__.py +0 -0
- {pum-1.2.1 → pum-1.2.2}/pum/changelog.py +0 -0
- {pum-1.2.1 → pum-1.2.2}/pum/checker.py +0 -0
- {pum-1.2.1 → pum-1.2.2}/pum/cli.py +0 -0
- {pum-1.2.1 → pum-1.2.2}/pum/config_model.py +0 -0
- {pum-1.2.1 → pum-1.2.2}/pum/dependency_handler.py +0 -0
- {pum-1.2.1 → pum-1.2.2}/pum/dumper.py +0 -0
- {pum-1.2.1 → pum-1.2.2}/pum/exceptions.py +0 -0
- {pum-1.2.1 → pum-1.2.2}/pum/hook.py +0 -0
- {pum-1.2.1 → pum-1.2.2}/pum/info.py +0 -0
- {pum-1.2.1 → pum-1.2.2}/pum/parameter.py +0 -0
- {pum-1.2.1 → pum-1.2.2}/pum/role_manager.py +0 -0
- {pum-1.2.1 → pum-1.2.2}/pum/schema_migrations.py +0 -0
- {pum-1.2.1 → pum-1.2.2}/pum/sql_content.py +0 -0
- {pum-1.2.1 → pum-1.2.2}/pum.egg-info/SOURCES.txt +0 -0
- {pum-1.2.1 → pum-1.2.2}/pum.egg-info/dependency_links.txt +0 -0
- {pum-1.2.1 → pum-1.2.2}/pum.egg-info/entry_points.txt +0 -0
- {pum-1.2.1 → pum-1.2.2}/pum.egg-info/requires.txt +0 -0
- {pum-1.2.1 → pum-1.2.2}/pum.egg-info/top_level.txt +0 -0
- {pum-1.2.1 → pum-1.2.2}/pyproject.toml +0 -0
- {pum-1.2.1 → pum-1.2.2}/requirements/base.txt +0 -0
- {pum-1.2.1 → pum-1.2.2}/requirements/development.txt +0 -0
- {pum-1.2.1 → pum-1.2.2}/setup.cfg +0 -0
- {pum-1.2.1 → pum-1.2.2}/test/test_changelog.py +0 -0
- {pum-1.2.1 → pum-1.2.2}/test/test_config.py +0 -0
- {pum-1.2.1 → pum-1.2.2}/test/test_dumper.py +0 -0
- {pum-1.2.1 → pum-1.2.2}/test/test_roles.py +0 -0
- {pum-1.2.1 → pum-1.2.2}/test/test_schema_migrations.py +0 -0
- {pum-1.2.1 → pum-1.2.2}/test/test_upgrader.py +0 -0
{pum-1.2.1 → pum-1.2.2}/PKG-INFO
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: pum
|
|
3
|
-
Version: 1.2.
|
|
3
|
+
Version: 1.2.2
|
|
4
4
|
Summary: Pum stands for "Postgres Upgrades Manager". It is a Database migration management tool very similar to flyway-db or Liquibase, based on metadata tables.
|
|
5
5
|
Author-email: Denis Rouzaud <denis@opengis.ch>
|
|
6
6
|
License-Expression: GPL-2.0-or-later
|
|
@@ -231,7 +231,7 @@ class PumConfig:
|
|
|
231
231
|
"""Return a RoleManager instance based on the roles defined in the configuration."""
|
|
232
232
|
if not self.config.roles:
|
|
233
233
|
logger.warning("No roles defined in the configuration. Returning an empty RoleManager.")
|
|
234
|
-
return RoleManager()
|
|
234
|
+
return RoleManager([])
|
|
235
235
|
return RoleManager([role.model_dump() for role in self.config.roles])
|
|
236
236
|
|
|
237
237
|
def pre_hook_handlers(self) -> list[HookHandler]:
|
|
@@ -133,6 +133,7 @@ class Upgrader:
|
|
|
133
133
|
name: str,
|
|
134
134
|
*,
|
|
135
135
|
parameters: dict | None = None,
|
|
136
|
+
grant: bool = True,
|
|
136
137
|
) -> None:
|
|
137
138
|
"""Install demo data for the module.
|
|
138
139
|
|
|
@@ -140,6 +141,7 @@ class Upgrader:
|
|
|
140
141
|
connection: The database connection to use.
|
|
141
142
|
name: The name of the demo data to install.
|
|
142
143
|
parameters: The parameters to pass to the demo data SQL.
|
|
144
|
+
grant: If True, grant permissions to the roles after installing the demo data. Default is True.
|
|
143
145
|
"""
|
|
144
146
|
if name not in self.config.demo_data():
|
|
145
147
|
raise PumException(f"Demo data '{name}' not found in the configuration.")
|
|
@@ -167,4 +169,9 @@ class Upgrader:
|
|
|
167
169
|
|
|
168
170
|
connection.commit()
|
|
169
171
|
|
|
172
|
+
if grant:
|
|
173
|
+
self.config.role_manager().grant_permissions(connection=connection, commit=False)
|
|
174
|
+
|
|
175
|
+
connection.commit()
|
|
176
|
+
|
|
170
177
|
logger.info("Demo data '%s' installed successfully.", name)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: pum
|
|
3
|
-
Version: 1.2.
|
|
3
|
+
Version: 1.2.2
|
|
4
4
|
Summary: Pum stands for "Postgres Upgrades Manager". It is a Database migration management tool very similar to flyway-db or Liquibase, based on metadata tables.
|
|
5
5
|
Author-email: Denis Rouzaud <denis@opengis.ch>
|
|
6
6
|
License-Expression: GPL-2.0-or-later
|
{pum-1.2.1 → pum-1.2.2}/LICENSE
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|