ur_ingest_session_imap_acct_folder_message

Column Type PK Required Default
ur_ingest_session_imap_acct_folder_message_id VARCHAR Yes Yes
ingest_session_id VARCHAR No Yes
ingest_imap_acct_folder_id VARCHAR No Yes
message TEXT No Yes
message_id TEXT No Yes
subject TEXT No Yes
from TEXT No Yes
cc TEXT No Yes
bcc TEXT No Yes
status TEXT[] No Yes
date DATE No No
email_references TEXT No Yes
created_at TIMESTAMPTZ No No CURRENT_TIMESTAMP
created_by TEXT No No 'UNKNOWN'
updated_at TIMESTAMPTZ No No
updated_by TEXT No No
deleted_at TIMESTAMPTZ No No
deleted_by TEXT No No
activity_log TEXT No No

Foreign Keys

Column Name Foreign Key
ingest_imap_acct_folder_id ingest_imap_acct_folder_id references ur_ingest_session_imap_acct_folder.ur_ingest_session_imap_acct_folder_id
ingest_session_id ingest_session_id references ur_ingest_session.ur_ingest_session_id

Indexes

Column Name Index Name
ingest_session_id idx_ur_ingest_session_imap_acct_folder_message__ingest_session_id
message sqlite_autoindex_ur_ingest_session_imap_acct_folder_message_2
message_id sqlite_autoindex_ur_ingest_session_imap_acct_folder_message_2
ur_ingest_session_imap_acct_folder_message_id sqlite_autoindex_ur_ingest_session_imap_acct_folder_message_1

SQL DDL

CREATE TABLE "ur_ingest_session_imap_acct_folder_message" (
    "ur_ingest_session_imap_acct_folder_message_id" VARCHAR PRIMARY KEY NOT NULL,
    "ingest_session_id" VARCHAR NOT NULL,
    "ingest_imap_acct_folder_id" VARCHAR NOT NULL,
    "message" TEXT NOT NULL,
    "message_id" TEXT NOT NULL,
    "subject" TEXT NOT NULL,
    "from" TEXT NOT NULL,
    "cc" TEXT CHECK(json_valid(cc)) NOT NULL,
    "bcc" TEXT CHECK(json_valid(bcc)) NOT NULL,
    "status" TEXT[] NOT NULL,
    "date" DATE,
    "email_references" TEXT CHECK(json_valid(email_references)) NOT NULL,
    "created_at" TIMESTAMPTZ DEFAULT CURRENT_TIMESTAMP,
    "created_by" TEXT DEFAULT 'UNKNOWN',
    "updated_at" TIMESTAMPTZ,
    "updated_by" TEXT,
    "deleted_at" TIMESTAMPTZ,
    "deleted_by" TEXT,
    "activity_log" TEXT,
    FOREIGN KEY("ingest_session_id") REFERENCES "ur_ingest_session"("ur_ingest_session_id"),
    FOREIGN KEY("ingest_imap_acct_folder_id") REFERENCES "ur_ingest_session_imap_acct_folder"("ur_ingest_session_imap_acct_folder_id"),
    UNIQUE("message", "message_id")
)