def METHOD_NAME():
    op.rename_table("block_schema", "block_spec")
    op.rename_table("block_document", "block")
    with op.batch_alter_table("block", schema=None) as batch_op:
        batch_op.drop_index("ix_block_document__is_default_storage_block_document")
        batch_op.drop_index("ix_block_document__name")
        batch_op.drop_index("ix_block_document__updated")
        batch_op.drop_index("uq_block__schema_id_name")
        batch_op.drop_constraint("fk_block__block_schema_id__block_schema")
        batch_op.drop_constraint("pk_block_document")
    with op.batch_alter_table("block", schema=None) as batch_op:
        batch_op.alter_column("block_schema_id", new_column_name="block_spec_id")
        batch_op.alter_column(
            "is_default_storage_block_document",
            new_column_name="is_default_storage_block",
        )
    with op.batch_alter_table("block", schema=None) as batch_op:
        batch_op.create_index(
            batch_op.f("ix_block__is_default_storage_block"),
            ["is_default_storage_block"],
            unique=False,
        )
        batch_op.create_index(batch_op.f("ix_block__name"), ["name"], unique=False)
        batch_op.create_index(
            batch_op.f("ix_block__updated"), ["updated"], unique=False
        )
        batch_op.create_index(
            "uq_block__spec_id_name", ["block_spec_id", "name"], unique=True
        )
    with op.batch_alter_table("block_spec", schema=None) as batch_op:
        batch_op.drop_index("ix_block_schema__type")
        batch_op.drop_index("ix_block_schema__updated")
        batch_op.drop_index("uq_block_schema__name_version")
        batch_op.create_index("ix_block_spec__type", ["type"], unique=False)
        batch_op.create_index(
            batch_op.f("ix_block_spec__updated"), ["updated"], unique=False
        )
        batch_op.create_index(
            "uq_block_spec__name_version", ["name", "version"], unique=True
        )
        batch_op.drop_constraint("pk_block_schema")
        batch_op.create_primary_key("pk_block_spec", ["id"])
    with op.batch_alter_table("block", schema=None) as batch_op:
        batch_op.create_primary_key("pk_block_data", ["id"])
        batch_op.create_foreign_key(
            batch_op.f("fk_block__block_spec_id__block_spec"),
            "block_spec",
            ["block_spec_id"],
            ["id"],
            ondelete="cascade",
        )