@classmethod
def create_table_sql(cls, db_name):
    """
        Returns the SQL command for creating a table for this model.
        """
    parts = ['CREATE TABLE IF NOT EXISTS `%s`.`%s` (' % (db_name, cls.
        table_name())]
    cols = []
    for name, field in cls._fields:
        cols.append('    %s %s' % (name, field.get_sql()))
    parts.append(',\n'.join(cols))
    parts.append(')')
    parts.append('ENGINE = ' + cls.engine.create_table_sql())
    return '\n'.join(parts)
