Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add service level #172

Merged
merged 4 commits into from
Nov 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 ###
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
Loading