content: """search index
  
  Revision ID: 20240826215938_3c7be0985b17
  Revises: 20240823164559_05069444feee
  Create Date: 2024-08-26 21:59:38.638095
  
  """
  
  from typing import Sequence, Union
  
  import sqlalchemy as sa
  from alembic import op
  
  # revision identifiers, used by Alembic.
  revision: str = "20240826215938_3c7be0985b17"
  down_revision: Union[str, None] = "20240823164559_05069444feee"
  branch_labels: Union[str, Sequence[str], None] = None
  depends_on: Union[str, Sequence[str], None] = None
  
  
  def upgrade() -> None:
      # ### commands auto generated by Alembic - please adjust! ###
      op.create_table(
          "search_indices",
          sa.Column("id", sa.Integer(), nullable=False),
          sa.Column("project_id", sa.Text(), nullable=True),
          sa.Column("node_id", sa.String(), nullable=True),
          sa.Column("name", sa.String(), nullable=True),
          sa.Column("file_path", sa.String(), nullable=True),
          sa.Column("content", sa.Text(), nullable=True),
          sa.ForeignKeyConstraint(
              ["project_id"],
              ["projects.id"],
          ),
          sa.PrimaryKeyConstraint("id"),
      )
      op.create_index(
          op.f("ix_search_indices_file_path"),
          "search_indices",
          ["file_path"],
          unique=False,
      )
      op.create_index(
          op.f("ix_search_indices_id"), "search_indices", ["id"], unique=False
      )
      op.create_index(
          op.f("ix_search_indices_name"), "search_indices", ["name"], unique=False
      )
      op.create_index(
          op.f("ix_search_indices_node_id"), "search_indices", ["node_id"], unique=False
      )
      op.create_index(
          op.f("ix_search_indices_project_id"),
          "search_indices",
          ["project_id"],
          unique=False,
      )
      op.create_table(
          "tasks",
          sa.Column("id", sa.Integer(), nullable=False),
          sa.Column(
              "task_type",
              sa.Enum(
                  "CODEBASE_PROCESSING",
                  "FILE_INFERENCE",
                  "FLOWS_PROCESSING",
                  name="tasktype",
              ),
              nullable=False,
          ),
          sa.Column("custom_status", sa.String(length=50), nullable=False),
          sa.Column("created_at", sa.DateTime(), nullable=True),
          sa.Column("updated_at", sa.DateTime(), nullable=True),
          sa.Column("project_id", sa.String(), nullable=False),
          sa.Column("result", sa.String(), nullable=True),
          sa.ForeignKeyConstraint(
              ["project_id"],
              ["projects.id"],
          ),
          sa.PrimaryKeyConstraint("id"),
      )
      # ### end Alembic commands ###
  
  
  def downgrade() -> None:
      # ### commands auto generated by Alembic - please adjust! ###
      op.drop_table("tasks")
      op.drop_index(op.f("ix_search_indices_project_id"), table_name="search_indices")
      op.drop_index(op.f("ix_search_indices_node_id"), table_name="search_indices")
      op.drop_index(op.f("ix_search_indices_name"), table_name="search_indices")
      op.drop_index(op.f("ix_search_indices_id"), table_name="search_indices")
      op.drop_index(op.f("ix_search_indices_file_path"), table_name="search_indices")
      op.drop_table("search_indices")
      # ### end Alembic commands ###
  