Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Database Migration ツールの導入 #142

Open
osoken opened this issue Feb 22, 2025 · 0 comments · May be fixed by #145
Open

Database Migration ツールの導入 #142

osoken opened this issue Feb 22, 2025 · 0 comments · May be fixed by #145

Comments

@osoken
Copy link
Collaborator

osoken commented Feb 22, 2025

改善詳細 / Details of Improvement

  • 現状、データベースのスキーマ管理の仕組みが整備されておらず、今後のスキーマ変更に向けて体制を整える必要がある
  • Alembicを導入することで以下の改善を図る:
    • マイグレーションの履歴管理が可能に
    • ロールバック機能の実装
    • 開発/ステージング/本番環境での整合性担保
    • チーム開発における schema 変更の追跡性向上

スクリーンショット / Screenshot

  • 本件はDB管理ツールの導入のため、該当なし

期待する見せ方・挙動 / Expected behavior

  • alembic init によるプロジェクト初期設定
  • 既存DBスキーマの自動検出による初期マイグレーションファイルの生成
  • 以降のスキーマ変更時:
    • alembic revision でマイグレーションファイル作成
    • alembic upgrade head で最新状態への移行
    • alembic downgrade でロールバック実行

動作環境・ブラウザ / Environment

  • Database: PostgreSQL
  • Python
  • 関連パッケージ:
    • SQLAlchemy
    • alembic
  • 対象環境: 開発/ステージング/本番
@osoken osoken linked a pull request Feb 22, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant