"""note_attachments Revision ID: 0007 Revises: 0006 Create Date: 2026-07-20 """ from alembic import op import sqlalchemy as sa from sqlalchemy.dialects.postgresql import UUID revision = "0007" down_revision = "0006" branch_labels = None depends_on = None def upgrade() -> None: op.create_table( "note_attachments", sa.Column("id", UUID(as_uuid=True), primary_key=True), sa.Column("note_id", UUID(as_uuid=True), sa.ForeignKey("notes.id", ondelete="CASCADE"), nullable=False), sa.Column("path", sa.Text(), nullable=False), sa.Column("mime", sa.Text(), nullable=False), sa.Column("size", sa.BigInteger(), nullable=False), sa.Column("created_at", sa.DateTime(timezone=True), nullable=False, server_default=sa.func.now()), ) op.create_index("ix_note_attachments_note", "note_attachments", ["note_id"]) def downgrade() -> None: op.drop_index("ix_note_attachments_note", table_name="note_attachments") op.drop_table("note_attachments")