]> git.lizzy.rs Git - cheatdb.git/blob - migrations/versions/fd25bf3e57c3_.py
Fix migration error when migrating from scratch
[cheatdb.git] / migrations / versions / fd25bf3e57c3_.py
1 """empty message
2
3 Revision ID: fd25bf3e57c3
4 Revises: d6ae9682c45f
5 Create Date: 2019-11-26 23:43:47.476346
6
7 """
8 from alembic import op
9 import sqlalchemy as sa
10 from sqlalchemy.dialects import postgresql
11
12 # revision identifiers, used by Alembic.
13 revision = 'fd25bf3e57c3'
14 down_revision = 'd6ae9682c45f'
15 branch_labels = None
16 depends_on = None
17
18
19 def upgrade():
20     # ### commands auto generated by Alembic - please adjust! ###
21     op.create_table('api_token',
22     sa.Column('id', sa.Integer(), nullable=False),
23     sa.Column('access_token', sa.String(length=34), nullable=True),
24     sa.Column('name', sa.String(length=100), nullable=False),
25     sa.Column('owner_id', sa.Integer(), nullable=False),
26     sa.Column('created_at', sa.DateTime(), nullable=False),
27     sa.ForeignKeyConstraint(['owner_id'], ['user.id'], ),
28     sa.PrimaryKeyConstraint('id'),
29     sa.UniqueConstraint('access_token')
30     )
31     # ### end Alembic commands ###
32
33
34 def downgrade():
35     # ### commands auto generated by Alembic - please adjust! ###
36     op.drop_table('api_token')
37     # ### end Alembic commands ###