separation of production and development

environments
Adding new migrations for renaming and adding fields
to the database schema
persistent uuid for simclient
This commit is contained in:
2025-07-16 08:50:42 +00:00
parent 84a92ab9c2
commit 1a6faaa104
7 changed files with 116 additions and 12 deletions

View File

@@ -0,0 +1,36 @@
"""Rename location to description in client_groups, add description to clients
Revision ID: 0c47280d3e2d
Revises: 3a09ef909689
Create Date: 2025-07-16 08:47:00.355445
"""
from typing import Sequence, Union
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import mysql
# revision identifiers, used by Alembic.
revision: str = '0c47280d3e2d'
down_revision: Union[str, None] = '3a09ef909689'
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.add_column('client_groups', sa.Column('description', sa.String(length=255), nullable=True))
op.drop_column('client_groups', 'location')
op.add_column('clients', sa.Column('description', sa.String(length=255), nullable=True))
# ### end Alembic commands ###
def downgrade() -> None:
"""Downgrade schema."""
# ### commands auto generated by Alembic - please adjust! ###
op.drop_column('clients', 'description')
op.add_column('client_groups', sa.Column('location', mysql.VARCHAR(length=100), nullable=True))
op.drop_column('client_groups', 'description')
# ### end Alembic commands ###

View File

@@ -0,0 +1,32 @@
"""Add location to client_groups
Revision ID: 3a09ef909689
Revises: 207f5b190f93
Create Date: 2025-07-16 08:36:08.535836
"""
from typing import Sequence, Union
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision: str = '3a09ef909689'
down_revision: Union[str, None] = '207f5b190f93'
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.add_column('client_groups', sa.Column('location', sa.String(length=100), nullable=True))
# ### end Alembic commands ###
def downgrade() -> None:
"""Downgrade schema."""
# ### commands auto generated by Alembic - please adjust! ###
op.drop_column('client_groups', 'location')
# ### end Alembic commands ###