foxhole/alembic/versions/2022_11_22_1613-f68634d9bba2_init.py
SouthFox fb8e72d2ff [WIP]WIP
- init profile
- receive ap_object
2022-11-23 01:06:19 +08:00

53 lines
1.9 KiB
Python

"""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),
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)
# ### 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')
op.drop_table('actor')
# ### end Alembic commands ###