[GRASS-SVN] r72592 - grass/branches/releasebranch_7_4/scripts/v.db.dropcolumn
svn_grass at osgeo.org
svn_grass at osgeo.org
Thu Apr 5 08:05:12 PDT 2018
Author: mmetz
Date: 2018-04-05 08:05:12 -0700 (Thu, 05 Apr 2018)
New Revision: 72592
Modified:
grass/branches/releasebranch_7_4/scripts/v.db.dropcolumn/v.db.dropcolumn.py
Log:
v.db.dropcolumn: preserve field length for field type CHARACTER (backport trunk r72591)
Modified: grass/branches/releasebranch_7_4/scripts/v.db.dropcolumn/v.db.dropcolumn.py
===================================================================
--- grass/branches/releasebranch_7_4/scripts/v.db.dropcolumn/v.db.dropcolumn.py 2018-04-05 14:59:27 UTC (rev 72591)
+++ grass/branches/releasebranch_7_4/scripts/v.db.dropcolumn/v.db.dropcolumn.py 2018-04-05 15:05:12 UTC (rev 72592)
@@ -89,7 +89,12 @@
if f[0] == column:
continue
colnames.append(f[0])
- coltypes.append("%s %s" % (f[0], f[1]))
+ # see db_sqltype_name() for type names
+ if f[1] == "CHARACTER":
+ # preserve field length for sql type "CHARACTER"
+ coltypes.append("%s %s(%s)" % (f[0], f[1], f[2]))
+ else:
+ coltypes.append("%s %s" % (f[0], f[1]))
colnames = ", ".join(colnames)
coltypes = ", ".join(coltypes)
More information about the grass-commit
mailing list