1
0
Fork 0
mirror of https://gitlab.com/SIGBUS/nyaa.git synced 2024-11-13 07:39:16 +00:00
nyaa/migrations/versions/3001f79b7722_add_torrents.uploader_ip.py
kyamiko 570a06bd9e API Info (#157)
Squashing 11 commits into one.
2017-06-03 23:57:53 +03:00

31 lines
652 B
Python

"""Add uploader_ip column to torrents table.
Revision ID: 3001f79b7722
Revises:
Create Date: 2017-05-21 18:01:35.472717
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '3001f79b7722'
down_revision = '97ddefed1834'
branch_labels = None
depends_on = None
TABLE_PREFIXES = ('nyaa', 'sukebei')
def upgrade():
for prefix in TABLE_PREFIXES:
op.add_column(prefix + '_torrents', sa.Column('uploader_ip', sa.Binary(), nullable=True))
# ### end Alembic commands ###
def downgrade():
for prefix in TABLE_PREFIXES:
op.drop_column(prefix + '_torrents', 'uploader_ip')