FinanSuにシードデータを追加#1107
Conversation
There was a problem hiding this comment.
Code Review
This pull request updates the database seed script 000001_initial_schema_seed.sql to expand the initial schema data, including adding new years, year periods, financial records, divisions, budgets, sponsors, and sponsorship activities, while temporarily commenting out some inserts due to column mismatches. Feedback on these changes highlights a potential foreign key constraint violation because sponsors are inserted after tables that reference them, and points out a misleading SQL comment that should be updated to correctly reflect the table being populated.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
| ('ウォルトクリエイト株式会社', '03-3456-7890', 'walt@next-create.example.com', '新潟県長岡市3-3-3', 'ウォルト', '2026-02-14 09:15:00', '2026-02-14 09:15:00'), | ||
| ('中田企画合同会社', '03-4567-8901', 'contact@nakata-planning.example.com', '新潟県長岡市4-4-4', '中田 慎吾', '2026-08-01 14:45:00', '2026-08-01 14:45:00'); | ||
|
|
||
| -- sponsor_style を追加 |
| */ | ||
|
|
||
| -- sponsor を追加 | ||
| INSERT INTO |
There was a problem hiding this comment.
テーブルの依存関係として、activities テーブルや sponsorship_activities テーブルは sponsors テーブルの id を外部キーとして参照しています。
現在、activities へのインサート(188行目付近)が sponsors へのインサート(560行目付近)よりも前に記述されているため、外部キー制約(Foreign Key Constraint)が有効な環境でこのシードスクリプトを実行すると、インサート時にエラーが発生する可能性があります。
データの整合性とスクリプトの実行順序の安全性を確保するため、sponsors テーブルへのインサート処理を activities や sponsorship_activities よりも前に実行される位置(ファイルのより上部、例えば users の後など)に移動させることをお勧めします。
Deploying finansu with
|
| Latest commit: |
abd2795
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://0d48ee7f.finansu.pages.dev |
| Branch Preview URL: | https://feat-wakake-make-sponsorship.finansu.pages.dev |
対応Issue
resolve #0
概要
FinanSuにシードデータを増やしました。
産学局側と財務側を少しずつだけ増やしました。本当はもう少し増やしたかったけど、よくわからなくなってきたので一旦このくらい。しばらくしたらまた増やすかもしれないです。
変更ファイル:
mysql/seed/000001_initial_schema_seed.sql画面スクリーンショット等
URLスクリーンショット
テスト項目
make run-allまたはmake run-db-initがエラーなく実行できる備考