database-migrations

Generate PostgreSQL migration files with TIMESTAMPTZ, TEXT IDs, and RLS policies.

3|Updated Jan 3, 2026
One-click install
npx skills add https://github.com/NextSpark-js/nextspark --skill database-migrations-nextspark-js
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: database-migrations
Source: https://github.com/NextSpark-js/nextspark/tree/main/.claude/skills/database-migrations
Command: npx skills add https://github.com/NextSpark-js/nextspark --skill database-migrations-nextspark-js

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill provides a standardized and secure approach to managing PostgreSQL database schema changes, ensuring data integrity and consistency.

Core Features & Use Cases

  • Standardized Migrations: Enforces strict naming conventions, field ordering, and data types (TIMESTAMPTZ, TEXT for IDs).
  • Security & Access Control: Integrates with Better Auth for RLS policies and uses get_auth_user_id().
  • Data Generation: Includes scripts to generate sample data for testing and development.
  • Use Case: When adding a new feature that requires a new database table, use this Skill to generate the migration file following all best practices, including RLS and proper field types.

Quick Start

Use the database-migrations skill to create a new migration file for the 'users' entity.

Frequently Asked Questions about database-migrations

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

FAQPage Schema
How do I create PostgreSQL migrations with secure RLS policies?

To create PostgreSQL migrations with secure RLS policies, enforce strict conventions like TIMESTAMPTZ and TEXT IDs, and integrate with Better Auth using the get_auth_user_id() function for row-level security.

What are the best practices for PostgreSQL schema field ordering and data types?

Best practices for PostgreSQL schema field ordering and data types mandate using TIMESTAMPTZ for timestamps and TEXT for IDs, following strict conventions to ensure database data integrity and consistency.

How do I generate sample data for testing a new database schema?

You can generate sample data for testing a new database schema by running included validation scripts, which populate your PostgreSQL database with mock records for robust development workflows.

Can I use Better Auth to manage row-level security in PostgreSQL?

Yes, you can use Better Auth to manage row-level security in PostgreSQL by integrating it directly into your schema migrations and enforcing access control through the get_auth_user_id() function.

Does this database migration approach enforce specific SQL naming conventions?

Yes, this database migration approach enforces specific SQL naming conventions and strict field ordering to standardize PostgreSQL schema changes and maintain structural consistency across migrations.