Skip to content

Commit 5a6ff7e

Browse files
committed
[IMP] alter_column_type
Validate parameters usage. Part-of: #226 Signed-off-by: Christophe Simonis (chs) <[email protected]>
1 parent 4e21f9e commit 5a6ff7e

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/util/pg.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -610,6 +610,8 @@ def remove_column(cr, table, column, cascade=False):
610610

611611

612612
def alter_column_type(cr, table, column, type, using=None, where=None, logger=_logger):
613+
if where and not using:
614+
raise ValueError("`where` parameter is only relevant with a non-default `using` parameter")
613615
# remove the existing linked `ir_model_fields_selection` recods in case it was a selection field
614616
if table_exists(cr, "ir_model_fields_selection"):
615617
cr.execute(

0 commit comments

Comments
 (0)