Plantillas:
organizations5 cols
id
uuid
name
varchar
slug
varchar
plan
varchar
created_at
timestamp
users5 cols
id
uuid
organization_id
uuid
email
varchar
role
varchar
is_active
boolean
subscriptions6 cols
id
uuid
organization_id
uuid
provider_id
varchar
status
varchar
price_cents
int
renews_at?
timestamp
audit_logs5 cols
id
serial
user_id?
uuid
action
varchar
metadata?
jsonb
created_at
timestamp
Arrastra las tablas para organizar el diagrama · Haz clic en una tabla para editar sus columnas
-- Generated by SchemaCost (PostgreSQL 16)
CREATE EXTENSION IF NOT EXISTS "pgcrypto";

CREATE TABLE "organizations" (
  "id" UUID PRIMARY KEY DEFAULT gen_random_uuid(),
  "name" VARCHAR(255) NOT NULL,
  "slug" VARCHAR(255) NOT NULL UNIQUE,
  "plan" VARCHAR(255) NOT NULL DEFAULT 'free',
  "created_at" TIMESTAMPTZ NOT NULL DEFAULT NOW()
);

CREATE TABLE "users" (
  "id" UUID PRIMARY KEY DEFAULT gen_random_uuid(),
  "organization_id" UUID NOT NULL REFERENCES "organizations"("id") ON DELETE CASCADE,
  "email" VARCHAR(255) NOT NULL UNIQUE,
  "role" VARCHAR(255) NOT NULL DEFAULT 'member',
  "is_active" BOOLEAN NOT NULL DEFAULT true
);

CREATE TABLE "subscriptions" (
  "id" UUID PRIMARY KEY DEFAULT gen_random_uuid(),
  "organization_id" UUID NOT NULL UNIQUE REFERENCES "organizations"("id") ON DELETE CASCADE,
  "provider_id" VARCHAR(255) NOT NULL UNIQUE,
  "status" VARCHAR(255) NOT NULL,
  "price_cents" INTEGER NOT NULL,
  "renews_at" TIMESTAMPTZ
);

CREATE TABLE "audit_logs" (
  "id" BIGSERIAL PRIMARY KEY,
  "user_id" UUID REFERENCES "users"("id") ON DELETE SET NULL,
  "action" VARCHAR(255) NOT NULL,
  "metadata" JSONB,
  "created_at" TIMESTAMPTZ NOT NULL DEFAULT NOW()
);

-- Foreign Key Indexes
CREATE INDEX "idx_users_organization_id" ON "users" ("organization_id");
CREATE INDEX "idx_subscriptions_organization_id" ON "subscriptions" ("organization_id");
CREATE INDEX "idx_audit_logs_user_id" ON "audit_logs" ("user_id");

7 objetivos desde 1 diagrama

PostgreSQL 16, Supabase con políticas RLS, MySQL 8, SQLite/D1, Prisma, Drizzle ORM y TypeScript sincronizados al instante.

Starter Kit .ZIP sin servidor

Empaqueta todas tus migraciones, esquemas ORM, tipos y diagrama SVG en un archivo .ZIP generado directamente en tu navegador.

Simulador Cloud de 1K a 200K DAU

Detecta explosiones de lecturas en Firestore o cargos de egress antes de lanzar a producción comparando 6 proveedores reales.

Herramientas especializadas de arquitectura BD y Cloud