Skip to content

Commit

Permalink
chore(similarity): Make message column nullable in grouping records
Browse files Browse the repository at this point in the history
  • Loading branch information
jangjodi committed Sep 17, 2024
1 parent 31ce656 commit 64ccf30
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 1 deletion.
31 changes: 31 additions & 0 deletions src/migrations/versions/09b3ef05f1fe_migration.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
"""Migration
Revision ID: 09b3ef05f1fe
Revises: da0a9c9f1bb4
Create Date: 2024-09-17 17:13:49.660584
"""
import sqlalchemy as sa
from alembic import op

# revision identifiers, used by Alembic.
revision = "09b3ef05f1fe"
down_revision = "da0a9c9f1bb4"
branch_labels = None
depends_on = None


def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table("grouping_records", schema=None) as batch_op:
batch_op.alter_column("message", existing_type=sa.VARCHAR(), nullable=True)

# ### end Alembic commands ###


def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table("grouping_records", schema=None) as batch_op:
batch_op.alter_column("message", existing_type=sa.VARCHAR(), nullable=False)

# ### end Alembic commands ###
2 changes: 1 addition & 1 deletion src/seer/db.py
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ class DbGroupingRecord(Base):
server_default=text("nextval('grouping_records_id_seq')"),
)
project_id: Mapped[int] = mapped_column(BigInteger, primary_key=True, nullable=False)
message: Mapped[str] = mapped_column(String, nullable=False)
message: Mapped[Optional[str]] = mapped_column(String, nullable=True)
error_type: Mapped[str] = mapped_column(String, nullable=True)
stacktrace_embedding: Mapped[Vector] = mapped_column(Vector(768), nullable=False)
hash: Mapped[str] = mapped_column(String(32), nullable=False)
Expand Down

0 comments on commit 64ccf30

Please sign in to comment.