misc/migration/3.14.4_Any.py
author Anthony Truchet <anthony.truchet@logilab.fr>
Thu, 15 Mar 2012 14:26:12 +0100
changeset 8306 4da49700b06a
parent 8205 14c52c5ee706
child 8263 a73ad255ff63
permissions -rw-r--r--
[config, undo] Fix undo-support option migration
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
8205
14c52c5ee706 [entities system table] change asource and source column size (closes #1951819)
Alexandre Richardson <alexandre.richardson@logilab.fr>
parents:
diff changeset
     1
from yams import schema2sql as y2sql
14c52c5ee706 [entities system table] change asource and source column size (closes #1951819)
Alexandre Richardson <alexandre.richardson@logilab.fr>
parents:
diff changeset
     2
14c52c5ee706 [entities system table] change asource and source column size (closes #1951819)
Alexandre Richardson <alexandre.richardson@logilab.fr>
parents:
diff changeset
     3
dbhelper = repo.system_source.dbhelper
14c52c5ee706 [entities system table] change asource and source column size (closes #1951819)
Alexandre Richardson <alexandre.richardson@logilab.fr>
parents:
diff changeset
     4
rdefdef = schema['CWSource'].rdef('name')
14c52c5ee706 [entities system table] change asource and source column size (closes #1951819)
Alexandre Richardson <alexandre.richardson@logilab.fr>
parents:
diff changeset
     5
attrtype = y2sql.type_from_constraints(dbhelper, rdefdef.object, rdefdef.constraints).split()[0]
14c52c5ee706 [entities system table] change asource and source column size (closes #1951819)
Alexandre Richardson <alexandre.richardson@logilab.fr>
parents:
diff changeset
     6
14c52c5ee706 [entities system table] change asource and source column size (closes #1951819)
Alexandre Richardson <alexandre.richardson@logilab.fr>
parents:
diff changeset
     7
sql(dbhelper.sql_change_col_type('entities', 'asource', attrtype, False))
14c52c5ee706 [entities system table] change asource and source column size (closes #1951819)
Alexandre Richardson <alexandre.richardson@logilab.fr>
parents:
diff changeset
     8
sql(dbhelper.sql_change_col_type('entities', 'source', attrtype, False))
14c52c5ee706 [entities system table] change asource and source column size (closes #1951819)
Alexandre Richardson <alexandre.richardson@logilab.fr>
parents:
diff changeset
     9
sql(dbhelper.sql_change_col_type('deleted_entities', 'source', attrtype, False))