Skip to content

FinanSuにシードデータを追加#1107

Open
Wakai111 wants to merge 7 commits into
developfrom
feat/wakake/make-sponsorshipActivity-seed-data
Open

FinanSuにシードデータを追加#1107
Wakai111 wants to merge 7 commits into
developfrom
feat/wakake/make-sponsorshipActivity-seed-data

Conversation

@Wakai111

@Wakai111 Wakai111 commented Jun 6, 2026

Copy link
Copy Markdown
Collaborator

対応Issue

resolve #0

概要

FinanSuにシードデータを増やしました。
産学局側と財務側を少しずつだけ増やしました。本当はもう少し増やしたかったけど、よくわからなくなってきたので一旦このくらい。しばらくしたらまた増やすかもしれないです。
変更ファイル:mysql/seed/000001_initial_schema_seed.sql

画面スクリーンショット等

  • URL
    スクリーンショット

テスト項目

  • make run-all または make run-db-init がエラーなく実行できる
  • 追加したシードデータがDBに登録されている

備考

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 を追加

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

コメントに -- sponsor_style を追加 と記載されていますが、実際にデータを挿入しているテーブルは sponsorship_activities です。開発者や他のレビューアが混乱しないよう、コメントを -- sponsorship_activities を追加 に修正することをお勧めします。

-- sponsorship_activities を追加

*/

-- sponsor を追加
INSERT INTO

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

テーブルの依存関係として、activities テーブルや sponsorship_activities テーブルは sponsors テーブルの id を外部キーとして参照しています。

現在、activities へのインサート(188行目付近)が sponsors へのインサート(560行目付近)よりも前に記述されているため、外部キー制約(Foreign Key Constraint)が有効な環境でこのシードスクリプトを実行すると、インサート時にエラーが発生する可能性があります。

データの整合性とスクリプトの実行順序の安全性を確保するため、sponsors テーブルへのインサート処理を activitiessponsorship_activities よりも前に実行される位置(ファイルのより上部、例えば users の後など)に移動させることをお勧めします。

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jun 12, 2026

Copy link
Copy Markdown

Deploying finansu with  Cloudflare Pages  Cloudflare Pages

Latest commit: abd2795
Status: ✅  Deploy successful!
Preview URL: https://0d48ee7f.finansu.pages.dev
Branch Preview URL: https://feat-wakake-make-sponsorship.finansu.pages.dev

View logs

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 this pull request may close these issues.

1 participant