db-schema

Guides writing Alembic migrations, PostgreSQL queries, and ORM models for the CareerOS database schema.

Updated May 19, 2026
One-click install
npx skills add https://github.com/Jessitoii/career-os --skill db-schema-jessitoii
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: db-schema
Source: https://github.com/Jessitoii/career-os/tree/main/.agents/skills/db-schema
Command: npx skills add https://github.com/Jessitoii/career-os --skill db-schema-jessitoii

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Working on the CareerOS PostgreSQL database requires knowing its exact schema, ENUM values, indexes, and safety rules. This Skill provides a quick reference for core tables, the application_status lifecycle, JSONB querying patterns, and pgvector similarity queries so migrations and queries are written correctly the first time. ## Core Features & Use Cases - Schema Quick Reference: Documents core tables (user_profiles, cv_documents, job_listings, applications, interaction_logs), the application_status ENUM flow, key indexes, and analytical views like cv_performance_stats. - Migration Guidance: Shows the Alembic workflow for autogenerating and applying migrations, plus how to add new PostgreSQL ENUM values safely. - Advanced Query Patterns: Provides ready-to-use examples for JSONB field extraction, funnel analysis queries, and vector similarity search for semantic duplicate detection on job listings. - Use Case: When asked to add a new column to the applications table or write a query measuring interview conversion rates, this Skill supplies the exact table structure, ENUM constraints, and SQL patterns needed. ## Quick Start Ask the AI to write an Alembic migration that adds a new column to the applications table using the project database schema.

Frequently Asked Questions about db-schema

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create an Alembic migration for a new column?

Run alembic revision --autogenerate -m with a descriptive message, review the generated file in alembic/versions/, then apply it with alembic upgrade head. All schema changes must go through Alembic rather than manual ALTER TABLE statements.

How do I query JSONB fields in PostgreSQL?

Use the -> and ->> operators to extract nested JSON values from columns like application_data. The ->> operator returns text while -> returns JSON, so use ->> for scalar values such as cover_letter_path and -> for nested objects like user_answers.

How do I add a new value to a PostgreSQL ENUM type?

Use ALTER TYPE application_status ADD VALUE with the new value and an optional AFTER clause to control ordering. Note that PostgreSQL ENUM additions cannot be rolled back easily, so test on a staging environment first.

How do I find duplicate job listings with vector similarity?

Use the pgvector <-> operator to compute distance between the stored embedding column and a query vector, then filter on a similarity threshold such as 0.95. The job_listings table has an ivfflat index on the embedding column to speed up these searches.

When should I not use this database schema skill?

Do not use it for application business logic that merely touches the database; use the relevant domain skill instead. It is scoped to migrations, schema changes, index work, and analytical query writing on the documented tables.