Skip to content

Conversation

robertjdominguez
Copy link
Collaborator

Description

Database schema migration from docs_bot to pql-bot namespace with relationship cleanup.

  • Standardized database naming across all components
  • Removed broken relationships between doc tables
  • Updated connection strings and schema references

Previously, the project used inconsistent naming with docs_bot in some places and pql-bot in others:

DATABASE_URL=postgresql://docs:password@localhost:5432/docs_bot
INSERT INTO docs_bot.doc_content (page_url, title, description, keywords, content, is_checked)

Now everything uses the consistent pql-bot namespace:

DATABASE_URL=postgresql://docs:password@localhost:5432/pql-bot
INSERT INTO pql-bot.doc_content (page_url, title, description, keywords, content, is_checked)

The migration also cleaned up problematic relationships in the PromptQL metadata that were causing schema conflicts. The content and embeddings relationships between doc_chunk and doc_content tables were removed since they were mapping on page_url instead of proper foreign keys, which could cause data integrity issues.

This creates a cleaner, more maintainable database schema with consistent naming throughout the entire stack.

Copy link

github-actions bot commented Aug 3, 2025

🚀 PromptQL Build Complete

Build Version: 922ebd5989
Project: pql-docs
PromptQL Playground: Open Playground

Description: PR #32: Chore: Update docs and rebuild metadata

@robertjdominguez robertjdominguez merged commit 3856a7e into main Aug 3, 2025
1 check passed
@robertjdominguez robertjdominguez deleted the rob/chore/update-docs-and-rebuild-metadata branch August 3, 2025 23:09
Copy link

github-actions bot commented Aug 3, 2025

✅ PromptQL Build Applied

Build Version: 922ebd5989
Status: Successfully applied to production
Applied at: 2025-08-03T23:09:42.565Z

robertjdominguez added a commit that referenced this pull request Aug 10, 2025
## Description

Database schema migration from `docs_bot` to `pql-bot` namespace with
relationship cleanup.

- Standardized database naming across all components
- Removed broken relationships between doc tables
- Updated connection strings and schema references

Previously, the project used inconsistent naming with `docs_bot` in some
places and `pql-bot` in others:

```` path=db/.env.template mode=EXCERPT
DATABASE_URL=postgresql://docs:password@localhost:5432/docs_bot
````

````typescript path=db/seed.ts mode=EXCERPT
INSERT INTO docs_bot.doc_content (page_url, title, description, keywords, content, is_checked)
````

Now everything uses the consistent `pql-bot` namespace:

```` path=db/.env.template mode=EDIT
DATABASE_URL=postgresql://docs:password@localhost:5432/pql-bot
````

````typescript path=db/seed.ts mode=EDIT
INSERT INTO pql-bot.doc_content (page_url, title, description, keywords, content, is_checked)
````

The migration also cleaned up problematic relationships in the PromptQL
metadata that were causing schema conflicts. The `content` and
`embeddings` relationships between `doc_chunk` and `doc_content` tables
were removed since they were mapping on `page_url` instead of proper
foreign keys, which could cause data integrity issues.

This creates a cleaner, more maintainable database schema with
consistent naming throughout the entire stack.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant