Browse Source

[FIX] drop old constraint, rename id sequence (#630)

pull/325/head
Holger Brunn 8 years ago
committed by Moises Lopez - https://www.vauxoo.com/
parent
commit
136cd32eab
  1. 6
      base_multi_image/hooks.py

6
base_multi_image/hooks.py

@ -57,8 +57,14 @@ def migrate_from_product_images(cr):
return
cr.execute(
'alter table product_images rename to base_multi_image_image')
cr.execute(
'alter sequence product_images_id_seq '
'rename to base_multi_image_image_id_seq')
cr.execute(
'alter table base_multi_image_image rename product_id to owner_id')
cr.execute(
'alter table base_multi_image_image '
'drop constraint product_images_product_id_fkey')
cr.execute(
'alter table base_multi_image_image '
"add column owner_model varchar not null default 'product.template',"

Loading…
Cancel
Save