from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy import Table, Column, Integer, String, MetaData
from sqlalchemy import create_engine
Base = declarative_base()
class User(Base):
__tablename__ = "users"
uid = Column(Integer, primary_key=True)
friends = Column(String)
clubs = Column(String)
engine = create_engine('mysql://hr:password@localhost/ht')
Base.metadata.create_all(engine)
Session = sessionmaker(bind=engine)
File “/usr/local/lib/python2.6/dist-packages/SQLAlchemy-0.5.5-py2.6.egg/sqlalchemy/engine/base.py”, line 931, in _handle_dbapi_exception
raise exc.DBAPIError.instance(statement, parameters, e, connection_invalidated=is_disconnect)
sqlalchemy.exc.ProgrammingError: (ProgrammingError) (1064, “You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘ \n\tclubs VARCHAR, \n\tPRIMARY KEY (uid)\n)’ atline 3”) ‘\nCREATE TABLE users (\n\tuid INTEGER NOT NULL AUTO_INCREMENT, \n\tfriends VARCHAR, \n\tclubs VARCHAR, \n\tPRIMARY KEY (uid)\n)\n\n’ ()
Что я делаю не так?