Skip to content

Commit

Permalink
Merge pull request #392 from dixmit/copy_columns
Browse files Browse the repository at this point in the history
[IMP] copy_columns: Only copy not null values
  • Loading branch information
pedrobaeza authored Dec 4, 2024
2 parents 8d04b10 + 9bd3c9b commit 29d201f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion openupgradelib/openupgrade.py
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,8 @@ def copy_columns(cr, column_spec):
"""
ALTER TABLE %(table_name)s
ADD COLUMN %(new)s %(field_type)s;
UPDATE %(table_name)s SET %(new)s=%(old)s;
UPDATE %(table_name)s SET %(new)s=%(old)s
WHERE %(old)s IS NOT NULL;
"""
% {
"table_name": table_name,
Expand Down

0 comments on commit 29d201f

Please sign in to comment.