fisioflow-clinical-schema

Implement organizationId-based Row-Level Security in Neon PostgreSQL with Drizzle ORM.

Updated Sep 2, 2025
One-click install
npx skills add https://github.com/rafaelminatto1/fisioflow-51658291 --skill fisioflow-clinical-schema
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: fisioflow-clinical-schema
Source: https://github.com/rafaelminatto1/fisioflow-51658291/tree/main/.agents/skills/fisioflow-clinical-schema
Command: npx skills add https://github.com/rafaelminatto1/fisioflow-51658291 --skill fisioflow-clinical-schema

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Reference for the FisioFlow database schema and multi-tenant RLS conventions. Use when working with Drizzle schema files, table relationships, organization scoping, migrations, or SQL queries.

Core Features & Use Cases

  • Central Drizzle-based schema references and re-exports for all core tables
  • Clear multi-tenant architecture guidelines, including organizationId and RLS policies
  • Helpers and conventions for columns, relationships, and migrations to enforce isolation

Quick Start

Load this reference to begin integrating the FisioFlow multi-tenant schema into your Drizzle setup and Neon PostgreSQL migrations.

Frequently Asked Questions about fisioflow-clinical-schema

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

FAQPage Schema
How do I implement multi-tenant Row-Level Security in PostgreSQL with Drizzle ORM?

Multi-tenant Row-Level Security in PostgreSQL with Drizzle ORM is implemented by defining organizationId-based RLS policies on core tables and setting session variables like app.org_id to enforce strict query-level data isolation.

What is the best way to isolate clinic data in a Neon PostgreSQL multi-tenant schema?

Isolating clinic data in a Neon PostgreSQL multi-tenant schema requires applying organizationId-based Row-Level Security policies to enforce strict data separation at the database level rather than the application level.

Does Drizzle ORM support row-level security policies for multi-tenant applications?

Drizzle ORM supports row-level security policies for multi-tenant applications by allowing schema definitions and migrations that integrate RLS policies using session variables to scope queries by organization.

How do I use session variables to enforce RLS in a multi-tenant database?

To enforce RLS in a multi-tenant database, set session variables like app.org_id during the connection so RLS policies automatically scope queries and restrict data access to the specified organization.

What are the limitations of using organizationId for multi-tenant data isolation in PostgreSQL?

Using organizationId for multi-tenant data isolation requires strict consistency in column conventions and RLS policies across all tables, with carefully managed migrations and relationships to prevent data leakage between organizations.