Skip to content

Commit

Permalink
Merge pull request #500 from uhh-lt/remove-tables
Browse files Browse the repository at this point in the history
Remove tables
  • Loading branch information
bigabig authored Feb 11, 2025
2 parents 4d76fdb + 4840a15 commit 922b82c
Show file tree
Hide file tree
Showing 33 changed files with 81 additions and 2,010 deletions.
81 changes: 81 additions & 0 deletions backend/src/alembic/versions/241cfa625db2_remove_analysistable.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
"""remove analysistable
Revision ID: 241cfa625db2
Revises: 970c55224a39
Create Date: 2025-02-11 10:16:29.438178
"""

from typing import Sequence, Union

import sqlalchemy as sa
from sqlalchemy.dialects import postgresql

from alembic import op

# revision identifiers, used by Alembic.
revision: str = "241cfa625db2"
down_revision: Union[str, None] = "970c55224a39"
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.drop_index("ix_analysistable_created", table_name="analysistable")
op.drop_index("ix_analysistable_id", table_name="analysistable")
op.drop_index("ix_analysistable_project_id", table_name="analysistable")
op.drop_index("ix_analysistable_user_id", table_name="analysistable")
op.drop_table("analysistable")
# ### end Alembic commands ###


def downgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
op.create_table(
"analysistable",
sa.Column("id", sa.INTEGER(), autoincrement=True, nullable=False),
sa.Column(
"created",
postgresql.TIMESTAMP(),
server_default=sa.text("now()"),
autoincrement=False,
nullable=False,
),
sa.Column(
"updated",
postgresql.TIMESTAMP(),
server_default=sa.text("now()"),
autoincrement=False,
nullable=False,
),
sa.Column("title", sa.VARCHAR(), autoincrement=False, nullable=False),
sa.Column("content", sa.VARCHAR(), autoincrement=False, nullable=False),
sa.Column("table_type", sa.VARCHAR(), autoincrement=False, nullable=False),
sa.Column("project_id", sa.INTEGER(), autoincrement=False, nullable=False),
sa.Column("user_id", sa.INTEGER(), autoincrement=False, nullable=False),
sa.ForeignKeyConstraint(
["project_id"],
["project.id"],
name="analysistable_project_id_fkey",
ondelete="CASCADE",
),
sa.ForeignKeyConstraint(
["user_id"],
["user.id"],
name="analysistable_user_id_fkey",
ondelete="CASCADE",
),
sa.PrimaryKeyConstraint("id", name="analysistable_pkey"),
)
op.create_index(
"ix_analysistable_user_id", "analysistable", ["user_id"], unique=False
)
op.create_index(
"ix_analysistable_project_id", "analysistable", ["project_id"], unique=False
)
op.create_index("ix_analysistable_id", "analysistable", ["id"], unique=False)
op.create_index(
"ix_analysistable_created", "analysistable", ["created"], unique=False
)
# ### end Alembic commands ###
139 changes: 0 additions & 139 deletions backend/src/api/endpoints/analysis_table.py

This file was deleted.

2 changes: 0 additions & 2 deletions backend/src/app/core/data/crud/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
from enum import Enum

from app.core.data.crud.analysis_table import crud_analysis_table
from app.core.data.crud.annotation_document import crud_adoc
from app.core.data.crud.bbox_annotation import crud_bbox_anno
from app.core.data.crud.code import crud_code
Expand All @@ -26,7 +25,6 @@


class Crud(Enum):
ANALYSIS_TABLE = crud_analysis_table
ANNOTATION_DOCUMENT = crud_adoc
BBOX_ANNOTATION = crud_bbox_anno
CODE = crud_code
Expand Down
46 changes: 0 additions & 46 deletions backend/src/app/core/data/crud/analysis_table.py

This file was deleted.

44 changes: 0 additions & 44 deletions backend/src/app/core/data/dto/analysis_table.py

This file was deleted.

40 changes: 0 additions & 40 deletions backend/src/app/core/data/orm/analysis_table.py

This file was deleted.

5 changes: 0 additions & 5 deletions backend/src/app/core/data/orm/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
from app.core.data.orm.orm_base import ORMBase

if TYPE_CHECKING:
from app.core.data.orm.analysis_table import AnalysisTableORM
from app.core.data.orm.code import CodeORM
from app.core.data.orm.document_tag import DocumentTagORM
from app.core.data.orm.memo import MemoORM
Expand Down Expand Up @@ -52,10 +51,6 @@ class ProjectORM(ORMBase):
"DocumentTagORM", back_populates="project", passive_deletes=True
)

analysis_tables: Mapped[List["AnalysisTableORM"]] = relationship(
"AnalysisTableORM", back_populates="project", passive_deletes=True
)

whiteboards: Mapped[List["WhiteboardORM"]] = relationship(
"WhiteboardORM", back_populates="project", passive_deletes=True
)
Expand Down
Loading

0 comments on commit 922b82c

Please sign in to comment.