majuna/migrations/versions/6f3e327e3b87_activities.py

61 lines
2.5 KiB
Python

"""activities
Revision ID: 6f3e327e3b87
Revises: 7ecfb305d243
Create Date: 2022-05-14 09:10:57.320077
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql
# revision identifiers, used by Alembic.
revision = '6f3e327e3b87'
down_revision = '7ecfb305d243'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.create_table('activity',
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('group_id', sa.Integer(), nullable=True),
sa.Column('activity_type', sa.String(length=20), nullable=False),
sa.Column('text', sa.Text(), nullable=False),
sa.Column('added', sa.DateTime(), nullable=False),
sa.PrimaryKeyConstraint('id', name=op.f('pk_activity'))
)
op.create_table('webhook',
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('description', sa.String(length=255), nullable=False),
sa.Column('added', sa.DateTime(), nullable=False),
sa.Column('updated', sa.DateTime(), nullable=False),
sa.Column('destroyed', sa.DateTime(), nullable=True),
sa.Column('format', sa.String(length=20), nullable=True),
sa.Column('url', sa.String(length=255), nullable=True),
sa.PrimaryKeyConstraint('id', name=op.f('pk_webhook'))
)
op.drop_table('eotk_instance')
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.create_table('eotk_instance',
sa.Column('id', sa.INTEGER(), autoincrement=True, nullable=False),
sa.Column('added', postgresql.TIMESTAMP(), autoincrement=False, nullable=False),
sa.Column('updated', postgresql.TIMESTAMP(), autoincrement=False, nullable=False),
sa.Column('deprecated', postgresql.TIMESTAMP(), autoincrement=False, nullable=True),
sa.Column('deprecation_reason', sa.VARCHAR(), autoincrement=False, nullable=True),
sa.Column('destroyed', postgresql.TIMESTAMP(), autoincrement=False, nullable=True),
sa.Column('group_id', sa.INTEGER(), autoincrement=False, nullable=False),
sa.Column('provider', sa.VARCHAR(length=20), autoincrement=False, nullable=False),
sa.Column('region', sa.VARCHAR(length=20), autoincrement=False, nullable=False),
sa.Column('instance_id', sa.VARCHAR(length=255), autoincrement=False, nullable=True),
sa.ForeignKeyConstraint(['group_id'], ['group.id'], name='fk_eotk_instance_group_id_group'),
sa.PrimaryKeyConstraint('id', name='pk_eotk_instance')
)
op.drop_table('webhook')
op.drop_table('activity')
# ### end Alembic commands ###