スキル一覧に戻る
spences10

migration-patterns

by spences10

6🍴 0📅 2026年1月21日
GitHubで見るManusで実行

SKILL.md


name: migration-patterns

prettier-ignore

description: Database migration patterns for SQLite. Use when creating migrations, modifying schema, or running database changes.

Migration Patterns

Quick Start

-- migrations/001_add_tags.sql
-- Migration: Add Tags Feature
-- Created: 2025-01-15
-- Description: Adds tags table for organizing contacts

CREATE TABLE IF NOT EXISTS tags (
  id TEXT PRIMARY KEY,
  user_id TEXT NOT NULL,
  name TEXT NOT NULL,
  color TEXT NOT NULL,
  created_at INTEGER NOT NULL,
  updated_at INTEGER NOT NULL,
  FOREIGN KEY (user_id) REFERENCES user(id) ON DELETE CASCADE
);

CREATE INDEX IF NOT EXISTS idx_tags_user_id ON tags(user_id);

Core Principles

  • Dual approach: Create migration in migrations/ + update schema.sql
  • Naming: {number}_{description}.sql (e.g., 001_add_tags.sql)
  • Zero-padded numbers: 001, 002, 003 (run alphabetically)
  • IF NOT EXISTS: Always use for idempotency
  • One feature per migration: Keep focused
  • Include indexes: Add in same migration as tables
  • Never modify: Once committed, create new migration instead

Reference Files

スコア

総合スコア

50/100

リポジトリの品質指標に基づく評価

SKILL.md

SKILL.mdファイルが含まれている

+20
LICENSE

ライセンスが設定されている

0/10
説明文

100文字以上の説明がある

0/10
人気

GitHub Stars 100以上

0/15
最近の活動

3ヶ月以内に更新がある

0/10
フォーク

10回以上フォークされている

0/5
Issue管理

オープンIssueが50未満

+5
言語

プログラミング言語が設定されている

+5
タグ

1つ以上のタグが設定されている

0/5

レビュー

💬

レビュー機能は近日公開予定です