author | sylvain.thenault@logilab.fr |
Tue, 28 Apr 2009 10:11:08 +0200 | |
branch | tls-sprint |
changeset 1493 | 8270580b65a0 |
parent 1398 | 5fe84a5f7035 |
child 1802 | d628defebc17 |
permissions | -rw-r--r-- |
0 | 1 |
if confirm('remove deprecated database constraints?'): |
2 |
execute = session.system_sql |
|
3 |
session.set_pool() |
|
4 |
dbhelper = session.pool.source('system').dbhelper |
|
5 |
cu = session.pool['system'] |
|
6 |
for table in dbhelper.list_tables(cu): |
|
7 |
if table.endswith('_relation'): |
|
8 |
try: |
|
9 |
execute('ALTER TABLE %s DROP CONSTRAINT %s_fkey1' % (table, table)) |
|
10 |
execute('ALTER TABLE %s DROP CONSTRAINT %s_fkey2' % (table, table)) |
|
11 |
except: |
|
12 |
continue |
|
13 |
checkpoint() |
|
14 |
||
15 |
if 'inline_view' in schema: |
|
16 |
# inline_view attribute should have been deleted for a while now.... |
|
1398
5fe84a5f7035
rename internal entity types to have CW prefix instead of E
sylvain.thenault@logilab.fr
parents:
0
diff
changeset
|
17 |
drop_attribute('CWRelation', 'inline_view') |
0 | 18 |