9845a330ed06_.py 2.21 KB
Newer Older
Robin Sonnabend's avatar
Robin Sonnabend committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
"""empty message

Revision ID: 9845a330ed06
Revises: 4651698510d7
Create Date: 2017-03-31 20:31:34.199580

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = '9845a330ed06'
down_revision = '4651698510d7'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('likes',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('who', sa.String(), nullable=True),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('like_protocol_association',
    sa.Column('like_id', sa.Integer(), nullable=False),
    sa.Column('protocol_id', sa.Integer(), nullable=False),
    sa.ForeignKeyConstraint(['like_id'], ['likes.id'], ),
    sa.ForeignKeyConstraint(['protocol_id'], ['protocols.id'], ),
    sa.PrimaryKeyConstraint('like_id', 'protocol_id')
    )
    op.create_table('like_todo_association',
    sa.Column('like_id', sa.Integer(), nullable=False),
    sa.Column('todo_id', sa.Integer(), nullable=False),
    sa.ForeignKeyConstraint(['like_id'], ['likes.id'], ),
    sa.ForeignKeyConstraint(['todo_id'], ['todos.id'], ),
    sa.PrimaryKeyConstraint('like_id', 'todo_id')
    )
    op.create_table('like_decision_association',
    sa.Column('like_id', sa.Integer(), nullable=False),
    sa.Column('decision_id', sa.Integer(), nullable=False),
    sa.ForeignKeyConstraint(['decision_id'], ['decisions.id'], ),
    sa.ForeignKeyConstraint(['like_id'], ['likes.id'], ),
    sa.PrimaryKeyConstraint('like_id', 'decision_id')
    )
    op.create_table('like_top_association',
    sa.Column('like_id', sa.Integer(), nullable=False),
    sa.Column('top_id', sa.Integer(), nullable=False),
    sa.ForeignKeyConstraint(['like_id'], ['likes.id'], ),
    sa.ForeignKeyConstraint(['top_id'], ['tops.id'], ),
    sa.PrimaryKeyConstraint('like_id', 'top_id')
    )
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_table('like_top_association')
    op.drop_table('like_decision_association')
    op.drop_table('like_todo_association')
    op.drop_table('like_protocol_association')
    op.drop_table('likes')
    # ### end Alembic commands ###