<commit_before><commit_msg>Delete 'copied_from_brief_id' column and create a correspnding migration<commit_after>"""Remove copied_from_brief_id column from briefs table  as it has been superseded with 'is_a-copy' boolaean column
to fix a bug. The bug made it impossible to delete a draft brief if a copy was made from it. Reason for this is
that the original and the copy were bound by a parent-child database relationship.

Revision ID: 910
Revises: 900
Create Date: 2017-06-01
"""

# revision identifiers, used by Alembic.
revision = '910'
down_revision = '900'

from alembic import op
from sqlalchemy import Column, ForeignKey, INTEGER


def upgrade():
    """Drop column as it has been superseded with 'is_a-copy' boolaean copy to fix a bug."""
    op.drop_column(
        'briefs',
        'copied_from_brief_id'
    )


def downgrade():
    """Reinstates copied_from_brief_id column, but without populating with data."""
    op.add_column(
        'briefs',
        Column('copied_from_brief_id', INTEGER, ForeignKey('briefs.id'))
    )
{'fraction_non_alphanumeric': 0.08253358925143954, 'fraction_numerical': 0.019193857965451054, 'mean_word_length': 4.063106796116505, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1692024', 'n_tokens_mistral': 341, 'n_tokens_neox': 312, 'n_words': 122}