Properly disable autoincrement in assoc table

- for the chatroom_id FK it's already done automatically by SQLAlchemy
- for event_id (not a FK yet) it should be specified in the model, too
This commit is contained in:
Adrian Moennich 2014-10-01 10:19:16 +02:00
parent 67d5abc6c7
commit 5a9a415966
2 changed files with 3 additions and 3 deletions

View File

@ -35,8 +35,7 @@ def upgrade():
op.create_table('chatroom_events',
sa.Column('event_id', sa.Integer(), nullable=False, primary_key=True, index=True,
autoincrement=False),
sa.Column('chatroom_id', sa.Integer(), nullable=False, primary_key=True, index=True,
autoincrement=False),
sa.Column('chatroom_id', sa.Integer(), nullable=False, primary_key=True, index=True),
sa.Column('hidden', sa.Boolean(), nullable=False),
sa.Column('show_password', sa.Boolean(), nullable=False),
sa.ForeignKeyConstraint(['chatroom_id'], ['plugin_chat.chatrooms.id']),

View File

@ -114,7 +114,8 @@ class ChatroomEventAssociation(db.Model):
event_id = db.Column(
db.Integer,
primary_key=True,
index=True
index=True,
autoincrement=False
)
#: ID of the chatroom
chatroom_id = db.Column(