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