postgresql-rls-migration

Automate schema-per-tenant migrations across active tenant databases.

1|Updated Apr 17, 2026
One-click install
npx skills add https://github.com/PremModhaOfficial/motadata-ai-pipeline --skill postgresql-rls-migration
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: postgresql-rls-migration
Source: https://github.com/PremModhaOfficial/motadata-ai-pipeline/tree/main/.claude/skills/postgresql-rls-migration
Command: npx skills add https://github.com/PremModhaOfficial/motadata-ai-pipeline --skill postgresql-rls-migration

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Provides a standardized approach to tenant data isolation using a schema-per-tenant model and managed migrations across all tenant databases, including provisioning, onboarding/offboarding, and lifecycle management.

Core Features & Use Cases

  • Tenant provisioning: create and configure per-tenant databases with versioned migrations.
  • Migration orchestration: apply migrations across all active tenant databases using golang-migrate naming conventions.
  • Onboarding/offboarding lifecycle: manage tenant lifecycle including registry, connection management, and deprovisioning.
  • Audit triggers and compliance: implement per-tenant audit logs for SOC2/GDPR requirements.
  • Zero-downtime strategies & rollback: plan migrations with minimal disruption and safe rollbacks.

Quick Start

Run the tenant provisioning and migration workflow to onboard a new tenant and apply migrations across all active tenant schemas.

Frequently Asked Questions about postgresql-rls-migration

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

FAQPage Schema
How do I run zero-downtime PostgreSQL schema migrations across multiple tenants?

Zero-downtime PostgreSQL schema migrations are automated by orchestrating versioned changes across all active tenant schemas using golang-migrate naming conventions, per-tenant connection routing, and safe rollback procedures to ensure minimal service disruption.

What is the best way to onboard a new tenant in a schema-per-tenant PostgreSQL database?

Onboarding a new tenant in a schema-per-tenant PostgreSQL database involves automated provisioning to create and configure the isolated schema, applying versioned migrations, and registering the tenant in the lifecycle management system with per-tenant audit logging.

How does tenant offboarding and deprovisioning work in a multi-tenant PostgreSQL setup?

Tenant offboarding and deprovisioning in a multi-tenant PostgreSQL setup is managed through the lifecycle workflow, which safely removes the tenant registry, terminates connection management, and executes deprovisioning while maintaining audit logs.

Do I need golang-migrate to apply schema-per-tenant migrations?

Yes, the migration orchestration relies on golang-migrate naming conventions to enforce consistent versioning and apply schema changes accurately across all active tenant databases during provisioning and ongoing lifecycle updates.

Can I rollback a failed multi-tenant database migration without downtime?

Rolling back a failed multi-tenant database migration is handled through predefined rollback procedures that safely reverse schema changes per-tenant, ensuring zero-downtime strategies are maintained during the recovery process.