File size: 884 Bytes
5b570cf
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
901d86f
 
 
 
 
5b570cf
901d86f
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
import uuid

from sqlalchemy import String, Text

from sqlalchemy.orm import (
    Mapped,
    mapped_column
)

from app.models.base import Base


class Document(Base):

    __tablename__ = "documents"

    id: Mapped[str] = mapped_column(
        String,
        primary_key=True,
        default=lambda: str(uuid.uuid4())
    )

    user_id: Mapped[str] = mapped_column(
        String,
        index=True
    )

    filename: Mapped[str] = mapped_column(
        String
    )

    file_path: Mapped[str] = mapped_column(
        String
    )

    status: Mapped[str] = mapped_column(
        String,
        default="uploaded"
    )

    chunking_strategy: Mapped[str | None] = mapped_column(
        String,
        nullable=True
    )

    text_content: Mapped[str | None] = mapped_column(
        Text,
        nullable=True
    )