diff --git a/alembic/versions/0007_attachments.py b/alembic/versions/0007_attachments.py new file mode 100644 index 0000000..f4fa01e --- /dev/null +++ b/alembic/versions/0007_attachments.py @@ -0,0 +1,32 @@ +"""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") diff --git a/frontend/src/components/Icon.vue b/frontend/src/components/Icon.vue index d2fb296..70778fa 100644 --- a/frontend/src/components/Icon.vue +++ b/frontend/src/components/Icon.vue @@ -15,6 +15,7 @@ const paths: Record = { plus: '', check: '', checkbox: '', + image: '', }; diff --git a/frontend/src/components/NoteCard.vue b/frontend/src/components/NoteCard.vue index a2f9b9f..d0f1b5f 100644 --- a/frontend/src/components/NoteCard.vue +++ b/frontend/src/components/NoteCard.vue @@ -19,6 +19,14 @@ function cardClass(color: NoteColor): string { class="group relative mb-4 break-inside-avoid rounded-xl border p-3 shadow-sm transition hover:shadow-md" :class="cardClass(note.color)" > + +