# Path: osf/utils/migrations.py
# FORMAT_TYPE_TO_TYPE_MAP = {
#     ('multiselect', 'choose'): 'multi-select-input',
#     (None, 'multiselect'): 'multi-select-input',
#     (None, 'choose'): 'single-select-input',
#     ('osf-upload-open', 'osf-upload'): 'file-input',
#     ('osf-upload-toggle', 'osf-upload'): 'file-input',
#     ('singleselect', 'choose'): 'single-select-input',
#     ('text', 'string'): 'short-text-input',
#     ('textarea', 'osf-author-import'): 'contributors-input',
#     ('textarea', None): 'long-text-input',
#     ('textarea', 'string'): 'long-text-input',
#     ('textarea-lg', None): 'long-text-input',
#     ('textarea-lg', 'string'): 'long-text-input',
#     ('textarea-xl', 'string'): 'long-text-input',
# }
# def get_osf_models():
# def disable_auto_now_fields(models=None):
# def disable_auto_now_add_fields(models=None):
# def ensure_licenses(*args, **kwargs):
# def remove_licenses(*args):
# def ensure_schemas(*args):
# def remove_schemas(*args):
# def create_schema_block(state, schema_id, block_type, display_text='', required=False, help_text='',
#         registration_response_key=None, schema_block_group_key='', example_text=''):
# def split_options_into_blocks(state, rs, question, schema_block_group_key):
# def get_registration_response_key(question):
# def find_title_description_help_example(rs, question):
# def get_subquestion_qid(question, subquestion):
# def create_schema_blocks_for_question(state, rs, question, sub=False):
# def create_schema_blocks_for_atomic_schema(schema):
# def map_schema_to_schemablocks(rs, state=None):
# def map_schemas_to_schemablocks(*args):
# def unmap_schemablocks(*args):
#     def state_forwards(self, app_label, state):
#     def database_forwards(self, app_label, schema_editor, from_state, to_state):
#     def database_backwards(self, app_label, schema_editor, from_state, to_state):
#     def describe(self):
#     def state_forwards(self, app_label, state):
#     def database_forwards(self, app_label, schema_editor, from_state, to_state):
#     def database_backwards(self, app_label, schema_editor, from_state, to_state):
#     def describe(self):
#     def __init__(self, flag_names, on_for_everyone=False):
#     def state_forwards(self, app_label, state):
#     def database_forwards(self, app_label, schema_editor, from_state, to_state):
#     def database_backwards(self, app_label, schema_editor, from_state, to_state):
#     def describe(self):
#     def __init__(self, flag_names):
#     def state_forwards(self, app_label, state):
#     def database_forwards(self, app_label, schema_editor, from_state, to_state):
#     def database_backwards(self, app_label, schema_editor, from_state, to_state):
#     def describe(self):
#     def __init__(self, switch_names, active=False):
#     def state_forwards(self, app_label, state):
#     def database_forwards(self, app_label, schema_editor, from_state, to_state):
#     def database_backwards(self, app_label, schema_editor, from_state, to_state):
#     def describe(self):
#     def __init__(self, switch_names):
#     def state_forwards(self, app_label, state):
#     def database_forwards(self, app_label, schema_editor, from_state, to_state):
#     def database_backwards(self, app_label, schema_editor, from_state, to_state):
#     def describe(self):
# def batch_node_migrations(state, migrations):
# class UpdateRegistrationSchemas(Operation):
# class UpdateRegistrationSchemasAndSchemaBlocks(Operation):
# class AddWaffleFlags(Operation):
# class DeleteWaffleFlags(Operation):
# class AddWaffleSwitches(Operation):
# class DeleteWaffleSwitches(Operation):


import logging
from django.core.management.base import BaseCommand
from django.db import transaction
from osf.utils import migrations


logger = logging.getLogger(__name__)

@transaction.atomic
def update_registration_schemas(dry_run=False):
    """Update the regitration schemas to match the locally defined schemas."""
    logger.debug('Updating Registration Schemas')

