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/api-bands.tsx | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

(limited to 'app/routes/api-bands.tsx')

diff --git a/app/routes/api-bands.tsx b/app/routes/api-bands.tsx
index 64a9269..68efdeb 100644
--- a/app/routes/api-bands.tsx
+++ b/app/routes/api-bands.tsx
@@ -1,5 +1,5 @@
 import type { ActionFunctionArgs } from "react-router";
-import { createBand, getIpAddress, listBands, toSlug } from "~/lib/db.server";
+import { createBand, getIpAddress, listBands, toSlug, type MemberInput } from "~/lib/db.server";
 
 export function loader() {
   return Response.json(listBands());
@@ -33,7 +33,7 @@ export async function action({ request }: ActionFunctionArgs) {
       description: (body.description as string) || null,
       status: (body.status as string) || "active",
       links: (body.links as { label: string; url: string }[]) || [],
-      artists: (body.artists as { id: string; role: string | null }[]) || [],
+      members: (body.members as MemberInput[]) || [],
       message: (body.message as string) || "API import",
       ip_address: getIpAddress(request),
     });
-- 
cgit v1.2.3

