[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6CZJ0RVW1Q8P3VPXVRYA3TZ":3,"skill-same:01M6CZJ0RVW1Q8P3VPXVRYA3TZ":50},{"skillNo":4,"name":5,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":6,"repositoryNo":11,"starsCount":12,"licenseSpdxId":13,"licenseFileUrl":6,"sourceHtmlUrl":14,"categories":15,"keywords":21,"publishedAt":25,"linkOnly":26,"markdownContent":27,"markdownBody":27,"frontMatter":28,"refName":29,"commitSha":30,"skillDirectory":31,"forksCount":32,"repositoryHtmlUrl":33,"repositoryHomepageUrl":6,"ownerHtmlUrl":34,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":35,"install":36,"resources":49},"01M6CZJ0RVW1Q8P3VPXVRYA3TZ","database-migration",null,"Testing-itay\u002FDevTools-Security-Lab","Testing-itay","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F230151326?v=4","01M6CZH4Q5Z571N5ZRZWMQ3YBS","01M6CZH4W55EHV4P1D3SNNRXSS",0,"MIT","https:\u002F\u002Fgithub.com\u002FTesting-itay\u002FDevTools-Security-Lab\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fdatabase-migration\u002FSKILL.md",[16],{"categoryNo":17,"categoryName":18,"taxonomyType":19,"taxonomyTypeDesc":20},"01JBSEEDCAT000000000000010","后端与接口","SCENARIO","使用场景",[22,23,24],"database","database migration","migration","2026-11-10 10:12:30",false,"\n\n\n\n---\nname: Database Migration\ndescription: Generate and validate database migration scripts across multiple ORMs.\n---\n\n# Database Migration Skill\n\nCreate safe, reversible database migrations that preserve data integrity and support multiple ORM ecosystems.\n\n## Migration Best Practices\n\n- **One logical change per migration**: Add a column, create a table, or alter an index—not all at once. Simplifies rollback and review.\n- **Idempotency where possible**: Use `IF NOT EXISTS`, `IF EXISTS` to make migrations safe to re-run.\n- **Avoid data loss**: Prefer adding columns as nullable, backfilling, then adding constraints. Avoid dropping columns with data without explicit backup steps.\n- **Naming**: Use descriptive names (e.g., `add_user_email_index`, `create_orders_table`) and timestamps for ordering.\n\n## Rollback Strategies\n\n- Every migration should have a corresponding down\u002Frollback script that restores the previous schema.\n- For destructive changes (DROP, DELETE), document data backup and restore procedures.\n- Test rollbacks in a staging environment before production deployment.\n- Use transactions where the database supports DDL in transactions (e.g., PostgreSQL); otherwise, design for partial failure recovery.\n\n## Data Integrity\n\n- Add foreign keys, check constraints, and NOT NULL only after data is validated and backfilled.\n- Use batched updates for large tables to avoid long-running transactions and lock contention.\n- Validate migration scripts against a copy of production data before applying to production.\n\n## ORM Support\n\n- **SQLAlchemy\u002FAlembic**: Generate migrations with `alembic revision`, use `op.batch_alter_table` for SQLite.\n- **TypeORM**: Use `synchronize: false` in production; rely on migration files.\n- **Django**: Use `makemigrations` and `migrate`; avoid editing applied migrations.\n- **Prisma**: Use `prisma migrate dev` for development; `prisma migrate deploy` for production.\n\nProvide migration files with clear comments and a summary of schema changes.\n",{},"main","1188d0dcbd4e64256d35bfe14c955ba1c541b1de",".claude\u002Fskills\u002Fdatabase-migration",13,"https:\u002F\u002Fgithub.com\u002FTesting-itay\u002FDevTools-Security-Lab","https:\u002F\u002Fgithub.com\u002FTesting-itay","2026-10-16 16:13:27",{"source":7,"skillName":5,"commands":37,"prompt":47,"zipAvailable":48},[38,41,44],{"tool":39,"command":40},"npx","npx skills add Testing-itay\u002FDevTools-Security-Lab --skill database-migration",{"tool":42,"command":43},"bunx","bunx skills add Testing-itay\u002FDevTools-Security-Lab --skill database-migration",{"tool":45,"command":46},"pnpm","pnpm dlx skills add Testing-itay\u002FDevTools-Security-Lab --skill database-migration","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FTesting-itay\u002FDevTools-Security-Lab\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fdatabase-migration\u002FSKILL.md",true,[],[51,60,69,78,87,92],{"skillNo":52,"name":53,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":6,"repositoryNo":11,"starsCount":12,"licenseSpdxId":13,"licenseFileUrl":6,"sourceHtmlUrl":54,"categories":55,"keywords":56,"publishedAt":25},"01M6CZR9VVRMS754ZKH7NPNMB1","sds-plugin-a11y-check","https:\u002F\u002Fgithub.com\u002FTesting-itay\u002FDevTools-Security-Lab\u002Fblob\u002Fmain\u002Fsrc\u002FnewDIR\u002Fbundles\u002Fplugins\u002Fsds-frontend-plugin\u002Fskills\u002Fsds-plugin-a11y-check\u002FSKILL.md",[],[57,58,59],"sds plugin a11y check","check","plugin",{"skillNo":61,"name":62,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":6,"repositoryNo":11,"starsCount":12,"licenseSpdxId":13,"licenseFileUrl":6,"sourceHtmlUrl":63,"categories":64,"keywords":65,"publishedAt":25},"01M6CZR8FQ30QGEV5D3SB6DDKP","endpoint-review","https:\u002F\u002Fgithub.com\u002FTesting-itay\u002FDevTools-Security-Lab\u002Fblob\u002Fmain\u002Fsrc\u002FnewDIR\u002Fbundles\u002Fplugins\u002Fpython-api-plugin\u002Fskills\u002Fendpoint-review\u002FSKILL.md",[],[66,67,68],"endpoint review","endpoint","review",{"skillNo":70,"name":71,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":6,"repositoryNo":11,"starsCount":12,"licenseSpdxId":13,"licenseFileUrl":6,"sourceHtmlUrl":72,"categories":73,"keywords":74,"publishedAt":25},"01M6CZR6TYBN5EMBM70E096E66","schema-draft","https:\u002F\u002Fgithub.com\u002FTesting-itay\u002FDevTools-Security-Lab\u002Fblob\u002Fmain\u002Fsrc\u002FnewDIR\u002Fbundles\u002Fplugins\u002Fpython-api-plugin\u002Fagents\u002Fpy-plugin-endpoint-designer\u002Fskills\u002Fschema-draft\u002FSKILL.md",[],[75,76,77],"schema","schema draft","draft",{"skillNo":79,"name":80,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":6,"repositoryNo":11,"starsCount":12,"licenseSpdxId":13,"licenseFileUrl":6,"sourceHtmlUrl":81,"categories":82,"keywords":83,"publishedAt":25},"01M6CZR5SDWF91FHDK54XHXS67","doc-outline","https:\u002F\u002Fgithub.com\u002FTesting-itay\u002FDevTools-Security-Lab\u002Fblob\u002Fmain\u002Fsrc\u002FnewDIR\u002Fbundles\u002Fplugins\u002Fai-documentation-workflow\u002Fskills\u002Fdoc-outline\u002FSKILL.md",[],[84,85,86],"doc outline","outline","doc",{"skillNo":88,"name":53,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":6,"repositoryNo":11,"starsCount":12,"licenseSpdxId":13,"licenseFileUrl":6,"sourceHtmlUrl":89,"categories":90,"keywords":91,"publishedAt":25},"01M6CZR3Z4WZCBA5FVJZB65B1Y","https:\u002F\u002Fgithub.com\u002FTesting-itay\u002FDevTools-Security-Lab\u002Fblob\u002Fmain\u002Fsrc\u002FnewD\u002FnewDIR\u002Fbundles\u002Fplugins\u002Fsds-frontend-plugin\u002Fskills\u002Fsds-plugin-a11y-check\u002FSKILL.md",[],[57,58,59],{"skillNo":93,"name":62,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":6,"repositoryNo":11,"starsCount":12,"licenseSpdxId":13,"licenseFileUrl":6,"sourceHtmlUrl":94,"categories":95,"keywords":96,"publishedAt":25},"01M6CZR2PR7T4XYSJJWQYYPXVW","https:\u002F\u002Fgithub.com\u002FTesting-itay\u002FDevTools-Security-Lab\u002Fblob\u002Fmain\u002Fsrc\u002FnewD\u002FnewDIR\u002Fbundles\u002Fplugins\u002Fpython-api-plugin\u002Fskills\u002Fendpoint-review\u002FSKILL.md",[],[68,66,67]]