Initial curated RAGcore source from c16667f0c9397e2bfc8dd0255b114fba23c8d05e
This commit is contained in:
commit
7ca726caf2
659 files changed
+98171
No files matched your search
@@ -0,0 +1,41 @@
|
||||
"""Associate documents with the knowledge space they were ingested into.
|
||||
|
||||
No production row exists yet (ingestion was never wired to a worker handler
|
||||
until this change), so this adds the column as NOT NULL directly rather than
|
||||
nullable-then-backfill-then-constrain: there is nothing to backfill.
|
||||
|
||||
Deliberately no FK to control.spaces: content.documents.workspace_id already
|
||||
has no FK to control.workspaces (control and content are separate bounded
|
||||
contexts in this schema, and cross-schema FKs have no other precedent in
|
||||
this codebase), so space_id follows the same established convention --
|
||||
indexed, not foreign-key-enforced.
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import sqlalchemy as sa
|
||||
from alembic import op
|
||||
|
||||
revision = "0014_document_space"
|
||||
down_revision = "0013_generation_profiles"
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade() -> None:
|
||||
op.add_column(
|
||||
"documents",
|
||||
sa.Column("space_id", sa.Uuid(), nullable=False),
|
||||
schema="content",
|
||||
)
|
||||
op.create_index(
|
||||
"ix_content_documents_space",
|
||||
"documents",
|
||||
["space_id"],
|
||||
schema="content",
|
||||
)
|
||||
|
||||
|
||||
def downgrade() -> None:
|
||||
op.drop_index("ix_content_documents_space", table_name="documents", schema="content")
|
||||
op.drop_column("documents", "space_id", schema="content")
|
||||
Reference in new issue
Block a user