infra/sql/0001_init.sql
Metadata
- Purpose: SQL migration or seed data script for persistent storage.
- Domain:
infrastructure - Language:
sql - Bytes: 4800
- Lines: 131
- Content hash (short):
5851b3f4 - Source (start): infra/sql/0001_init.sql:1
- Source (end): infra/sql/0001_init.sql:131
Indexed Symbols
No indexed functions/methods detected in this file.
Markdown Headings (if applicable)
No markdown headings detected.
Source Preview
-- Anchor MSP PSA baseline schema
-- Workspace-per-client isolation: every row includes workspace_id and is policy-scoped.
create extension if not exists pgcrypto;
create table if not exists workspaces (
id uuid primary key default gen_random_uuid(),
name text not null,
slug text not null unique,
created_at timestamptz not null default now(),
updated_at timestamptz not null default now()
);
create table if not exists clients (
id uuid primary key default gen_random_uuid(),
workspace_id uuid not null references workspaces(id) on delete cascade,
name text not null,
status text not null,
tier text not null,
created_at timestamptz not null default now(),
updated_at timestamptz not null default now()
);
create table if not exists contacts (
id uuid primary key default gen_random_uuid(),