# Path: osf/utils/migrations.py
# FORMAT_TYPE_TO_TYPE_MAP = {
#     ('multiselect', 'choose'): 'multi-select-input',
#     (None, 'multiselect'): 'multi-select-input',
#     (None, 'choose'): 'single-select-input',
#     ('osf-upload-open', 'osf-upload'): 'file-input',
#     ('osf-upload-toggle', 'osf-upload'): 'file-input',
#     ('singleselect', 'choose'): 'single-select-input',
#     ('text', 'string'): 'short-text-input',
#     ('textarea', 'osf-author-import'): 'contributors-input',
#     ('textarea', None): 'long-text-input',
#     ('textarea', 'string'): 'long-text-input',
#     ('textarea-lg', None): 'long-text-input',
#     ('textarea-lg', 'string'): 'long-text-input',
#     ('textarea-xl', 'string'): 'long-text-input',
# }
# def get_osf_models():
# def disable_auto_now_fields(models=None):
# def disable_auto_now_add_fields(models=None):
# def ensure_licenses(*args, **kwargs):
# def remove_licenses(*args):
# def ensure_schemas(*args):
# def remove_schemas(*args):
# def create_schema_block(state, schema_id, block_type, display_text='', required=False, help_text='',
#         registration_response_key=None, schema_block_group_key='', example_text=''):
# def split_options_into_blocks(state, rs, question, schema_block_group_key):
# def get_registration_response_key(question):
# def find_title_description_help_example(rs, question):
# def get_subquestion_qid(question, subquestion):
# def create_schema_blocks_for_question(state, rs, question, sub=False):
# def create_schema_blocks_for_atomic_schema(schema):
# def map_schema_to_schemablocks(rs, state=None):
# def map_schemas_to_schemablocks(*args):
# def unmap_schemablocks(*args):
#     def state_forwards(self, app_label, state):
#     def database_forwards(self, app_label, schema_editor, from_state, to_state):
#     def database_backwards(self, app_label, schema_editor, from_state, to_state):
#     def describe(self):
#     def state_forwards(self, app_label, state):
#     def database_forwards(self, app_label, schema_editor, from_state, to_state):
#     def database_backwards(self, app_label, schema_editor, from_state, to_state):
#     def describe(self):
#     def __init__(self, flag_names, on_for_everyone=False):
#     def state_forwards(self, app_label, state):
#     def database_forwards(self, app_label, schema_editor, from_state, to_state):
#     def database_backwards(self, app_label, schema_editor, from_state, to_state):
#     def describe(self):
#     def __init__(self, flag_names):
#     def state_forwards(self, app_label, state):
#     def database_forwards(self, app_label, schema_editor, from_state, to_state):
#     def database_backwards(self, app_label, schema_editor, from_state, to_state):
#     def describe(self):
#     def __init__(self, switch_names, active=False):
#     def state_forwards(self, app_label, state):
#     def database_forwards(self, app_label, schema_editor, from_state, to_state):
#     def database_backwards(self, app_label, schema_editor, from_state, to_state):
#     def describe(self):
#     def __init__(self, switch_names):
#     def state_forwards(self, app_label, state):
#     def database_forwards(self, app_label, schema_editor, from_state, to_state):
#     def database_backwards(self, app_label, schema_editor, from_state, to_state):
#     def describe(self):
# def batch_node_migrations(state, migrations):
# class UpdateRegistrationSchemas(Operation):
# class UpdateRegistrationSchemasAndSchemaBlocks(Operation):
# class AddWaffleFlags(Operation):
# class DeleteWaffleFlags(Operation):
# class AddWaffleSwitches(Operation):
# class DeleteWaffleSwitches(Operation):


# Path: osf/management/commands/update_registration_schemas.py
import logging
from django.core.management.base import BaseCommand
from django.db import transaction
from osf.utils import migrations



logger = logging.getLogger(__name__)

@transaction.atomic
def update_registration_schemas(dry_run=False):
    """Update the regitration schemas to match the locally defined schemas."""
    logger.debug('Updating Registration Schemas')

    migrations.ensure_schemas()