pg-table-template

Community

Standardize multi-tenant Postgres table templates.

AuthorPremModhaOfficial
Version1.0.0
Installs0

System Documentation

What problem does it solve?

PostgreSQL 18 standard table DDL template and indexing strategy for a schema-per-tenant SaaS platform. It provides a consistent base for creating domain tables, ensures mandatory auditing columns, soft delete, optimistic locking, and explicit schema-prefix DDL to support per-tenant migrations without cross-tenant FK constraints.

Core Features & Use Cases

  • Standard Table Template: base CREATE TABLE pattern with :schema placeholders, including common columns like id, created_at, updated_at, is_deleted, and version, plus guidance to avoid foreign keys enforced at the DB level.
  • Indexing Strategy: partial indexes (WHERE is_deleted = false), CONCURRENTLY index creation, B-tree indexes for typical filters, GIN indexes on JSONB, and support for generated full-text search vectors.
  • Partitioning & Auditing: guidance to partition large tables and maintain audit trails with predictable partition schemes.
  • Soft Delete & Concurrency: standardized soft-delete workflow and optimistic locking to prevent lost updates.

Quick Start

Use the Standard Table Template to create a new tenant table by replacing :schema with your tenant schema and providing a real table name.

Dependency Matrix

Required Modules

None required

Components

Standard package

💻 Claude Code Installation

Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.

Please help me install this Skill:
Name: pg-table-template
Download link: https://github.com/PremModhaOfficial/motadata-ai-pipeline/archive/main.zip#pg-table-template

Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
View Source Repository

Agent Skills Search Helper

Install a tiny helper to your Agent, search and equip skill from 471,000+ vetted skills library on demand.