]> git.lizzy.rs Git - cheatdb.git/blob - migrations/versions/9fc23495713b_.py
Fix scores not degrading due to missing session.commit()
[cheatdb.git] / migrations / versions / 9fc23495713b_.py
1 """empty message
2
3 Revision ID: 9fc23495713b
4 Revises: de004661c5e1
5 Create Date: 2018-07-04 00:03:20.123285
6
7 """
8 from alembic import op
9 import sqlalchemy as sa
10
11
12 # revision identifiers, used by Alembic.
13 revision = '9fc23495713b'
14 down_revision = 'de004661c5e1'
15 branch_labels = None
16 depends_on = None
17 from sqlalchemy.dialects.postgresql import ENUM
18
19 type_enum = ENUM('MOD', 'GAME', 'TXP', name='packagetype', create_type=False)
20
21 def upgrade():
22     type_enum.create(op.get_bind(), checkfirst=True)
23
24     # ### commands auto generated by Alembic - please adjust! ###
25     op.drop_table('krock_forum_topic')
26     op.create_table('forum_topic',
27     sa.Column('topic_id', sa.Integer(), autoincrement=False, nullable=False),
28     sa.Column('author_id', sa.Integer(), nullable=False),
29     sa.Column('type', type_enum, nullable=True),
30     sa.Column('title', sa.String(length=200), nullable=False),
31     sa.Column('name', sa.String(length=30), nullable=True),
32     sa.Column('link', sa.String(length=200), nullable=True),
33     sa.Column('posts', sa.Integer(), nullable=False),
34     sa.Column('views', sa.Integer(), nullable=False),
35     sa.Column('created_at', sa.DateTime(), nullable=False),
36     sa.ForeignKeyConstraint(['author_id'], ['user.id'], ),
37     sa.PrimaryKeyConstraint('topic_id')
38     )
39     # ### end Alembic commands ###
40
41
42 def downgrade():
43     # ### commands auto generated by Alembic - please adjust! ###
44     op.drop_table('forum_topic')
45     op.create_table('krock_forum_topic',
46     sa.Column('topic_id', sa.Integer(), autoincrement=False, nullable=False),
47     sa.Column('author_id', sa.Integer(), nullable=False),
48     sa.Column('ttype', sa.Integer(), nullable=False),
49     sa.Column('title', sa.String(length=200), nullable=False),
50     sa.Column('name', sa.String(length=30), nullable=True),
51     sa.Column('link', sa.String(length=50), nullable=True),
52     sa.ForeignKeyConstraint(['author_id'], ['user.id'], ),
53     sa.PrimaryKeyConstraint('topic_id')
54     )
55     # ### end Alembic commands ###