6a86c1d5682f_.py 4.15 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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
"""empty message

Revision ID: 6a86c1d5682f
Revises: 9845a330ed06
Create Date: 2017-03-31 20:33:32.885639

"""
from alembic import op
import sqlalchemy as sa


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


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('likeprotocolassociations',
    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('liketodoassociations',
    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('likedecisionassociations',
    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('liketopassociations',
    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')
    )
    op.drop_table('like_top_association')
    op.drop_table('like_protocol_association')
    op.drop_table('like_todo_association')
    op.drop_table('like_decision_association')
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('like_decision_association',
    sa.Column('like_id', sa.INTEGER(), autoincrement=False, nullable=False),
    sa.Column('decision_id', sa.INTEGER(), autoincrement=False, nullable=False),
    sa.ForeignKeyConstraint(['decision_id'], ['decisions.id'], name='like_decision_association_decision_id_fkey'),
    sa.ForeignKeyConstraint(['like_id'], ['likes.id'], name='like_decision_association_like_id_fkey'),
    sa.PrimaryKeyConstraint('like_id', 'decision_id', name='like_decision_association_pkey')
    )
    op.create_table('like_todo_association',
    sa.Column('like_id', sa.INTEGER(), autoincrement=False, nullable=False),
    sa.Column('todo_id', sa.INTEGER(), autoincrement=False, nullable=False),
    sa.ForeignKeyConstraint(['like_id'], ['likes.id'], name='like_todo_association_like_id_fkey'),
    sa.ForeignKeyConstraint(['todo_id'], ['todos.id'], name='like_todo_association_todo_id_fkey'),
    sa.PrimaryKeyConstraint('like_id', 'todo_id', name='like_todo_association_pkey')
    )
    op.create_table('like_protocol_association',
    sa.Column('like_id', sa.INTEGER(), autoincrement=False, nullable=False),
    sa.Column('protocol_id', sa.INTEGER(), autoincrement=False, nullable=False),
    sa.ForeignKeyConstraint(['like_id'], ['likes.id'], name='like_protocol_association_like_id_fkey'),
    sa.ForeignKeyConstraint(['protocol_id'], ['protocols.id'], name='like_protocol_association_protocol_id_fkey'),
    sa.PrimaryKeyConstraint('like_id', 'protocol_id', name='like_protocol_association_pkey')
    )
    op.create_table('like_top_association',
    sa.Column('like_id', sa.INTEGER(), autoincrement=False, nullable=False),
    sa.Column('top_id', sa.INTEGER(), autoincrement=False, nullable=False),
    sa.ForeignKeyConstraint(['like_id'], ['likes.id'], name='like_top_association_like_id_fkey'),
    sa.ForeignKeyConstraint(['top_id'], ['tops.id'], name='like_top_association_top_id_fkey'),
    sa.PrimaryKeyConstraint('like_id', 'top_id', name='like_top_association_pkey')
    )
    op.drop_table('liketopassociations')
    op.drop_table('likedecisionassociations')
    op.drop_table('liketodoassociations')
    op.drop_table('likeprotocolassociations')
    # ### end Alembic commands ###