Help us improve
Share bugs, ideas, or general feedback.
From gitchain-supabase
Set up or migrate GitChain schema on Supabase PostgreSQL
npx claudepluginhub c-0711/0711-tools --plugin gitchain-supabaseHow this skill is triggered — by the user, by Claude, or both
Slash command
/gitchain-supabase:migrateThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Create or migrate the GitChain database schema on a Supabase PostgreSQL instance.
Guides Supabase CLI migrations: npx supabase migration new, zero-downtime schema changes, data backfills, versioning, rollbacks, and TypeScript type generation. For production DB updates without downtime.
Manages Supabase Postgres databases via CLI: migrations, Edge Functions deployment, local development setup, and project debugging.
Guides Supabase CLI for local dev setup, DB migrations/diffs/resets, edge functions serve/deploy, secrets, and TypeScript code gen.
Share bugs, ideas, or general feedback.
Create or migrate the GitChain database schema on a Supabase PostgreSQL instance.
$ARGUMENTS for action:
init — Create full schema from scratchmigrate — Apply incremental migrationstatus — Show current schema version-- Core containers table
CREATE TABLE containers (
id TEXT PRIMARY KEY,
namespace TEXT NOT NULL,
identifier TEXT NOT NULL,
type TEXT NOT NULL DEFAULT 'product',
version INTEGER NOT NULL DEFAULT 1,
data JSONB NOT NULL,
hash TEXT NOT NULL,
message TEXT,
visibility TEXT DEFAULT 'public',
created_at TIMESTAMPTZ DEFAULT NOW(),
updated_at TIMESTAMPTZ DEFAULT NOW(),
UNIQUE(namespace, identifier, version)
);
-- Full-text search
CREATE INDEX idx_containers_search ON containers
USING GIN (to_tsvector('english', data::text));
CREATE INDEX idx_containers_namespace ON containers(namespace);
CREATE INDEX idx_containers_type ON containers(type);
-- Agent contexts
CREATE TABLE agent_contexts (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
container_id TEXT REFERENCES containers(id),
agent_id TEXT NOT NULL,
project TEXT,
summary TEXT,
decisions JSONB,
tasks JSONB,
learnings JSONB,
tags TEXT[],
created_at TIMESTAMPTZ DEFAULT NOW()
);
-- Row Level Security
ALTER TABLE containers ENABLE ROW LEVEL SECURITY;
CREATE POLICY "Public read" ON containers FOR SELECT USING (visibility = 'public');
CREATE POLICY "Auth write" ON containers FOR INSERT WITH CHECK (auth.role() = 'authenticated');
# Supabase Migration: [action]
## Applied
| Migration | Tables | Indexes | Policies |
|-----------|--------|---------|----------|
| init_v1 | 2 | 3 | 2 |
## Schema Status
- Tables: containers, agent_contexts
- Containers: [count]
- RLS: ✅ enabled
- Version: [X]