From 184e6947707ecdf07dfa3a5cbc6e51cf9440e93a Mon Sep 17 00:00:00 2001
From: yyamashita <yyamashita@mosquit.one>
Date: Sun, 10 May 2026 00:21:04 +0900
Subject: Add members table with membership period and note support

Replace band_artists + member_periods with a single members table
(id, band_id, artist_id, role, since, until, note, order_index).
Each row represents one membership period, so rejoining artists
get multiple rows. Existing band_artists data is auto-migrated on
startup. Export format bumped to version 3.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
---
 app/routes/band-history.tsx | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

(limited to 'app/routes/band-history.tsx')

diff --git a/app/routes/band-history.tsx b/app/routes/band-history.tsx
index 954fd52..1fa2854 100644
--- a/app/routes/band-history.tsx
+++ b/app/routes/band-history.tsx
@@ -23,8 +23,9 @@ export default function BandHistory() {
       ) : (
         <ol className="rev-list">
           {revisions.map((rev, i) => {
-            let snap: { name?: string; area?: string; links?: unknown[]; artists?: unknown[] } = {};
+            let snap: { name?: string; area?: string; links?: unknown[]; members?: unknown[]; artists?: unknown[] } = {};
             try { snap = JSON.parse(rev.snapshot); } catch { /* ignore */ }
+            const memberCount = snap.members?.length ?? snap.artists?.length ?? 0;
             return (
               <li key={rev.id} className="rev">
                 <div className="rev-header">
@@ -37,7 +38,7 @@ export default function BandHistory() {
                 <div className="rev-snap">
                   <p>名前: {snap.name ?? "—"}</p>
                   {snap.area && <p>拠点: {snap.area}</p>}
-                  <p>リンク: {snap.links?.length ?? 0}件 / メンバー: {snap.artists?.length ?? 0}人</p>
+                  <p>リンク: {snap.links?.length ?? 0}件 / メンバー: {memberCount}件</p>
                 </div>
               </li>
             );
-- 
cgit v1.2.3

