<commit_before># -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations
from waffle.models import Switch


def add_prereg_switch(*args, **kwargs):
    switch = Switch(name='osf_preregistration', active=False)
    switch.save()


def remove_prereg_switch(*args, **kwargs):
    Switch.objects.get(name='osf_preregistration').delete()


class Migration(migrations.Migration):
    dependencies = [
        ('osf', '0142_remove_waffle_analytics_flags'),
    ]
    operations = [
        migrations.RunPython(add_prereg_switch, remove_prereg_switch)
    ]<commit_msg>add prereg schema with migration<commit_after># -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations
from waffle.models import Switch

from osf.utils.migrations import ensure_schemas
from osf.features import OSF_PREREGISTRATION


def add_prereg_switch(*args, **kwargs):
    switch = Switch(name=OSF_PREREGISTRATION, active=False)
    switch.save()
    ensure_schemas()


def remove_prereg_switch(*args, **kwargs):
    Switch.objects.get(name=OSF_PREREGISTRATION).delete()
    ensure_schemas()


class Migration(migrations.Migration):
    dependencies = [
        ('osf', '0142_remove_waffle_analytics_flags'),
    ]
    operations = [
        migrations.RunPython(add_prereg_switch, remove_prereg_switch)
    ]
{'fraction_non_alphanumeric': 0.10716925351071692, 'fraction_numerical': 0.007390983000739098, 'mean_word_length': 4.713080168776371, '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': '2759429', 'n_tokens_mistral': 438, 'n_tokens_neox': 429, 'n_words': 82}