create-migration
Skill1 starsChanged 4 months agoMITView on GitHub
Generate a Supabase PostgreSQL database migration with proper schema, RLS policies, indexes, triggers, and grants. Follows DaaS naming conventions and includes standard audit columns. Use when the user needs a database migration, table creation, schema change, or wants to add columns to a collection.
2 other projects use a version of this.
Adopted by
Most recently taken up by
- tale-project/taletheir own version, first seen Sep 30, 2026
- euronone/Claude-Code-Templatetheir own version, first seen Mar 10, 2026
Other versions2 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 2
- tale-project/tale★ 31same name
- euronone/Claude-Code-Template★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository59 other files it gives its agents.
- add-buildpadSkill
- add-external-oauthSkill
- add-filesSkill
- add-i18nSkill
- add-microappSkill
- add-microfrontendSkill
- add-microfrontend-zonesSkill
- add-multitenancySkill
- add-usersSkill
- amplify-env-varsSkill
- authentication-proxySkill
- buildpad-debugSkill
- buildpad-discoverySkill
- buildpad-implSkill
- buildpad-referenceSkill
- buildpad-reviewSkill
- buildpad-spec-batchSkill
- buildpad-spec-designSkill
- buildpad-spec-initSkill
- buildpad-spec-quickSkill
- buildpad-spec-requirementsSkill
- buildpad-spec-statusSkill
- buildpad-spec-tasksSkill
- buildpad-steering-customSkill
- buildpad-steeringSkill
- buildpad-validate-designSkill
- buildpad-validate-gapSkill
- buildpad-validate-implSkill
- buildpad-verify-completionSkill
- code-simplificationSkill
- context-engineeringSkill
- create-api-routeSkill
- create-collectionSkill
- create-componentSkill
- create-cronSkill
- create-featureSkill
- create-form-builderSkill
- create-projectSkill
- create-rbacSkill
- create-serviceSkill
- create-testsSkill
- create-workflowSkill
- daas-platformSkill
- debugging-and-error-recoverySkill
- generate-docsSkill
- git-workflow-and-versioningSkill
- grant-module-accessSkill
- hooks-extensionsSkill
- idea-refineSkill
- incremental-implementationSkill
- manage-scopeSkill
- performance-optimizationSkill
- planning-and-task-breakdownSkill
- relational-permissionsSkill
- review-codeSkill
- security-and-hardeningSkill
- spec-driven-developmentSkill
- subagent-delegationSkill
- worker-messagingSkill
The file
Files
Create Database Migration
Generate a Supabase PostgreSQL migration with proper schema, RLS policies, and indexes.
Migration File Location
supabase/migrations/[YYYYMMDDHHMMSS]_[description].sqlNaming Conventions
- Tables:
snake_case, plural (user_profiles,blog_posts) - Columns:
snake_case(date_created,user_id) - Primary keys:
id(UUID) - Foreign keys:
[referenced_table]_id(category_id) - Junction tables:
[table1]_[table2](products_tags)
Standard Columns
id uuid PRIMARY KEY DEFAULT gen_random_uuid(),
date_created timestamptz DEFAULT now(),
date_updated timestamptz,
user_created uuid REFERENCES auth.users(id),
user_updated uuid REFERENCES auth.users(id)Migration Sections (Required)
- Header Comment — description, author, date
- CREATE TABLE — with data types and constraints
- Enable RLS —
ALTER TABLE ... ENABLE ROW LEVEL SECURITY - RLS Policies — SELECT, INSERT, UPDATE, DELETE
- Indexes — FK columns, filtered columns, sorted columns
- Triggers —
date_updatedauto-update, audit logging - GRANT — permissions for
authenticatedandanonroles
Data Types
| Use Case | PostgreSQL Type |
| ID | uuid |
| Short text | text or varchar(n) |
| Long text | text |
| Integer | integer or bigint |
| Decimal | numeric(precision, scale) |
| Boolean | boolean |
| Timestamp | timestamptz |
| JSON | jsonb |
| Array | text[], uuid[] |
| Enum | text with CHECK |
Relationships
One-to-Many
category_id uuid REFERENCES public.categories(id) ON DELETE SET NULLMany-to-Many (junction table)
CREATE TABLE public.products_tags (
id uuid PRIMARY KEY DEFAULT gen_random_uuid(),
products_id uuid NOT NULL REFERENCES public.products(id) ON DELETE CASCADE,
tags_id uuid NOT NULL REFERENCES public.tags(id) ON DELETE CASCADE,
UNIQUE(products_id, tags_id)
);RLS Policy Patterns
-- Owner can CRUD their own
CREATE POLICY "users_own_data" ON public.[table]
FOR ALL USING (auth.uid() = user_created);
-- Published items are public
CREATE POLICY "published_public" ON public.[table]
FOR SELECT USING (status = 'published' OR auth.uid() = user_created);Commands
supabase migration new [description]
supabase db push
supabase db resetReferences
- Special fields
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

