Skip to content

feat(dystopia): drop the legacy karte tables - #1548

Merged
panicboat merged 1 commit into
feat/dystopia-other-screensfrom
feat/dystopia-drop-legacy-karte-tables
Oct 17, 2026
Merged

panicboat merged 1 commit into
feat/dystopia-other-screensfrom
feat/dystopia-drop-legacy-karte-tables

Conversation

@panicboat

Copy link
Copy Markdown
Owner

Why

#1542 でカルテを新しい表(karte.kartes・karte.events)に作り替え、アプリから旧カルテの 3 表(karte.entries・karte.reports・karte.access)への参照を外しました。本 PR はその旧表を削除します。#1517 / #1519 の対応の第 4 段のうち、4d です。stack: #1521 → #1542 → #1544 → #1545 → #1546 → #1547 → 本 PR。

Deploy order

#1521〜#1547 を main に入れて本番デプロイが終わってから、本 PR を別に merge してください。

dystopia/lambda/README.md のとおり、migration はアプリより先に反映されます。同じデプロイに入れると、アプリが入れ替わるまでの間、古いアプリが消えた表を読んでエラーになります。

Decisions

  • 旧表のデータは新しい表へ移さない。本番の既存カルテと、その通報・閲覧許可の行はこの migration で消える(feat(dystopia): record a karte as one booking-to-aftercare series with events #1542 の Deploy impact のとおり)
  • down は戻せないことを示すエラーにする(データを戻せないため)
  • karte スキーマは新しい表が使うので残す
  • 新しい表の既定値(last_activity_at などの default)は今のアプリが使っているので残す

Verification

  • アプリ・seed・設定(Ruby / TS / YAML / Terraform)に旧表への参照がないことを grep で確認(migrate ディレクトリを除いてヒット 0)
  • spec/config/db/karte_schema_spec.rb(karte スキーマには events と kartes だけがある): migration を足す前は失敗(access・entries・reports が残る)、足した後は通過
  • monolith: HANAMI_ENV=test bundle exec rspec → 775 examples, 0 failures
  • 使い捨て DB で、空から hanami db migrate と hanami db seed が通り、karte スキーマに events・kartes だけが残ることを確認

Refs #1517
Refs #1519

🤖 Generated with Claude Code

https://claude.ai/code/session_01DA9qTtJtm2tPquKk7hyPR5

@panicboat
panicboat added this pull request to stack #1543 October 17, 2026 01:35
@coderabbitai

coderabbitai Bot commented Oct 17, 2026 •

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: a57b8925-875f-4cc3-bd2e-eee1a60f4777
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@panicboat-github-workflow-bot panicboat-github-workflow-bot Bot added the deploy:monolith Auto-generated deployment label label Oct 17, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Kustomize Diff

Service: monolith
Environment: production

No changes

@panicboat
panicboat marked this pull request as ready for review October 17, 2026 01:44
@panicboat
panicboat merged commit cbb86d7 into main Oct 17, 2026
13 checks passed
@panicboat
panicboat deleted the feat/dystopia-drop-legacy-karte-tables branch October 17, 2026 01:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

deploy:monolith Auto-generated deployment label

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant