"""Add caldav_uid and color columns to events table."""

from alembic import op

revision = "0029"
down_revision = "0028"


def upgrade() -> None:
    op.execute("""
        ALTER TABLE events
            ADD COLUMN IF NOT EXISTS caldav_uid TEXT DEFAULT '',
            ADD COLUMN IF NOT EXISTS color TEXT DEFAULT ''
    """)


def downgrade() -> None:
    op.execute("ALTER TABLE events DROP COLUMN IF EXISTS color")
    op.execute("ALTER TABLE events DROP COLUMN IF EXISTS caldav_uid")
