Thanks a lot and have a good weekend!
class Test2(Base):
__tablename__ = 'test2'
fid = Column(Integer, ForeignKey('test1.id'))
tname = Column(String(15))
You can see that Test2 is a table without a primary key. When I run 'alembic revision --autogenerate' to create migration script, and got below error:
File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/__init__.py", line 1129, in mapper
return Mapper(class_, local_table, *args, **params)
File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/mapper.py", line 203, in __init__
self._configure_pks()
File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/mapper.py", line 767, in _configure_pks
(self, self.mapped_table.description))
sqlalchemy.exc.ArgumentError: Mapper Mapper|Test2|test2 could not assemble any primary key columns for mapped table 'test2'
So I wonder how to create a migration script for a table without primary key. Non-primary key is not good design, but acceptable in mysql, sqlite, postgresql.
Thank you very much!