[IMP] models.py: increase logging level for columns that can't be casted automatically when upgrading a module.

This commit is contained in:
Christophe Simonis 2014-12-09 15:39:12 +01:00
parent a8f94a59cd
commit a59cf39f06
1 changed files with 2 additions and 2 deletions

View File

@ -2559,8 +2559,8 @@ class BaseModel(object):
cr.execute('ALTER TABLE "%s" RENAME COLUMN "%s" TO "%s"' % (self._table, k, newname))
cr.execute('ALTER TABLE "%s" ADD COLUMN "%s" %s' % (self._table, k, get_pg_type(f)[1]))
cr.execute("COMMENT ON COLUMN %s.\"%s\" IS %%s" % (self._table, k), (f.string,))
_schema.debug("Table '%s': column '%s' has changed type (DB=%s, def=%s), data moved to column %s !",
self._table, k, f_pg_type, f._type, newname)
_schema.warning("Table `%s`: column `%s` has changed type (DB=%s, def=%s), data moved to column `%s`",
self._table, k, f_pg_type, f._type, newname)
# if the field is required and hasn't got a NOT NULL constraint
if f.required and f_pg_notnull == 0: