Files
Projektarbeit-MYP/backend/migrations/versions/add_waiting_approval.py
Till Tomczak 5f2b3df924 Backend aufgeräumt und Steckdosen-Einschaltfunktion behoben
- TAPO_PASSWORD in .env korrigiert (Agent045)
- Unnötige Verzeichnisse entfernt (node_modules, archiv in backend/, etc.)
- .gitignore erstellt um .env-Dateien zu schützen
- Projektstruktur bereinigt (von 1.5MB auf 186KB reduziert)
- Flask Web UI vollständig funktionsfähig

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-09 00:42:48 +02:00

42 lines
1.5 KiB
Python

"""Add waiting_approval column to job table
Revision ID: add_waiting_approval
Revises: af3faaa3844c
Create Date: 2025-03-12 14:00:00.000000
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'add_waiting_approval'
down_revision = 'af3faaa3844c'
branch_labels = None
depends_on = None
def upgrade():
# Füge die neue Spalte waiting_approval zur job-Tabelle hinzu
with op.batch_alter_table('job', schema=None) as batch_op:
batch_op.add_column(sa.Column('waiting_approval', sa.Integer(), server_default='0', nullable=False))
# SQLite-kompatible Migration für die print_job-Tabelle, falls diese existiert
try:
with op.batch_alter_table('print_job', schema=None) as batch_op:
batch_op.add_column(sa.Column('waiting_approval', sa.Boolean(), server_default='0', nullable=False))
except Exception as e:
print(f"Migration für print_job-Tabelle übersprungen: {e}")
def downgrade():
# Entferne die waiting_approval-Spalte aus der job-Tabelle
with op.batch_alter_table('job', schema=None) as batch_op:
batch_op.drop_column('waiting_approval')
# SQLite-kompatible Migration für die print_job-Tabelle, falls diese existiert
try:
with op.batch_alter_table('print_job', schema=None) as batch_op:
batch_op.drop_column('waiting_approval')
except Exception as e:
print(f"Downgrade für print_job-Tabelle übersprungen: {e}")