Skip to content

Commit

Permalink
make both category and protocol a list strings
Browse files Browse the repository at this point in the history
  • Loading branch information
andersy005 committed Sep 18, 2023
1 parent 88320e9 commit d8e75a1
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 4 deletions.
12 changes: 8 additions & 4 deletions carbonplan_offsets_db/models.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import datetime

import pydantic
from sqlalchemy import BigInteger, Column
from sqlmodel import Field, Relationship, SQLModel
from sqlalchemy.dialects import postgresql
from sqlmodel import BigInteger, Column, Field, Relationship, SQLModel, String

from .schemas import FileCategory, FileStatus, Pagination

Expand Down Expand Up @@ -32,8 +32,12 @@ class ProjectBase(SQLModel):
name: str | None = Field(description='Name of the project')
registry: str = Field(description='Name of the registry')
proponent: str | None
protocol: str | None
category: str | None
protocol: list[str] | None = Field(
description='List of protocols', default=None, sa_column=Column(postgresql.ARRAY(String()))
)
category: list[str] | None = Field(
description='List of categories', default=None, sa_column=Column(postgresql.ARRAY(String()))
)
developer: str | None
voluntary_status: str | None
country: str | None
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
"""make both category and protocol a list strings
Revision ID: d2bc99dedcf6
Revises: e0c9ea45fc91
Create Date: 2023-09-18 06:52:14.701020
"""


# revision identifiers, used by Alembic.
revision = 'd2bc99dedcf6'
down_revision = 'e0c9ea45fc91'
branch_labels = None
depends_on = None


def upgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
pass
# ### end Alembic commands ###


def downgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
pass
# ### end Alembic commands ###

0 comments on commit d8e75a1

Please sign in to comment.