Change constraint on stock_production_lot
authorced <>
Wed, 12 Sep 2007 13:21:07 +0000 (13:21 +0000)
committerced <>
Wed, 12 Sep 2007 13:21:07 +0000 (13:21 +0000)
- used name, ref
- improve check in the wizard
- add migration script
- add sequence

bzr revid: ced-43b6788fd2f2525e153d7b5bdfaee28b8889e230

doc/migrate/4.0.0-4.2.0/pre.py

index dc4c160..f11188f 100644 (file)
@@ -183,4 +183,14 @@ if cr.fetchall():
        cr.execute('ALTER TABLE product_uom SET factor NOT NULL')
        cr.execute('ALTER TABLE product_uom DROP COLUMN temp_column')
 
+
+# ------------------------------------------------- #
+# Drop name_uniq constraint on stock_production_lot #
+# ------------------------------------------------- #
+
+cr.execute('SELECT conname FROM pg_constraint where conname = \'stock_production_lot_name_uniq\'')
+if cr.fetchall():
+       cr.execute('ALTER TABLE stock_production_lot DROP CONSTRAINT \'stock_production_lot_name_uniq\'')
+cr.commit()
+
 cr.close