Chore: moving changes - migrating Desktop from nobara 42 to windows(WSL)

This commit is contained in:
2025-11-05 22:29:28 +02:00
parent c086f64363
commit 934d8fc35f
8 changed files with 826 additions and 63 deletions
@@ -0,0 +1,40 @@
"""add_user_approval_system
Revision ID: 4c0d2503877e
Revises: 997376dc1774
Create Date: 2025-09-28 11:55:11.997364
"""
from typing import Sequence, Union
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision: str = '4c0d2503877e'
down_revision: Union[str, Sequence[str], None] = '997376dc1774'
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! ###
# Add column as nullable first
op.add_column('user', sa.Column('is_approved', sa.Boolean(), nullable=True))
# Set default value for existing users - approve all existing users by default
# (they were created before the approval system, so they should be grandfathered in)
op.execute("UPDATE \"user\" SET is_approved = true")
# Make column not nullable
op.alter_column('user', 'is_approved', nullable=False)
# ### end Alembic commands ###
def downgrade() -> None:
"""Downgrade schema."""
# ### commands auto generated by Alembic - please adjust! ###
op.drop_column('user', 'is_approved')
# ### end Alembic commands ###