"""Added m2m forumgroups table Revision ID: 127be3fb000 Revises: 514ca0a3282c Create Date: 2015-04-08 22:25:52.809557 """ # revision identifiers, used by Alembic. revision = '127be3fb000' down_revision = '514ca0a3282c' from alembic import op import sqlalchemy as sa def upgrade(): ### commands auto generated by Alembic - please adjust! ### op.create_table('forumgroups', sa.Column('group_id', sa.Integer(), nullable=False), sa.Column('forum_id', sa.Integer(), nullable=False), sa.ForeignKeyConstraint(['forum_id'], ['forums.id'], name='fk_forum_id', use_alter=True), sa.ForeignKeyConstraint(['group_id'], ['groups.id'], ) ) op.create_foreign_key('fk_fr_forum_id', 'forumsread', 'forums', ['forum_id'], ['id']) op.create_foreign_key('fk_forum_id', 'moderators', 'forums', ['forum_id'], ['id']) op.create_foreign_key('fk_post_topic_id', 'posts', 'topics', ['topic_id'], ['id']) op.create_foreign_key('fk_settingsgroup', 'settings', 'settingsgroup', ['settingsgroup'], ['key']) op.create_foreign_key('fk_topic_forum_id', 'topics', 'forums', ['forum_id'], ['id']) op.create_foreign_key('fk_tr_topic_id', 'topicsread', 'topics', ['topic_id'], ['id']) op.create_foreign_key('fk_tr_forum_id', 'topicsread', 'forums', ['forum_id'], ['id']) op.create_foreign_key('fk_tracker_topic_id', 'topictracker', 'topics', ['topic_id'], ['id']) ### end Alembic commands ### def downgrade(): ### commands auto generated by Alembic - please adjust! ### op.drop_constraint('fk_tracker_topic_id', 'topictracker', type_='foreignkey') op.drop_constraint('fk_tr_forum_id', 'topicsread', type_='foreignkey') op.drop_constraint('fk_tr_topic_id', 'topicsread', type_='foreignkey') op.drop_constraint('fk_topic_forum_id', 'topics', type_='foreignkey') op.drop_constraint('fk_settingsgroup', 'settings', type_='foreignkey') op.drop_constraint('fk_post_topic_id', 'posts', type_='foreignkey') op.drop_constraint('fk_forum_id', 'moderators', type_='foreignkey') op.drop_constraint('fk_fr_forum_id', 'forumsread', type_='foreignkey') op.drop_table('forumgroups') ### end Alembic commands ###