Skip to content
Permalink
Browse files

Fixing travis test

  • Loading branch information
Ailurupoda committed Feb 7, 2019
1 parent 63c010d commit 277d4fefae2e472e0f1870baeb5b9cc68208fe54
@@ -232,4 +232,5 @@ def getSqlDictionary(self):
return []

def getQueryBuilderDictionary(self):
return {}

return {}
@@ -475,16 +475,16 @@ def updateCache(self, tableList, schema=None):

def singleGeomTypes(self, geomtypes, srids):
"""Intelligent wkbtype grouping (multi with non multi)"""
if (QgsWkbTypes.Polygon in geomtypes
and QgsWkbTypes.MultiPolygon in geomtypes):
if (QgsWkbTypes.Polygon in geomtypes
and QgsWkbTypes.MultiPolygon in geomtypes):
srids.pop(geomtypes.index(QgsWkbTypes.Polygon))
geomtypes.pop(geomtypes.index(QgsWkbTypes.Polygon))
if (QgsWkbTypes.Point in geomtypes
and QgsWkbTypes.MultiPoint in geomtypes):
if (QgsWkbTypes.Point in geomtypes
and QgsWkbTypes.MultiPoint in geomtypes):
srids.pop(geomtypes.index(QgsWkbTypes.Point))
geomtypes.pop(geomtypes.index(QgsWkbTypes.Point))
if (QgsWkbTypes.LineString in geomtypes
and QgsWkbTypes.MultiLineString in geomtypes):
if (QgsWkbTypes.LineString in geomtypes
and QgsWkbTypes.MultiLineString in geomtypes):
srids.pop(geomtypes.index(QgsWkbTypes.LineString))
geomtypes.pop(geomtypes.index(QgsWkbTypes.LineString))
if QgsWkbTypes.Unknown in geomtypes and len(geomtypes) > 1:
@@ -1306,7 +1306,7 @@ def renameSchema(self, schema, new_schema):
"""Rename a schema in the database."""
# Unsupported in Oracle
pass

def commentTable(self, schema, tablename, comment):
"""Comment the table"""
return ''
@@ -408,18 +408,18 @@ def getValidQgisUniqueFields(self, onlyOne=False):
for idx in indexes:
if idx.isUnique and len(idx.columns) == 1:
fld = idx.fields()[idx.columns[0]]
if (fld.dataType == u"NUMBER" and
not fld.modifier and
fld.notNull and
fld not in ret):
if (fld.dataType == u"NUMBER"
and not fld.modifier
and fld.notNull
and fld not in ret):
ret.append(fld)

# and finally append the other suitable fields
for fld in self.fields():
if (fld.dataType == u"NUMBER" and
not fld.modifier and
fld.notNull and
fld not in ret):
if (fld.dataType == u"NUMBER"
and not fld.modifier
and fld.notNull
and fld not in ret):
ret.append(fld)

if onlyOne:
@@ -519,15 +519,15 @@ def __init__(self, row, table):

# find out whether fields are part of primary key
for con in self.table().constraints():
if (con.type == ORTableConstraint.TypePrimaryKey and
self.name == con.column):
if (con.type == ORTableConstraint.TypePrimaryKey
and self.name == con.column):
self.primaryKey = True
break

def type2String(self):
if (u"TIMESTAMP" in self.dataType or
self.dataType in [u"DATE", u"SDO_GEOMETRY",
u"BINARY_FLOAT", u"BINARY_DOUBLE"]):
if (u"TIMESTAMP" in self.dataType
or self.dataType in [u"DATE", u"SDO_GEOMETRY",
u"BINARY_FLOAT", u"BINARY_DOUBLE"]):
return u"{}".format(self.dataType)
if self.charMaxLen in [None, -1]:
return u"{}".format(self.dataType)
@@ -193,7 +193,6 @@ def getInfo(self):
self._close_cursor(c)
return res


def getSpatialInfo(self):
""" returns tuple about PostGIS support:
- lib version
@@ -399,7 +399,7 @@ def __init__(self, row, table):
if con.type == TableConstraint.TypePrimaryKey and self.num in con.columns:
self.primaryKey = True
break

def getComment(self):
"""Returns the comment for a field"""
tab = self.table()
@@ -419,7 +419,6 @@ def getComment(self):
return ''



class PGTableConstraint(TableConstraint):

def __init__(self, row, table):
@@ -591,13 +591,13 @@ def addTableColumn(self, table, field_def):
self._execute_and_commit(sql)
self._execute(None, sql)

sql = u"SELECT InvalidateLayerStatistics(%s)" % (self.quoteId(table))
self._execute(None, sql)
# sql = u"SELECT InvalidateLayerStatistics(%s)" % (self.quoteId(table))
# self._execute(None, sql)

sql = u"SELECT UpdateLayerStatistics(%s)" % (self.quoteId(table))
self._execute(None, sql)
# sql = u"SELECT UpdateLayerStatistics(%s)" % (self.quoteId(table))
# self._execute(None, sql)

self._commit()
# self._commit()
return True

def deleteTableColumn(self, table, column):
@@ -42,7 +42,6 @@ def __init__(self, parent=None, fld=None, table=None, db=None):
for item in self.db.connector.fieldTypes():
self.cboType.addItem(item)


supportCom = self.db.supportsComment()
if supportCom != True:
self.label_6.setVisible(False)

0 comments on commit 277d4fe

Please sign in to comment.
You can’t perform that action at this time.