From bbf2f54832b7d22e2cad967aeea455ef2cbfd50f Mon Sep 17 00:00:00 2001 From: Adrian Moennich Date: Tue, 10 Mar 2015 17:10:32 +0100 Subject: [PATCH] Chat: Fix intermediate alembic steps --- ...201409291524_1bd6c5129d29_create_tables.py | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/chat/indico_chat/migrations/201409291524_1bd6c5129d29_create_tables.py b/chat/indico_chat/migrations/201409291524_1bd6c5129d29_create_tables.py index 33d4059..92038f6 100644 --- a/chat/indico_chat/migrations/201409291524_1bd6c5129d29_create_tables.py +++ b/chat/indico_chat/migrations/201409291524_1bd6c5129d29_create_tables.py @@ -26,20 +26,23 @@ def upgrade(): sa.Column('description', sa.Text(), nullable=False), sa.Column('password', sa.String(), nullable=False), sa.Column('custom_server', sa.String(), nullable=False), - sa.Column('created_by_id', sa.Integer(), nullable=False, index=True), + sa.Column('created_by_id', sa.Integer(), nullable=False), sa.Column('created_dt', UTCDateTime(), nullable=False), sa.Column('modified_dt', UTCDateTime(), nullable=True), - sa.PrimaryKeyConstraint('id'), - sa.UniqueConstraint('jid_node', 'custom_server'), + sa.PrimaryKeyConstraint('id', name='chatrooms_pkey'), + sa.UniqueConstraint('jid_node', 'custom_server', name='chatrooms_jid_node_custom_server_key'), + sa.Index('ix_plugin_chat_chatrooms_created_by_id', 'created_by_id'), schema='plugin_chat') 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), + sa.Column('event_id', sa.Integer(), nullable=False, autoincrement=False), + sa.Column('chatroom_id', sa.Integer(), nullable=False), sa.Column('hidden', sa.Boolean(), nullable=False), sa.Column('show_password', sa.Boolean(), nullable=False), - sa.ForeignKeyConstraint(['chatroom_id'], ['plugin_chat.chatrooms.id']), - sa.PrimaryKeyConstraint('event_id', 'chatroom_id'), + sa.ForeignKeyConstraint(['chatroom_id'], ['plugin_chat.chatrooms.id'], + name='chatroom_events_chatroom_id_fkey'), + sa.PrimaryKeyConstraint('event_id', 'chatroom_id', name='chatroom_events_pkey'), + sa.Index('ix_plugin_chat_chatroom_events_event_id', 'event_id'), + sa.Index('ix_plugin_chat_chatroom_events_chatroom_id', 'chatroom_id'), schema='plugin_chat')