Removed id column from StateAssignment table
This commit is contained in:
parent
de06702e1a
commit
67f2694dc5
@ -0,0 +1,32 @@
|
||||
"""remove id from env_assign
|
||||
|
||||
Revision ID: d3406fae0ecf
|
||||
Revises: 9ebc4cadee1c
|
||||
Create Date: 2026-04-25 11:33:59.955287
|
||||
|
||||
"""
|
||||
from typing import Sequence, Union
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision: str = 'd3406fae0ecf'
|
||||
down_revision: Union[str, Sequence[str], None] = '9ebc4cadee1c'
|
||||
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! ###
|
||||
op.drop_column('pillar_tool_state_assignment', 'id')
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade() -> None:
|
||||
"""Downgrade schema."""
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.add_column('pillar_tool_state_assignment', sa.Column('id', sa.UUID(), autoincrement=False, nullable=False))
|
||||
# ### end Alembic commands ###
|
||||
@ -40,9 +40,8 @@ class State(Base):
|
||||
class StateAssignment(Base):
|
||||
__tablename__ = "pillar_tool_state_assignment"
|
||||
|
||||
id = Column(UUID, primary_key=True, default=uuid.uuid4)
|
||||
environment_id = Column(UUID, ForeignKey("pillar_tool_environment.id"), nullable=False)
|
||||
state_id = Column(UUID, ForeignKey("pillar_tool_state.id"), nullable=False)
|
||||
environment_id = Column(UUID, ForeignKey("pillar_tool_environment.id"), nullable=False, primary_key=True)
|
||||
state_id = Column(UUID, ForeignKey("pillar_tool_state.id"), nullable=False, primary_key=True)
|
||||
|
||||
__table_args__ = (
|
||||
UniqueConstraint('environment_id', 'state_id', name="pillar_tool_state_assignment_unique_env_state_host"),
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user