Skip to content

Commit 4e21f9e

Browse files
committed
[IMP] util.alter_column_type
Before ALTERing the column, we needs to drop the depending views. Part-of: #226 Signed-off-by: Christophe Simonis (chs) <[email protected]>
1 parent b7b3679 commit 4e21f9e

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/util/pg.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -622,6 +622,9 @@ def alter_column_type(cr, table, column, type, using=None, where=None, logger=_l
622622
""",
623623
[model_of_table(cr, table), column],
624624
)
625+
626+
drop_depending_views(cr, table, column)
627+
625628
if not using:
626629
# if there is a high number of NULL entries, it will be faster to just ignore those
627630
cr.execute(format_query(cr, "ANALYZE {}({})", table, column))

0 commit comments

Comments
 (0)