38 lines
1.0 KiB
Python
38 lines
1.0 KiB
Python
|
"""Added UserCooperationHistory.
|
||
|
|
||
|
Revision ID: 4c132220432f
|
||
|
Revises: ff356b1ef661
|
||
|
Create Date: 2021-09-01 09:25:43.144096
|
||
|
|
||
|
"""
|
||
|
from alembic import op
|
||
|
import sqlalchemy as sa
|
||
|
|
||
|
|
||
|
# revision identifiers, used by Alembic.
|
||
|
revision = '4c132220432f'
|
||
|
down_revision = 'ff356b1ef661'
|
||
|
branch_labels = None
|
||
|
depends_on = None
|
||
|
|
||
|
|
||
|
def upgrade():
|
||
|
# ### commands auto generated by Alembic - please adjust! ###
|
||
|
op.create_table('user_cooperation',
|
||
|
sa.Column('id', sa.Integer(), nullable=False),
|
||
|
sa.Column('user', sa.Integer(), nullable=False),
|
||
|
sa.Column('institution', sa.Integer(), nullable=False),
|
||
|
sa.Column('role', sa.String(), nullable=False),
|
||
|
sa.Column('badge_text', sa.String(), nullable=True),
|
||
|
sa.ForeignKeyConstraint(['institution'], ['institution.id'], ),
|
||
|
sa.ForeignKeyConstraint(['user'], ['registered_user.id'], ),
|
||
|
sa.PrimaryKeyConstraint('id')
|
||
|
)
|
||
|
# ### end Alembic commands ###
|
||
|
|
||
|
|
||
|
def downgrade():
|
||
|
# ### commands auto generated by Alembic - please adjust! ###
|
||
|
op.drop_table('user_cooperation')
|
||
|
# ### end Alembic commands ###
|