[IMP] convert varchar to text in database
bzr revid: nel@silver-20081210140856-easnep218it0bnqu
This commit is contained in:
parent
f500ecff15
commit
02663d9780
|
@ -1530,6 +1530,12 @@ class orm(orm_template):
|
|||
cr.execute("UPDATE \"%s\" SET \"%s\"=temp_change_size::VARCHAR(%d)" % (self._table, k, f.size))
|
||||
cr.execute("ALTER TABLE \"%s\" DROP COLUMN temp_change_size" % (self._table,))
|
||||
cr.commit()
|
||||
if f_pg_type == 'varchar' and f._type == 'text':
|
||||
cr.execute("ALTER TABLE \"%s\" RENAME COLUMN \"%s\" TO temp_change_type" % (self._table, k))
|
||||
cr.execute("ALTER TABLE \"%s\" ADD COLUMN \"%s\" text " % (self._table, k))
|
||||
cr.execute("UPDATE \"%s\" SET \"%s\"=temp_change_type" % (self._table, k))
|
||||
cr.execute("ALTER TABLE \"%s\" DROP COLUMN temp_change_type" % (self._table,))
|
||||
cr.commit()
|
||||
if f_pg_type == 'date' and f._type == 'datetime':
|
||||
cr.execute("ALTER TABLE \"%s\" RENAME COLUMN \"%s\" TO temp_change_type" % (self._table, k))
|
||||
cr.execute("ALTER TABLE \"%s\" ADD COLUMN \"%s\" TIMESTAMP " % (self._table, k))
|
||||
|
|
Loading…
Reference in New Issue