pum 1.3.0__py3-none-any.whl → 1.3.1__py3-none-any.whl
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/schema_migrations.py +19 -23
- {pum-1.3.0.dist-info → pum-1.3.1.dist-info}/METADATA +1 -1
- {pum-1.3.0.dist-info → pum-1.3.1.dist-info}/RECORD +7 -7
- {pum-1.3.0.dist-info → pum-1.3.1.dist-info}/WHEEL +0 -0
- {pum-1.3.0.dist-info → pum-1.3.1.dist-info}/entry_points.txt +0 -0
- {pum-1.3.0.dist-info → pum-1.3.1.dist-info}/licenses/LICENSE +0 -0
- {pum-1.3.0.dist-info → pum-1.3.1.dist-info}/top_level.txt +0 -0
pum/schema_migrations.py
CHANGED
|
@@ -74,10 +74,9 @@ class SchemaMigrations:
|
|
|
74
74
|
"schema": psycopg.sql.Literal(self.config.config.pum.migration_table_schema),
|
|
75
75
|
}
|
|
76
76
|
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
return result[0] if result else False
|
|
77
|
+
cursor = SqlContent(query).execute(connection, parameters=parameters)
|
|
78
|
+
result = cursor._pum_results[0] if cursor._pum_results else None
|
|
79
|
+
return result[0] if result else False
|
|
81
80
|
|
|
82
81
|
def exists_in_other_schemas(self, connection: psycopg.Connection) -> list[str]:
|
|
83
82
|
"""Check if the schema_migrations information table exists in other schemas.
|
|
@@ -100,9 +99,8 @@ class SchemaMigrations:
|
|
|
100
99
|
parameters = {
|
|
101
100
|
"schema": psycopg.sql.Literal(self.config.config.pum.migration_table_schema),
|
|
102
101
|
}
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
return [row[0] for row in (cursor._pum_results or [])]
|
|
102
|
+
cursor = SqlContent(query).execute(connection, parameters=parameters)
|
|
103
|
+
return [row[0] for row in (cursor._pum_results or [])]
|
|
106
104
|
|
|
107
105
|
def create(
|
|
108
106
|
self,
|
|
@@ -346,14 +344,13 @@ INSERT INTO {table} (
|
|
|
346
344
|
"table": self.migration_table_identifier,
|
|
347
345
|
}
|
|
348
346
|
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
return packaging.version.parse(row[0])
|
|
347
|
+
cursor = SqlContent(query).execute(connection, parameters=parameters)
|
|
348
|
+
row = cursor._pum_results[0] if cursor._pum_results else None
|
|
349
|
+
if row is None:
|
|
350
|
+
raise PumSchemaMigrationNoBaselineError(
|
|
351
|
+
f"Baseline version not found in the {self.migration_table_identifier_str} table."
|
|
352
|
+
)
|
|
353
|
+
return packaging.version.parse(row[0])
|
|
357
354
|
|
|
358
355
|
def migration_details(self, connection: psycopg.Connection, version: str | None = None) -> dict:
|
|
359
356
|
"""Return the migration details from the migration table.
|
|
@@ -404,14 +401,13 @@ INSERT INTO {table} (
|
|
|
404
401
|
"version": psycopg.sql.Literal(version),
|
|
405
402
|
}
|
|
406
403
|
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
return dict(zip([desc[0] for desc in cursor._pum_description], row, strict=False))
|
|
404
|
+
cursor = SqlContent(query).execute(connection, parameters=parameters)
|
|
405
|
+
row = cursor._pum_results[0] if cursor._pum_results else None
|
|
406
|
+
if row is None:
|
|
407
|
+
raise PumSchemaMigrationError(
|
|
408
|
+
f"Migration details not found for version {version} in the {self.migration_table_identifier_str} table."
|
|
409
|
+
)
|
|
410
|
+
return dict(zip([desc[0] for desc in cursor._pum_description], row, strict=False))
|
|
415
411
|
|
|
416
412
|
def compare(self, connection: psycopg.Connection) -> int:
|
|
417
413
|
"""Compare the migrations details in the database to the changelogs in the source.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: pum
|
|
3
|
-
Version: 1.3.
|
|
3
|
+
Version: 1.3.1
|
|
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
|
|
@@ -14,12 +14,12 @@ pum/parameter.py,sha256=e7Lm5fp2Xg4SEkIDmbxSyNTsYvELCkeyPUeS6CCs6EA,2646
|
|
|
14
14
|
pum/pum_config.py,sha256=k-YF2nL73HcfybjV09G042Xuiu8nRWSxAI43JyiCTsg,14952
|
|
15
15
|
pum/report_generator.py,sha256=upv6gpVZ_kk7O6IhcO7LWMlPHg_u_V0wx_LxQebMp-c,38908
|
|
16
16
|
pum/role_manager.py,sha256=_LG5LR8osc5bVQVb-AKGU3wvXBrIe9J3IV1ECzhiwnA,15991
|
|
17
|
-
pum/schema_migrations.py,sha256
|
|
17
|
+
pum/schema_migrations.py,sha256=-yR84KkG1mLY5yeEWzidNPam1hrE_1mMC5KJaHOUxiA,16304
|
|
18
18
|
pum/sql_content.py,sha256=BY5XMS713sIOUT4xLHByOzQhxYItucvkCFEyzmwSTR4,12969
|
|
19
19
|
pum/upgrader.py,sha256=skGfwfuAb0TLMqCPjRbcJNf1VKmekaaQLm_C-abs61E,18353
|
|
20
|
-
pum-1.3.
|
|
21
|
-
pum-1.3.
|
|
22
|
-
pum-1.3.
|
|
23
|
-
pum-1.3.
|
|
24
|
-
pum-1.3.
|
|
25
|
-
pum-1.3.
|
|
20
|
+
pum-1.3.1.dist-info/licenses/LICENSE,sha256=2ylvL381vKOhdO-w6zkrOxe9lLNBhRQpo9_0EbHC_HM,18046
|
|
21
|
+
pum-1.3.1.dist-info/METADATA,sha256=xcbQ-mlS84gzT_6xj2tzxj4JeA2LPf6PowfHY83CfYA,3236
|
|
22
|
+
pum-1.3.1.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
|
|
23
|
+
pum-1.3.1.dist-info/entry_points.txt,sha256=U6dmxSpKs1Pe9vWiR29VPhJMDjrmZeJCSxvfLGR8BD4,36
|
|
24
|
+
pum-1.3.1.dist-info/top_level.txt,sha256=ddiI4HLBhY6ql-NNm0Ez0JhoOHdWDIzrHeCdHmmagcc,4
|
|
25
|
+
pum-1.3.1.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|