erp-db-migration

Generate Supabase database migration SQL for the CIC ERP system.

Updated Jan 26, 2026
One-click install
npx skills add https://github.com/anhnq-lab/cic-erp-contract --skill erp-db-migration
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: erp-db-migration
Source: https://github.com/anhnq-lab/cic-erp-contract/tree/main/.agent/skills/erp-db-migration
Command: npx skills add https://github.com/anhnq-lab/cic-erp-contract --skill erp-db-migration

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill streamlines the process of managing database schema changes for the CIC ERP system, ensuring consistency and adherence to project standards.

Core Features & Use Cases

  • SQL Generation: Creates SQL scripts for new tables, column alterations, RLS policies, and RPC functions.
  • Idempotency: Utilizes IF NOT EXISTS and IF EXISTS for safe, repeatable operations.
  • Use Case: When adding a new products table with specific RLS policies and indexes, this Skill can generate the necessary SQL, ensuring all requirements are met.

Quick Start

Generate a new table SQL script for the 'products' table with columns 'id', 'name', and 'price'.

Frequently Asked Questions about erp-db-migration

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

FAQPage Schema
How do I generate Supabase database migrations with proper RLS policies and indexes?

You generate Supabase database migrations by creating SQL scripts that include row level security policies, indexes, and triggers. This ensures schema changes for the CIC ERP system adhere to project naming conventions and consistency standards.

Can I create idempotent SQL scripts for Supabase column alterations?

Yes, you can create idempotent SQL scripts for Supabase column alterations. The generated migrations use IF NOT EXISTS and IF EXISTS conditions to ensure safe, repeatable database operations without causing errors on reapplication.

What is the best way to manage Supabase RPC functions and RLS policies for an ERP system?

The best way to manage Supabase RPC functions and RLS policies for an ERP system is to generate dedicated SQL migration scripts. This enforces project naming conventions and ensures database schema consistency across new tables and column alterations.

Does this approach support adding new tables with specific row level security requirements?

Yes, this approach supports adding new tables with specific row level security requirements. You can generate the necessary SQL to create tables, define RLS policies, and add indexes, ensuring all structural and security requirements are met.

Why do my database migrations fail when reapplying schema changes to Supabase?

Database migrations often fail when reapplying schema changes to Supabase due to non-idempotent SQL. Using IF NOT EXISTS and IF EXISTS in your migration scripts prevents these errors by allowing safe, repeatable operations.