2022-11-22 18:06:19 +01:00
|
|
|
"""init
|
|
|
|
|
|
|
|
Revision ID: f68634d9bba2
|
|
|
|
Revises:
|
|
|
|
Create Date: 2022-11-22 16:13:15.953908+00:00
|
|
|
|
|
|
|
|
"""
|
|
|
|
from alembic import op
|
|
|
|
import sqlalchemy as sa
|
|
|
|
|
|
|
|
|
|
|
|
# revision identifiers, used by Alembic.
|
|
|
|
revision = 'f68634d9bba2'
|
|
|
|
down_revision = None
|
|
|
|
branch_labels = None
|
|
|
|
depends_on = None
|
|
|
|
|
|
|
|
|
|
|
|
def upgrade() -> None:
|
|
|
|
# ### commands auto generated by Alembic - please adjust! ###
|
|
|
|
op.create_table('actor',
|
|
|
|
sa.Column('id', sa.Integer(), nullable=False),
|
|
|
|
sa.Column('created_at', sa.DateTime(timezone=True), nullable=False),
|
|
|
|
sa.Column('updated_at', sa.DateTime(timezone=True), nullable=False),
|
|
|
|
sa.Column('ap_id', sa.String(), nullable=False),
|
|
|
|
sa.Column('ap_actor', sa.String(), nullable=False),
|
|
|
|
sa.Column('is_blocked', sa.Boolean(), server_default='0', nullable=False),
|
|
|
|
sa.Column('is_deleted', sa.Boolean(), server_default='0', nullable=False),
|
2023-03-16 10:41:07 +01:00
|
|
|
sa.Column('ap_type', sa.String(), nullable=False),
|
|
|
|
sa.Column('handle', sa.String(), nullable=True),
|
2022-11-22 18:06:19 +01:00
|
|
|
sa.PrimaryKeyConstraint('id')
|
|
|
|
)
|
|
|
|
op.create_index(op.f('ix_actor_ap_id'), 'actor', ['ap_id'], unique=True)
|
|
|
|
op.create_index(op.f('ix_actor_id'), 'actor', ['id'], unique=False)
|
|
|
|
op.create_table('ingress',
|
|
|
|
sa.Column('id', sa.Integer(), nullable=False),
|
|
|
|
sa.Column('created_at', sa.DateTime(timezone=True), nullable=False),
|
|
|
|
sa.Column('ap_id', sa.String(), nullable=True),
|
|
|
|
sa.Column('ap_object', sa.JSON(), nullable=True),
|
|
|
|
sa.PrimaryKeyConstraint('id')
|
|
|
|
)
|
|
|
|
op.create_index(op.f('ix_ingress_ap_id'), 'ingress', ['ap_id'], unique=False)
|
|
|
|
op.create_index(op.f('ix_ingress_id'), 'ingress', ['id'], unique=False)
|
2023-03-16 10:41:07 +01:00
|
|
|
op.create_index(op.f('ix_actor_handle'), 'actor', ['handle'], unique=False)
|
2022-11-22 18:06:19 +01:00
|
|
|
# ### end Alembic commands ###
|
|
|
|
|
|
|
|
|
|
|
|
def downgrade() -> None:
|
|
|
|
# ### commands auto generated by Alembic - please adjust! ###
|
|
|
|
op.drop_index(op.f('ix_ingress_id'), table_name='ingress')
|
|
|
|
op.drop_index(op.f('ix_ingress_ap_id'), table_name='ingress')
|
|
|
|
op.drop_table('ingress')
|
|
|
|
op.drop_index(op.f('ix_actor_id'), table_name='actor')
|
|
|
|
op.drop_index(op.f('ix_actor_ap_id'), table_name='actor')
|
2023-03-16 10:41:07 +01:00
|
|
|
op.drop_index(op.f('ix_actor_handle'), table_name='actor')
|
2022-11-22 18:06:19 +01:00
|
|
|
op.drop_table('actor')
|
|
|
|
# ### end Alembic commands ###
|