database-schema

Define version-based identity and latest-row queries for SQLite video schemas.

Updated Nov 5, 2025
One-click install
npx skills add https://github.com/imankha/video-editor --skill database-schema-imankha
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: database-schema
Source: https://github.com/imankha/video-editor/tree/main/src/backend/.claude/skills/database-schema
Command: npx skills add https://github.com/imankha/video-editor --skill database-schema-imankha

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill provides SQLite-based patterns to implement versioned data management for video assets. It helps teams maintain multiple versions of clips and videos while surfacing only the latest in standard views, preventing stale data across the gallery and exports.

Core Features & Use Cases

  • Version-based identity across raw_clips, working_clips, and final_videos to support multi-version workflows.
  • Latest-queries pattern to return one row per logical item, filtering by project while keeping historical records for audits.
  • DDL and schema definitions for raw_clips, working_clips, working_videos, and final_videos, with version columns and FK constraints.
  • Guidance on implementing foreign keys, cascade deletes, and using helper subqueries in app code.
  • Use Case: A project with multiple edits can still display only the most recent frame for a clip in the gallery while maintaining versions.

Quick Start

Review the provided table definitions and the latest query pattern. Apply the version identity rules to your schema, then run the sample queries to fetch the latest versions for a given project.

Frequently Asked Questions about database-schema

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

FAQPage Schema
How do I implement versioned data management for video clips in SQLite?

Implement versioned data management in SQLite by adding version columns and foreign key constraints to tables for raw_clips, working_clips, and videos. This enables multi-version workflows while keeping historical records for audits.

What's the best way to query only the latest version of a clip in a video editor database?

Query the latest version of a clip using a latest-queries pattern that returns one row per logical item. This filters by project to display only the most recent frame in the gallery while maintaining historical versions.

How do I set up foreign key constraints with cascade deletes for SQLite video assets?

Set up foreign key constraints and cascade deletes by applying the provided DDL schema definitions to your SQLite database. The schema includes version columns and FK constraints across working_clips and final_videos tables.

Can I use SQLite latest-row queries to prevent stale data across gallery and export views?

Yes, you can use SQLite latest-row queries to prevent stale data across gallery and exports. The pattern surfaces only the latest version per logical item, ensuring consistent views while retaining historical clip records.

Does this SQLite schema pattern support filtering latest versions by project while keeping historical records?

Yes, the SQLite schema pattern supports filtering latest versions by project. It uses helper subqueries in app code to return the latest row per item while preserving all historical versions for audit purposes.