database-migration
创建安全的 Supabase 迁移
当 schema 变更与 RLS 策略发生偏移时,数据库迁移可能会破坏租户隔离。此技能为 Claude、Codex 和 Claude Code 提供可重复的 Supabase 迁移工作流。
安装前请停下并请求确认。
请审查安装计划,并在更改文件前获得用户明确同意。
使用我的智能体安装
将此请求复制给你的智能体,其中包含权威 Skill 页面和清单。
Review the Skillstore skill "database-migration" from https://skillstore.io/skills/cleanexpo-database-migration.md and its manifest at https://skillstore.io/api/skills/cleanexpo-database-migration/manifest. Verify the artifact. Stop and obtain explicit user consent before installing or changing files.你的智能体仍应展示其计划,并按安全策略请求必要确认。
Agent 可读资源
当 AI Agent、爬虫或脚本需要干净上下文,而不是读取完整页面时,请使用这些链接。
测试它
正在使用“database-migration”。 添加一个租户范围的 agent 注册表。
预期结果:
- 带时间戳的迁移文件名。
- 表、索引和约束计划。
- 工作区隔离和 RLS 策略说明。
- 应用迁移前的审查清单。
正在使用“database-migration”。 审查一个向工作区表添加策略的迁移。
预期结果:
该技能会在仪表板执行前识别缺失的工作区索引、不安全的宽泛策略以及所需的验证步骤。
正在使用“database-migration”。 创建一个 enum 和触发器迁移计划。
预期结果:
该技能会概述幂等 enum 处理、触发器替换步骤、注释和语法测试提醒。
安全审计
高风险Static findings for backtick execution and reconnaissance are false positives caused by Markdown formatting and SQL examples. The skill has one real semantic risk: an example system RLS policy grants unrestricted access without role scoping.
已确认安全问题 (1)
风险因素
⚙️ 外部命令 (27)
分享与引用此报告
分享版本化评估报告、中性徽章、嵌入卡片和引用。Skillstore 只报告证据,不判断该 Skill 是否安全。
复制报告链接
https://skillstore.io/skills/cleanexpo-database-migration/audits/8?utm_source=security_passport&utm_medium=share&utm_campaign=versioned_reportMarkdown 徽章
[](https://skillstore.io/skills/cleanexpo-database-migration?utm_source=security_passport_badge)HTML 徽章
<a href="https://skillstore.io/skills/cleanexpo-database-migration?utm_source=security_passport_badge"><img src="https://skillstore.io/badges/skills/cleanexpo-database-migration/security.svg" alt="Skillstore security assessment" loading="lazy"></a>嵌入卡片
<iframe src="https://skillstore.io/embed/skills/cleanexpo-database-migration.html" title="Skillstore Security Assessment" sandbox="allow-popups allow-popups-to-escape-sandbox" loading="lazy" referrerpolicy="no-referrer" width="420" height="180"></iframe>学术引用 (APA · BibTeX · CFF)
APA 引用
CleanExpo. (2026). database-migration security audit report (audit version 8) [Author version unspecified]. Skillstore. https://skillstore.io/skills/cleanexpo-database-migration/audits/8BibTeX 引用
@techreport{cleanexpo-cleanexpo-database-migration-2026,
author = {CleanExpo},
title = {database-migration security audit report (audit version 8)},
institution = {Skillstore},
year = {2026},
number = {8},
url = {https://skillstore.io/skills/cleanexpo-database-migration/audits/8},
note = {Author version unspecified}
}CITATION.cff
cff-version: 1.2.0
message: "If you use this Skill, cite its author and this versioned security audit report."
title: "database-migration security audit report (audit version 8)"
version: "unspecified"
type: report
authors:
- name: "CleanExpo"
date-released: "2026-07-05"
url: "https://skillstore.io/skills/cleanexpo-database-migration/audits/8"
identifiers:
- type: other
value: "skillstore:cleanexpo-database-migration:audit:8"
description: "Skillstore immutable audit report identifier"
比较变体
4 个可安装变体每位作者的技能都保持为独立的可安装项。推荐变体按 Skillstore 证据排序。
为什么此变体排名第一
Skillstore 评分
评分依据 证据置信度: 中你能构建什么
添加租户表
为新的工作区范围表创建迁移计划,包括索引、约束和 RLS 策略说明。
标准化迁移审查
使用检查清单审查迁移文件的幂等性、工作区隔离和文档缺口。
审计 RLS 变更
在发布前检查拟议策略是否遵循 user_organizations 和 workspaces join 模式。
试试这些提示
使用此数据库迁移技能为 [table or change] 规划一个 Supabase 迁移。包括文件名、所需检查和审查清单。
为 [feature] 创建迁移大纲,其中包括工作区隔离、索引、约束、注释和 RLS 策略指导。
审查此迁移的幂等性、RLS 覆盖范围、工作区隔离、外键和操作风险。返回按优先级排序的修复项。
为 [schema change] 设计安全的 Supabase 迁移序列。包括依赖项、回滚考虑、RLS 审查点和验证步骤。
最佳实践
- 创建新文件前检查现有 schema 引用和迁移。
- 使用幂等语句,确保重复执行不会失败。
- 应用每个 RLS 策略前,根据工作区隔离要求进行审查。
避免
- 创建租户表时没有 workspace_id 列或索引。
- 添加宽泛的系统策略时,没有将其限定到可信角色范围。
- 在检查语法、约束和现有对象前应用迁移。