Logo Search packages:      
Sourcecode: ibid version File versions  Download package

def ibid::db::versioned_schema::VersionedSchema::_index_name (   self,
  col 
) [private]

We'd like not to duplicate an existing index so try to abide by the
local customs

Definition at line 121 of file versioned_schema.py.

00121                               :
        """
        We'd like not to duplicate an existing index so try to abide by the
        local customs
        """
        session = self.upgrade_session

        if session.bind.engine.name == 'sqlite':
            return 'ix_%s_%s' % (self.table.name, col.name)
        elif session.bind.engine.name == 'postgres':
            return '%s_%s_key' % (self.table.name, col.name)
        elif session.bind.engine.name == 'mysql':
            return col.name

        log.warning(u"Unknown database type, %s, you may end up with "
                u"duplicate indices" % session.bind.engine.name)
        return 'ix_%s_%s' % (self.table.name, col.name)

    def _mysql_constraint_createstring(self, constraint):


Generated by  Doxygen 1.6.0   Back to index