misc/migration/2.42.1_Any.py
changeset 0 b97547f5f1fa
child 1398 5fe84a5f7035
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/misc/migration/2.42.1_Any.py	Wed Nov 05 15:52:50 2008 +0100
@@ -0,0 +1,18 @@
+if confirm('remove deprecated database constraints?'):
+    execute = session.system_sql
+    session.set_pool()
+    dbhelper = session.pool.source('system').dbhelper
+    cu = session.pool['system']
+    for table in dbhelper.list_tables(cu):
+        if table.endswith('_relation'):
+            try:
+                execute('ALTER TABLE %s DROP CONSTRAINT %s_fkey1' % (table, table))
+                execute('ALTER TABLE %s DROP CONSTRAINT %s_fkey2' % (table, table))
+            except:
+                continue
+    checkpoint()
+
+if 'inline_view' in schema:
+    # inline_view attribute should have been deleted for a while now....
+    drop_attribute('ENFRDef', 'inline_view')
+