major update
This commit is contained in:
41
alembic/versions/002_add_sentiment_reasoning_citations.py
Normal file
41
alembic/versions/002_add_sentiment_reasoning_citations.py
Normal file
@@ -0,0 +1,41 @@
|
||||
"""add reasoning and citations_json to sentiment_scores, unavailable_fields_json to fundamental_data
|
||||
|
||||
Revision ID: 002
|
||||
Revises: 001
|
||||
Create Date: 2025-01-02 00:00:00.000000
|
||||
|
||||
"""
|
||||
from typing import Sequence, Union
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision: str = "002"
|
||||
down_revision: Union[str, None] = "001"
|
||||
branch_labels: Union[str, Sequence[str], None] = None
|
||||
depends_on: Union[str, Sequence[str], None] = None
|
||||
|
||||
|
||||
def upgrade() -> None:
|
||||
op.add_column(
|
||||
"sentiment_scores",
|
||||
sa.Column("reasoning", sa.Text(), server_default="", nullable=False),
|
||||
)
|
||||
op.add_column(
|
||||
"sentiment_scores",
|
||||
sa.Column("citations_json", sa.Text(), server_default="[]", nullable=False),
|
||||
)
|
||||
op.add_column(
|
||||
"fundamental_data",
|
||||
sa.Column(
|
||||
"unavailable_fields_json", sa.Text(), server_default="{}", nullable=False
|
||||
),
|
||||
)
|
||||
|
||||
|
||||
def downgrade() -> None:
|
||||
op.drop_column("fundamental_data", "unavailable_fields_json")
|
||||
op.drop_column("sentiment_scores", "citations_json")
|
||||
op.drop_column("sentiment_scores", "reasoning")
|
||||
Reference in New Issue
Block a user