Module Import alias Import alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias ClassDef bases NameLoad body Pass decorator_list ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam defaults body Assign NameStore AttributeLoad AttributeLoad NameLoad attr attr If Call NameLoad NameLoad NameLoad body Expr Call AttributeLoad Call NameLoad NameLoad NameLoad attr NameLoad NameLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam defaults body Assign NameStore AttributeLoad AttributeLoad NameLoad attr attr If Call NameLoad NameLoad NameLoad body Expr Call AttributeLoad Call NameLoad NameLoad NameLoad attr NameLoad NameLoad NameLoad NameLoad decorator_list decorator_list ClassDef bases NameLoad NameLoad body Pass decorator_list ClassDef bases NameLoad NameLoad body Pass decorator_list FunctionDef arguments args defaults body Expr Str FunctionDef arguments args NameParam NameParam defaults body Pass decorator_list Return Call NameLoad NameLoad NameLoad decorator_list ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam NameParam NameParam defaults NameLoad body Assign AttributeStore NameLoad attr BoolOpOr NameLoad Dict Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Expr Call AttributeLoad Call NameLoad NameLoad NameLoad attr NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam defaults body Assign NameStore AttributeLoad AttributeLoad NameLoad attr attr If Call NameLoad NameLoad NameLoad body If UnaryOpNot AttributeLoad NameLoad attr body Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr NameLoad Expr Call AttributeLoad Call NameLoad NameLoad NameLoad attr NameLoad NameLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam defaults body Assign NameStore AttributeLoad AttributeLoad NameLoad attr attr If Call NameLoad NameLoad NameLoad body If AttributeLoad NameLoad attr body If UnaryOpNot AttributeLoad NameLoad attr body Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr NameLoad Expr Call AttributeLoad Call NameLoad NameLoad NameLoad attr NameLoad NameLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body With Call NameLoad AttributeLoad NameLoad attr NameStore body Assign NameStore Call AttributeLoad NameLoad attr Assign NameStore Call NameLoad NameLoad Return Call AttributeLoad NameLoad attr Call NameLoad AttributeLoad NameLoad attr decorator_list decorator_list ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam NameParam defaults NameLoad body Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults NameLoad NameLoad body If BoolOpAnd NameLoad UnaryOpNot AttributeLoad NameLoad attr body Return Call NameLoad Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr NameLoad If CompareIs NameLoad NameLoad body Assign NameStore Str Assign NameStore NameLoad If NameLoad body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr NameLoad Return Call NameLoad NameLoad NameLoad AttributeLoad NameLoad attr decorator_list decorator_list FunctionDef arguments args NameParam NameParam defaults body If UnaryOpNot Call AttributeLoad NameLoad attr NameLoad body Raise Call NameLoad BinOpMod Str NameLoad decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore Call AttributeLoad NameLoad attr Str If UnaryOpNot Call AttributeLoad NameLoad attr NameLoad body Raise Call NameLoad BinOpMod Str NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body FunctionDef arguments args NameParam NameParam defaults body With Call AttributeLoad NameLoad attr NameStore body Expr Call AttributeLoad NameLoad attr Str ListLoad NameLoad Assign NameStore ListComp SubscriptLoad NameLoad Index Num comprehension NameStore Call AttributeLoad NameLoad attr For NameStore NameLoad body Expr Call NameLoad NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad Num Expr Call NameLoad NameLoad Expr Call NameLoad NameLoad Expr Call AttributeLoad NameLoad attr BinOpMod Str TupleLoad NameLoad NameLoad decorator_list Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Return Call NameLoad Call NameLoad NameLoad NameLoad decorator_list
N/A N/A os N/A re django.conf settings django.db connection django.db.migrations RunPython django.db.migrations.operations.special RunSQL django.template Context django.template.loader get_template_from_string corehq.sql_db.routers allow_migrate IndexRenameOperationException N/A Exception N/A N/A N/A HqOpMixin N/A object N/A N/A 
    Hack until we upgrade to Django 1.8 to allow selectively running custom operations
    on different DB's
     database_forwards N/A N/A self app_label schema_editor from_state to_state N/A N/A N/A db_alias N/A N/A schema_editor connection alias N/A N/A allow_migrate db_alias app_label N/A N/A N/A N/A N/A super HqOpMixin self database_forwards app_label schema_editor from_state to_state N/A database_backwards N/A N/A self app_label schema_editor from_state to_state N/A N/A N/A db_alias N/A N/A schema_editor connection alias N/A N/A allow_migrate db_alias app_label N/A N/A N/A N/A N/A super HqOpMixin self database_backwards app_label schema_editor from_state to_state N/A N/A HqRunSQL N/A HqOpMixin RunSQL N/A N/A N/A HqRunPython N/A HqOpMixin RunPython N/A N/A N/A noop_migration N/A N/A N/A N/A N/A 
    A migration that does nothing. Used to replace old migrations that are no longer required e.g moved.
     noop_migration_fn N/A N/A apps schema_editor N/A N/A N/A N/A N/A N/A RunPython noop_migration_fn noop_migration_fn N/A RunSqlLazy N/A RunSQL N/A N/A 
    Extension of RunSQL that reads the SQL contents from a file "just in time".

    Also supports reading the SQL as a Django template and rendering
    it with the provided template context.
     __init__ N/A N/A self sql_template_path reverse_sql_template_path template_context N/A None N/A N/A N/A self template_context N/A template_context N/A N/A N/A self rendered_forwards False N/A N/A self rendered_backwards False N/A N/A N/A N/A super RunSqlLazy self __init__ sql_template_path reverse_sql_template_path N/A database_forwards N/A N/A self app_label schema_editor from_state to_state N/A N/A N/A db_alias N/A N/A schema_editor connection alias N/A N/A allow_migrate db_alias app_label N/A N/A N/A N/A self rendered_forwards N/A N/A N/A self sql N/A N/A self _render_template N/A self sql N/A N/A self rendered_forwards True N/A N/A N/A N/A super RunSqlLazy self database_forwards app_label schema_editor from_state to_state N/A database_backwards N/A N/A self app_label schema_editor from_state to_state N/A N/A N/A db_alias N/A N/A schema_editor connection alias N/A N/A allow_migrate db_alias app_label N/A N/A N/A self reverse_sql N/A N/A N/A N/A self rendered_backwards N/A N/A N/A self reverse_sql N/A N/A self _render_template N/A self reverse_sql N/A N/A self rendered_backwards True N/A N/A N/A N/A super RunSqlLazy self database_backwards app_label schema_editor from_state to_state N/A _render_template N/A N/A self path N/A N/A N/A N/A open N/A self sql f N/A N/A template_string N/A N/A f read N/A template N/A get_template_from_string template_string N/A N/A N/A template render N/A Context N/A self template_context N/A N/A RawSQLMigration N/A object N/A N/A 
    Helper class for running raw SQL migrations.
    Usage:

        migrator = RawSQLMigration(('base', 'path'), {'variable': 'value'})
        migrator.get_migration('sql_template.sql')
     __init__ N/A N/A self base_path_tuple template_context N/A None N/A N/A N/A self template_context template_context N/A N/A self base_path N/A N/A N/A os path join base_path_tuple N/A get_migration N/A N/A self forward_template reverse_template testing_only N/A Ellipsis False N/A N/A N/A testing_only N/A N/A settings UNIT_TESTING N/A N/A N/A noop_migration N/A forward_path N/A N/A N/A os path join N/A self base_path forward_template N/A N/A reverse_template Ellipsis N/A N/A reverse_template SELECT 1 N/A reverse_path None N/A reverse_template N/A N/A reverse_path N/A N/A N/A os path join N/A self base_path reverse_template N/A N/A RunSqlLazy forward_path reverse_path N/A self template_context N/A N/A _validate_old_index_name N/A N/A index_name table_name N/A N/A N/A N/A N/A N/A index_name startswith table_name N/A N/A N/A IndexRenameOperationException N/A Expected all indexes on table %s to start with the table name table_name N/A _validate_identifier N/A N/A name N/A N/A N/A allowed_chars N/A N/A re compile ^[\w\$]+$ N/A N/A N/A N/A allowed_chars match name N/A N/A N/A IndexRenameOperationException N/A Invalid identifier given: %s name N/A _rename_table_indexes N/A N/A from_table to_table N/A N/A fcn N/A N/A apps schema_editor N/A N/A N/A N/A N/A connection cursor cursor N/A N/A N/A N/A cursor execute SELECT indexname FROM pg_indexes WHERE tablename = %s N/A from_table N/A indexes N/A N/A row N/A 0 N/A row N/A N/A cursor fetchall N/A index_name indexes N/A N/A N/A _validate_old_index_name index_name from_table N/A new_index_name N/A N/A index_name replace from_table to_table 1 N/A N/A _validate_identifier index_name N/A N/A _validate_identifier new_index_name N/A N/A N/A cursor execute N/A ALTER INDEX %s RENAME TO %s N/A index_name new_index_name N/A N/A fcn N/A rename_table_indexes N/A N/A from_table to_table N/A N/A N/A 
    Returns a migration operation to rename table indexes to prevent index name
    collision when renaming models. This should be used in conjunction with a
    migrations.RenameModel operation, with this operation being placed right before
    it.

    NOTE: Django unapplies migration operations in LIFO order. In order to
    unapply this rename_table_indexes operation, we would have to unapply the
    rename_table_indexes and rename table operation in FIFO order. So for
    now, not allowing the reverse.
     N/A N/A HqRunPython N/A _rename_table_indexes from_table to_table N/A