Skip to content

Commit 34b242d

Browse files
fix: make json_url nullable
1 parent c30ac65 commit 34b242d

File tree

2 files changed

+32
-1
lines changed

2 files changed

+32
-1
lines changed
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
"""allow nullable json_url
2+
3+
Revision ID: 3499656b84e7
4+
Revises: 084c39bf418e
5+
Create Date: 2025-02-11 16:44:30.550413
6+
7+
"""
8+
9+
from typing import Sequence, Union
10+
11+
from alembic import op
12+
import sqlalchemy as sa
13+
14+
15+
# revision identifiers, used by Alembic.
16+
revision: str = "3499656b84e7"
17+
down_revision: Union[str, None] = "084c39bf418e"
18+
branch_labels: Union[str, Sequence[str], None] = None
19+
depends_on: Union[str, Sequence[str], None] = None
20+
21+
22+
def upgrade() -> None:
23+
# ### commands auto generated by Alembic - please adjust! ###
24+
op.alter_column("dataset", "json_url", existing_type=sa.VARCHAR(), nullable=True)
25+
# ### end Alembic commands ###
26+
27+
28+
def downgrade() -> None:
29+
# ### commands auto generated by Alembic - please adjust! ###
30+
op.alter_column("dataset", "json_url", existing_type=sa.VARCHAR(), nullable=False)
31+
# ### end Alembic commands ###

oc4ids_datastore_pipeline/database.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class Dataset(Base):
3030
publisher_name: Mapped[str] = mapped_column(String)
3131
license_url: Mapped[Optional[str]] = mapped_column(String, nullable=True)
3232
license_name: Mapped[Optional[str]] = mapped_column(String, nullable=True)
33-
json_url: Mapped[str] = mapped_column(String)
33+
json_url: Mapped[str] = mapped_column(String, nullable=True)
3434
csv_url: Mapped[Optional[str]] = mapped_column(String, nullable=True)
3535
xlsx_url: Mapped[Optional[str]] = mapped_column(String, nullable=True)
3636
updated_at: Mapped[datetime.datetime] = mapped_column(DateTime(timezone=True))

0 commit comments

Comments
 (0)