Added environments to the database
This commit is contained in:
parent
89987f36b0
commit
7553962f2b
@ -0,0 +1,32 @@
|
||||
"""Added environment assignments to database
|
||||
|
||||
Revision ID: dd573f631ee4
|
||||
Revises: e33744090598
|
||||
Create Date: 2026-02-10 21:47:33.493901
|
||||
|
||||
"""
|
||||
from typing import Sequence, Union
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision: str = 'dd573f631ee4'
|
||||
down_revision: Union[str, Sequence[str], None] = 'e33744090598'
|
||||
branch_labels: Union[str, Sequence[str], None] = None
|
||||
depends_on: Union[str, Sequence[str], None] = None
|
||||
|
||||
|
||||
def upgrade() -> None:
|
||||
"""Upgrade schema."""
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
pass
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade() -> None:
|
||||
"""Downgrade schema."""
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
pass
|
||||
# ### end Alembic commands ###
|
||||
@ -15,6 +15,17 @@ class Environment(Base):
|
||||
)
|
||||
|
||||
|
||||
class EnvironmentAssignment(Base):
|
||||
__tablename__ = "pillar_tool_environment_assignment"
|
||||
|
||||
environment_id = Column(UUID, ForeignKey("pillar_tool_environment.id"), nullable=False)
|
||||
host_id = Column(UUID, ForeignKey("pillar_tool_host.id"), nullable=False)
|
||||
|
||||
__table_args__ = (
|
||||
UniqueConstraint('environment_id', 'host_id', name="pillar_tool_unique_environment_assignment")
|
||||
)
|
||||
|
||||
|
||||
class State(Base):
|
||||
__tablename__ = "pillar_tool_state"
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user