mirror of
https://github.com/Monadical-SAS/reflector.git
synced 2025-12-21 12:49:06 +00:00
feat: update ics, first version working
This commit is contained in:
@@ -0,0 +1,46 @@
|
||||
"""add_ics_uid_to_calendar_event
|
||||
|
||||
Revision ID: a256772ef058
|
||||
Revises: d4a1c446458c
|
||||
Create Date: 2025-08-19 09:27:26.472456
|
||||
|
||||
"""
|
||||
|
||||
from typing import Sequence, Union
|
||||
|
||||
import sqlalchemy as sa
|
||||
from alembic import op
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision: str = "a256772ef058"
|
||||
down_revision: Union[str, None] = "d4a1c446458c"
|
||||
branch_labels: Union[str, Sequence[str], None] = None
|
||||
depends_on: Union[str, Sequence[str], None] = None
|
||||
|
||||
|
||||
def upgrade() -> None:
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
with op.batch_alter_table("calendar_event", schema=None) as batch_op:
|
||||
batch_op.add_column(sa.Column("ics_uid", sa.Text(), nullable=False))
|
||||
batch_op.drop_constraint(batch_op.f("uq_room_calendar_event"), type_="unique")
|
||||
batch_op.create_unique_constraint(
|
||||
"uq_room_calendar_event", ["room_id", "ics_uid"]
|
||||
)
|
||||
batch_op.drop_column("external_id")
|
||||
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade() -> None:
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
with op.batch_alter_table("calendar_event", schema=None) as batch_op:
|
||||
batch_op.add_column(
|
||||
sa.Column("external_id", sa.TEXT(), autoincrement=False, nullable=True)
|
||||
)
|
||||
batch_op.drop_constraint("uq_room_calendar_event", type_="unique")
|
||||
batch_op.create_unique_constraint(
|
||||
batch_op.f("uq_room_calendar_event"), ["room_id", "external_id"]
|
||||
)
|
||||
batch_op.drop_column("ics_uid")
|
||||
|
||||
# ### end Alembic commands ###
|
||||
Reference in New Issue
Block a user