db-verify-order

Validate DDL statement execution order in SQL migration files.

3|Updated Feb 7, 2026
One-click install
npx skills add https://github.com/GDSDN/kord-aios --skill db-verify-order
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: db-verify-order
Source: https://github.com/GDSDN/kord-aios/tree/main/src/features/builtin-skills/kord-aios/database/db-verify-order
Command: npx skills add https://github.com/GDSDN/kord-aios --skill db-verify-order

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill prevents database migration failures caused by incorrect ordering of Data Definition Language (DDL) statements, ensuring data integrity and smooth deployments.

Core Features & Use Cases

  • DDL Linting: Analyzes SQL migration files to identify potential dependency errors between DDL statements (tables, functions, triggers, views, RLS).
  • Heuristic Checks: Applies rules to detect common ordering problems like functions before tables or RLS before table creation.
  • Use Case: Before applying a complex database schema change, run this Skill to automatically flag any statements that might fail due to unmet dependencies, saving hours of debugging and preventing partial schema states.

Quick Start

Use the db-verify-order skill to check the DDL ordering in the file 'schema-v2.sql'.

Frequently Asked Questions about db-verify-order

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

FAQPage Schema
How do I validate DDL statement ordering in SQL migration files?

To validate DDL statement ordering in SQL migration files, analyze the execution sequence of CREATE EXTENSION, CREATE TABLE, CREATE FUNCTION, CREATE TRIGGER, RLS policies, and CREATE VIEW statements to identify unmet dependencies before database application.

Why does my database migration fail when creating triggers or views?

Database migrations fail when creating triggers or views if preceding dependencies like base tables or functions are not yet created, making correct DDL execution ordering critical to prevent partial schema states and dependency errors.

What is the best way to check for dependency errors before applying schema changes?

The best way to check for dependency errors before applying schema changes is to apply heuristic checks to SQL migration files, flagging potential ordering issues like functions defined before tables or RLS policies before table creation.

Can I detect Row Level Security policy ordering issues in SQL scripts?

Yes, you can detect Row Level Security policy ordering issues by analyzing SQL scripts to ensure RLS policies are not created before their target tables, preventing deployment failures caused by incorrect DDL sequencing.

How do I prevent partial schema states during complex database migrations?

Prevent partial schema states during complex database migrations by validating the execution order of DDL statements beforehand, ensuring tables, extensions, functions, triggers, and views are sequenced correctly to avoid unmet dependencies.