Skip to content

Commit

Permalink
Merge branch 'main' into topic/165-alembic-test-setup
Browse files Browse the repository at this point in the history
  • Loading branch information
peterdudfield authored Nov 19, 2024
2 parents 9d59a51 + 2a79d67 commit 0f9925a
Show file tree
Hide file tree
Showing 6 changed files with 45 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 1.0.42
current_version = 1.0.43
commit = True
tag = True
message = Bump version: {current_version} → {new_version} [ci skip]
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ classDiagram
class SiteGroupSQL{
+ site_group_uuid : UUID ≪ PK ≫
+ site_group_name : String(255) ≪ U ≫
+ service_level : Integer ≪ U ≫
}
class SiteGroupSiteSQL{
Expand Down
36 changes: 36 additions & 0 deletions alembic/versions/ea0672033541_add_service_level_to_site_group.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
"""Add service level to site group
Revision ID: ea0672033541
Revises: 31d501a0aa52
Create Date: 2024-11-18 13:29:03.441894
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql

# revision identifiers, used by Alembic.
revision = "ea0672033541"
down_revision = "31d501a0aa52"
branch_labels = None
depends_on = None


def upgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
op.add_column(
"site_groups",
sa.Column(
"service_level",
sa.Integer(),
nullable=True,
comment="The service level of the site group. 0 is free1 is paid",
),
)
# ### end Alembic commands ###


def downgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
op.drop_column("site_groups", "service_level")
# ### end Alembic commands ###
2 changes: 1 addition & 1 deletion pvsite_datamodel/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@
UserSQL,
)

__version__ = "1.0.42"
__version__ = "1.0.43"
5 changes: 5 additions & 0 deletions pvsite_datamodel/sqlmodels.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,11 @@ class SiteGroupSQL(Base, CreatedMixin):

site_group_uuid = sa.Column(UUID(as_uuid=True), default=uuid.uuid4, primary_key=True)
site_group_name = sa.Column(sa.String(255), index=True, unique=True)
service_level = sa.Column(
sa.Integer,
default=0,
comment="The service level of the site group. 0 is free, 1 is paid.",
)

# Relationships
# N-N
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

[tool.poetry]
name = "pvsite-datamodel"
version = "1.0.42"
version = "1.0.43"
description = "SDK for interacting with the PVSite database"
authors = ["Open Climate Fix"]
readme = "README.md"
Expand Down

0 comments on commit 0f9925a

Please sign in to comment.