Add member-node association support

Members can now have multiple associated nodes, each with a public_key
and node_role (e.g., 'chat', 'repeater'). This replaces the single
public_key field on members with a one-to-many relationship.

Changes:
- Add MemberNode model for member-node associations
- Update Member model to remove public_key, add nodes relationship
- Update Pydantic schemas with MemberNodeCreate/MemberNodeRead
- Update member_import.py to handle nodes list in seed files
- Update API routes to handle nodes in create/update/read operations
- Add Alembic migration to create member_nodes table and migrate data
- Update example seed file with new format
This commit is contained in:
Claude
2025-12-05 20:34:09 +00:00
parent 0016edbdac
commit a4b13d3456
9 changed files with 336 additions and 54 deletions

View File

@@ -1,6 +1,16 @@
# Example members seed file
# Each member can have multiple nodes with different roles (chat, repeater, etc.)
members:
- name: Example Member
callsign: N0CALL
role: Network Operator
description: Example member entry
description: Example member entry with multiple nodes
nodes:
- public_key: 0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef
node_role: chat
- public_key: fedcba9876543210fedcba9876543210fedcba9876543210fedcba9876543210
node_role: repeater
- name: Simple Member
callsign: N0CALL2
role: Observer
description: Member without any nodes