onions: switch bc2 over to new onion table, drop mirrors table
fixes: #4
This commit is contained in:
parent
fce594bbc4
commit
23a8a6b8af
4 changed files with 81 additions and 39 deletions
40
migrations/versions/1842ba85a5c7_drop_mirror_table.py
Normal file
40
migrations/versions/1842ba85a5c7_drop_mirror_table.py
Normal file
|
@ -0,0 +1,40 @@
|
|||
"""drop mirror table
|
||||
|
||||
Revision ID: 1842ba85a5c7
|
||||
Revises: 9f5525e84960
|
||||
Create Date: 2022-05-17 09:28:13.172061
|
||||
|
||||
"""
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
from sqlalchemy.dialects import postgresql
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '1842ba85a5c7'
|
||||
down_revision = '9f5525e84960'
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.drop_table('mirror')
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.create_table('mirror',
|
||||
sa.Column('id', sa.INTEGER(), autoincrement=True, nullable=False),
|
||||
sa.Column('origin_id', sa.INTEGER(), autoincrement=False, nullable=False),
|
||||
sa.Column('url', sa.VARCHAR(length=255), autoincrement=False, 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('destroyed', postgresql.TIMESTAMP(), autoincrement=False, nullable=True),
|
||||
sa.Column('deprecation_reason', sa.VARCHAR(), autoincrement=False, nullable=True),
|
||||
sa.ForeignKeyConstraint(['origin_id'], ['origin.id'], name='fk_mirror_origin_id_origin'),
|
||||
sa.PrimaryKeyConstraint('id', name='pk_mirror'),
|
||||
sa.UniqueConstraint('url', name='uq_mirror_url')
|
||||
)
|
||||
# ### end Alembic commands ###
|
Loading…
Add table
Add a link
Reference in a new issue