Skip to content

Commit c9b1fca

Browse files
committed
[ADD] util/specific.py: add helper to rename module
Whenever we changes the custom module name every time we have to add migration report statically for reducing line of code [reference](7786de7). closes #44 Signed-off-by: Alvaro Fuentes Suarez (afu) <[email protected]>
1 parent aa7131e commit c9b1fca

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/util/specific.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
from .helpers import _validate_table
55
from .misc import _cached
6+
from .modules import rename_module
67
from .pg import column_exists, rename_table
78
from .report import add_to_migration_reports
89

@@ -42,6 +43,17 @@ def dispatch_by_dbuuid(cr, version, callbacks):
4243
func(cr, version)
4344

4445

46+
def rename_custom_module(cr, old_module_name, new_module_name, report_details=""):
47+
rename_module(cr, old_module_name, new_module_name)
48+
49+
add_to_migration_reports(
50+
category="Custom modules",
51+
message="The custom module '{old_module_name}' was renamed to '{new_module_name}'. {report_details}".format(
52+
**locals()
53+
),
54+
)
55+
56+
4557
def rename_custom_table(
4658
cr,
4759
table_name,

0 commit comments

Comments
 (0)